Question
* @description Assignment 07 part 01, practice with operator overloading. * In this first part of assignment, you need to define a ListType class *
* @description Assignment 07 part 01, practice with operator overloading. * In this first part of assignment, you need to define a ListType class * and overload the indicated operators. This version of your class * will only support list of int values. You will turn this into a * class template in part 2 of the assignment. */ #include
#ifndef _LISTTYPE_H_ #define _LISTTYPE_H_ /** ListType abstract data type * This list type is "templatized" to support creating concrete lists of * any type of object. This list supports dynamic shrinking and growing * of its size as items are appended and removed from the list. * In addition, several operators are overloaded for convenience of * inserting, accessing and outputting the list to a stream. * * @value id A unique id, each list is assigned its own unique id * upon creation. * @value size The current size (an int) or number of items currently * contained in the list. * @value allocSize The actual amount of memory we currently * have allocated. * @value item A (pointer to an) array of items of our templated *
public: ListType(); // default constructor ListType(int allocSize); // empty constructor ListType(int size, int* items); // construct from array ~ListType(); // class destructor
// getters
// member functions // overloaded operators const ListType& operator=(const ListType& rightList); // I also gave you the copy operator };
// need to include the template implementations here, if/when you templatize //#include "ListType.cpp"
#endif // _LISTTYPE_H_
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started