move sematics

If we have say a move constructor like this:
struct A {
int n;
A(){ n=0; }
A(A&& other) { n = other.n; }
};

And I do something simple as:
A a(A());

Will the object A() be copied by value to move constructor and then a rvalue reference taken to it, or will an rvalue reference be taken of A() then copied by value to move constructor?

I am guessing it works like regular references and that the reference is created then copied by value to constructor in this case.
A() will create an unnamed temporary object. Then rvalue reference to that object will be passed to move constructor of A and object a will be initialized using this constructor. Then temporary object is dstroyed. No passing by value takes place at any time.
So you are saying that function calls are not made with copy by value arguments?
Passing by reference is bassing by reference: no copy is made.
Topic archived. No new replies allowed.