最近,在 gcc-trunk 源代码中实现了“用户定义的文字”。请告诉我,我是否正确理解我不能为可变字符模板定义“用户定义的文字”?
template<char... chars>
int operator"" _call() { return sizeof...(chars); }
...
std::cout << "method"_call;
向上。
我不明白为什么允许这种表达方式:
template<char... chars>
int operator"" _call() { return sizeof...(chars); }
...
std::cout << 12345566_call;
这个是不允许的:
template<char... chars>
int operator"" _call() { return sizeof...(chars); }
...
std::cout << method_call;
?
重点是什么?
向上。 这是因为模棱两可吗?
谢谢。