Hello. I implement the list class. I have a structure:
template<class T> struct object { T object; // сам объект T *nextObject = NULL; } And the class itself:
class Queue { Object *head; public: void push_back(???) { Object obj = new Object; obj->object = ??? } } The essence of the question: what parameter to pass to the push_back method?
Queuetemplate, otherwise - whatObjectdoes it contain? Well and further, it is clear that inpush_backit is necessary to transfer eitherT, orconst T&. But I would not use an assignment, but a copy constructor. - HarryQueueshould be template, i.e.Object<нужный_тип> *head;with all that it implies. - αλεχολυτ