This question arose because of the impossibility of using uniform initialization syntax with the auto keyword, because it treats it as std::initializer_list<T> (explanation in the comments here ).
Take the following code example:
class X { }; int x( X() );
What does the compiler do with auto x ?
Reasoning for every opportunity:
Copy / move construction: I see that this is the correct behavior because (1) is seen as a kind of defect.
Function prototype: It seems unlikely as there is no return type of return.
Compilation error:. If the compiler analyzes this as a function prototype, this may lead to a compile-time error due to the lack of a return type.
What does the C ++ 0x standard say, should this be interpreted as?
user802003
source share