Suppose that there's a class called Vector, I want to overload the assignment operator for it to make it able to work like this: a = b = c;(a,b,v are objects of Vector class)
But one thing confused me. Suppose that there are two prototypes:
Vector & operator=(const Vector & v);
const Vector & operator=(const Vector & v);
Both two work in the case of 'a=b=c'. So, which one is better or right?
CopyAssignableas a requirement in the standard is defined in terms of the first, so you should probably go with that.