1 // { dg-do run { target c++11 } }
3 // Test user-defined literals.
4 // Test simple operator declaration and definition.
11 long double operator"" _v(long double);
12 std::string operator"" _w(const char16_t*, size_t);
13 unsigned operator"" _w(const char*);
16 operator"" _i(long double y)
17 { return std::complex<double>(0.0L, y); }
22 long double x = operator"" _v(1.2L);
25 std::string s = operator"" _w(u"one", 3);
28 unsigned u = operator"" _w("Hello, World!");
31 std::complex<double> i = operator"" _i(2.0);
32 assert(i == std::complex<double>(0.0, 2.0));
42 operator"" _v(long double x)
46 operator"" _w(const char16_t*, size_t)
47 { return std::string("boo"); }
50 operator"" _w(const char* str)
51 { return strlen(str); }