Recently, in the gcc-trunk sources was implemented the “user defined literals”.
Tell me please, do I understand correctly that I can`t define a “user defined literals” for variadic char template?
template<char... chars>
int operator"" _call() { return sizeof...(chars); }
...
std::cout << "method"_call;
Up.
I don`t understand why this expression is allowed:
template<char... chars>
int operator"" _call() { return sizeof...(chars); }
...
std::cout << 12345566_call;
and this one is disallowed:
template<char... chars>
int operator"" _call() { return sizeof...(chars); }
...
std::cout << method_call;
?
What’s the point?
Up.
this is because of the ambiguity?
Thanks.
method_callis a valid identifier As is for examplesome_callormy_call. Now imagine how much code would be broken if such identifiers were allowed to be redefined byoperator"".