In the standard document of N4606 ISO/IEC JTC1 SC22 WG21, http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/n4606.pdf p.34 there is an example.
long double operator "" _w(long double);
std::string operator "" _w(const char16_t*, std::size_t);
unsigned operator "" _w(const char*);
int main() {
1.2_w; // calls operator "" _w(1.2L)
u"one"_w; // calls operator "" _w(u"one", 3)
12_w; // calls operator "" _w("12")
"two"_w; // error: no applicable literal operator
}
How can I make an example of std::string operator "" _w(const char16_t*, std::size_t);
How can I convert from const char16_t * to std::string.
Other 2 functions are like this.
long double operator "" _w(long double ld){return ld;}
unsigned operator "" _w(const char*cc){return (unsigned)*cc};