In this piece of code, which constructor is actually called?
Vector v = getVector();
The vector has a copy constructor, a default constructor, and an assignment operator:
class Vector { public: ... Vector(); Vector(const Vector& other); Vector& operator=(const Vector& other); };
getVector returns a value.
Vector getVector();
The code uses the C ++ 03 standard.
The code snippet looks like it should call the default constructor and then the assignment operator, but I suspect this declaration is another form of using the copy constructor. What is right?
Sigterm
source share