Is this legal C ++ 0x syntax?
class A
{
public:
void some_function( const std::set<std::string> &options = {} );
void some_function( const std::set<std::string> &options = std::set<std::string>() );
}
Because if that is the case, I just discovered an error in GCC 4.6.
The error I am getting is:
error: expected primary expression before '{' token
which ... is logical ... if it was illegal.
UPDATE: . As @Kerrek showed, this leads to simple C ++ 03, with aggregates and the syntax of the old binding syntax. Why is this impossible? Is it prohibited in the standard? Or are compilers to blame? Or is it surveillance? I do not see any serious problems resolving this as an alternative to explicit constructor calls.
source
share