Original Post
hey im using microsoft vc++ to compile this code... the main problem im guessing is that it seems i can't modify the members of the 'this' pointer in the copy constructor. Does anyone know why this could be happening? if i need to post more code, let me know. thanks. [Edited by - arkmaster on December 24, 2004 10:08:37 PM]
template<class T>
class DL_List
{
public:
DL_List();
DL_List(const DL_List<T> &);
~DL_List();
...
private:
long size;
DL_List<T> *firstptr;
DL_List<T> *lastptr;
...
}
template<class T>
DL_List<T>::DL_List(const DL_List<T> &init)
{
//HERES A PROBLEM THAT IM BAFFLED AT...when i run the following
//3 lines, no modifications are made to the current object
size = 0;
firstptr = NULL;
lastptr = NULL;
DL_ListNode<T>* currptr = init.firstptr;
while (currptr)
{
T data = currptr->data;
AddToBack(data);
currptr = currptr->nextptr;
}
}