Hello,
Does the vector class have a copy constructor. If yes why isn't it working for me.
I have this copy constructor for my own class:
where Conditions is a std::vector and I am trying to copy it.Code:CONTROL(CONTROL& ctrl) { this->bNot = ctrl.bNot; this->type = ctrl.type; this->value = ctrl.value; this->Conditions = ctrl.Conditions; }
When i compile I get the error: Error 8 error C2558: class 'CONTROL' : no copy constructor available or copy constructor is declared 'explicit' c:\program files\microsoft visual studio 8\vc\include\vector 1125
What have i done wrong? Should I create the new vector and copy element by element?




Reply With Quote