When and how to use a template literal operator?
问题 On cppreference there is a mentioning that one can have templated user-literal operators, with some restrictions: If the literal operator is a template, it must have an empty parameter list and can have only one template parameter, which must be a non-type template parameter pack with element type char , such as template <char...> double operator "" _x(); So I wrote one like in the code below: template <char...> double operator "" _x() { return .42; } int main() { 10_x; // empty template list