Making a deep copy

Would this be considered a deep copy

1
2
3
4
5
void Edge::operator =(Edge rhs){
    theEdge.v1 = rhs.theEdge.v1;
    theEdge.v2 = rhs.theEdge.v2;
    theEdge.weight = rhs.theEdge.weight;
}



I'm supposed to overload the assignment operator for Edge class. I'm also wondering will this make an equivalence operator such as == or != valid to use on two Edge class objects as well?
Last edited on
> Would this be considered a deep copy
you are taking the parameter by copy, and then reimplementing what the default assignment operator already does.

that last part is a guess, as you didn't bother to post anything that could give us a remote idea of how your class is defined


> will this make an equivalence operator such as == or != valid
no, you need to code those.
Topic archived. No new replies allowed.