i was doing some tests of the move semantics and I tried this :
class A{
public:
A(){printf("A CTOR\n");}
A(A&) {printf("A CTOR by copy\n");}
A(A&&){printf("A CTOR by universal reverence\n");}
};
A&& create(){
A v;
return std::move(v);
}
auto x{ create() };//this does not compile
float d[]{1.2,1.3,5,6};//this does compile
I get the following error:
error C3086: cannot find 'std::initializer_list': you need to #include <initializer_list>
I don't understand as the initializer list feature has been added to VC11 with CTP2012 nov. Is this because we have to wait for an update of the stdlib ?
I think the code is correct as I copied it from a slide from Scott meyers: Move Semantics, Rvalue References, Perfect Forwarding.
Thank you for your help. For your information, the spurious copies occured because i did not add "const" in my CTOR by copy. Best