I'm trying to understand constructors calling with l/r values, so I created the class A
below :
class A {
public :
A() { cout << "called default constructor" << endl ; }
A(const A&) { cout << "called copy constructor" << endl ; }
A(const A&&) { cout << "called move constructor" << endl ; }
};
in the main function, I created an instance a
int main()
{
A a(A());
return 0;
}
but no constructor among the implemented constructors is called !
any explanation? thank you!