The syntax
X a = b;
where a and b are of type X has always meant copy construction. Whatever variants, such as:
X a = X();
are used, there is no assignment going on, and never has been. Construct and assign would be something like:
X a;
a = X();
More Related Contents:
- The copy constructor and assignment operator
- What is The Rule of Three?
- What is the copy-and-swap idiom?
- Why should the copy constructor accept its parameter by reference in C++?
- What is a converting constructor in C++ ? What is it for?
- Why copy constructor is not called in this case?
- Why must the copy assignment operator return a reference/const reference?
- How to use base class’s constructors and assignment operator in C++?
- How are C++ array members handled in copy control functions?
- What’s the most reliable way to prohibit a copy constructor in C++?
- constructor invocation mechanism
- What’s the use of the private copy constructor in c++
- Explicit copy constructor
- Why aren’t copy constructors “chained” like default constructors and destructors?
- What is this weird colon-member (” : “) syntax in the constructor?
- What is the default constructor for C++ pointer?
- Who deletes the memory allocated during a “new” operation which has exception in constructor?
- When is overloading pass by reference (l-value and r-value) preferred to pass-by-value?
- call to pure virtual function from base class constructor
- Why is this code trying to call the copy constructor?
- Destructors of builtin types (int, char etc..)
- Placement new and assignment of class with const member
- avoiding the tedium of optional parameters
- Can we return objects having a deleted/private copy/move constructor by value from a function?
- Disable copy constructor
- How to add constructors/destructors to an unnamed class?
- Why C++ copy constructor must use const object?
- What does an ampersand after this assignment operator mean?
- Why must initializer list order match member declaration order?
- Template assignment operator overloading mystery