According to cppreference it is possible to define a literal using
CSomeClass operator ""s(const char* literal, size_t size);
Now after reading the paragraph I think it should be also possible to define
CSomeClass operator ""r(const char* literal, size_t size);
(note the r ud-suffix instead of s)
Overloading s just gives the clang warning
warning: user-defined literal suffixes not starting with '_' are reserved [-Wuser-defined-literals]
which I can't really understand as I'm compiling with -std=c++14. Overloading r gives
error: invalid suffix on literal; C++11 requires a space between literal and identifier [-Wreserved-user-defined-literal]
warning: user-defined literal suffixes not starting with '_' are reserved; no literal will invoke this operator [-Wuser-defined-literals]
which seems even less accountable to me.
Why does clang emit these warnings/errors and how can I make the r ud-suffix valid.
_. The reference you link to says the same. You can't declare one calledr, but you can declare one called_r. - Mike Seymourswith C++14 andrwith C++11? I guess I'm confused about the warning on one and the error on the other. I do remember at one point the "" and the identifier were required to touch with no intervening space. Then it was relaxed. I can't remember if that was C++14 or a DR on C++11.. I'll check but I'm pretty sure his was a DR against C++11. - emsr