template <typename T> class ArrayList { private: unsigned int m_size; // current
ID: 3648491 • Letter: T
Question
template <typename T>class ArrayList
{
private:
unsigned int m_size; // current number of elements
unsigned int m_max; // maximum capacity of array m_data
T* m_data; // array to store the elements
T m_errobj; // object to return in case of error
public:
// Purpose: Default Constructor
// Postconditions: Current size and maximum size set to 0,
// and data set to NULL
// -- INLINE
ArrayList(): m_size(0), m_max(0), m_data(NULL) {};
emplate <typename T>
std::ostream& operator<< (std::ostream& out, const ArrayList<T>& alist)
{
out << "[ ";
for (unsigned int i=0; i < alist.m_size; i++){
out << alist.m_data[i] << ", ";
}
out << "]";
return out;
i need help setting up the members of the class
void swap(unsigned int i, unsigned int k);
// Purpose: appends two lists
// Parameters: alist, a list to append to the end of 'this' list
// Postconditions: current size is incremented by size of alist
// the elements of alist are appended to the elements of 'this'
void append(const ArrayList<T>& alist);
// Purpose: removes duplicates from an Arraylist
// Postconditions: all duplicate elements are removed from the list.