For user defined string literals, is the given string guaranteed null terminated if I use the following form of definition? I know that the size given with second parameter count without any termination if there is any.
void operator"" _x( const char* n, size_t s)
{
std::cout << "String: " << s << " Len: " << s << std::endl;
}
If I use this version of definition I see no null termination character!
template <class T, T... Chrs>
void operator""_s()
{
std::cout << __PRETTY_FUNCTION__ << std::endl;
}
template <char...> void operator "" _d(){} "Hallo"_d;
? This did not compile with g++. Did that mean it is impossible to use any templated form with user defined string literals? – Unstudiedtemplate<char...> type operator""_d()
is the only allowed form. Every other use of templates is ill-formed. I don't know why it doesn't compile under g++, because it does so for me. – Cocky"test"_d;
? – Unstudied