Copy constructor, objects, pointers

Posted by Pauff on Stack Overflow See other posts from Stack Overflow or by Pauff
Published on 2010-04-17T00:54:09Z Indexed on 2010/04/17 1:03 UTC
Read the original article Hit count: 293

Filed under:
|
|
|
|

Let's say I have this:

SolutionSet(const SolutionSet &solutionSet) {
    this->capacity_ = solutionSet.capacity_;
    this->solutionsList_ = solutionSet.solutionsList_; // <--
}

And solutionsList_ is a vector<SomeType*> vect*. What is the correct way to copy that vector (I suppose that way I'm not doing it right..)?

© Stack Overflow or respective owner

Related posts about c++

Related posts about copy