Once again, while replying to another question, I forgot (my fault) that literal operator templates are picked up from the set of declarations only when integer or floating literals are found.
As an example:
template <char... C>
constexpr int operator "" _x() {
return 0;
}
It can be used as 10_x
, but it cannot be used neither as foo_x
nor as "foo"_x.
Apart for the obvious reason that is because the standard says that, what's the technical reason (if any) for which they are not considered when dealing with string literals?
I found also a proposal for that (well, not exactly the same, but it gives an idea), but still that is not an option.
What prevents them to be used for strings?