Hello folks, I am working ona a circular double linked list and trying to overload the operator= operand but I think my logic is false.
It takes in a linked list and inserts the data into the current linked list.
I believe this is not a deep copy
Code:template <class T> CList<T>& CList<T>::operator=(const CList<T> &a){ if(this!=&a){ if(a.curr_){ Node<T> *nn_ = a.curr_; do{ nn_ = nn_->next_; insert(nn_->data_); }while(nn_!=a.curr_); } } return *this; }



LinkBack URL
About LinkBacks


