A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://timsong-cpp.github.io/cppwp/n4140/lex.ext below:

[lex.ext]

2.14.8 User-defined literals [lex.ext]
user-defined-literal:
    user-defined-integer-literal
    user-defined-floating-literal
    user-defined-string-literal
    user-defined-character-literal
user-defined-integer-literal:
    decimal-literal ud-suffix
    octal-literal ud-suffix
    hexadecimal-literal ud-suffix
    binary-literal ud-suffix
user-defined-floating-literal:
    fractional-constant exponent-partopt ud-suffix
    digit-sequence exponent-part ud-suffix
user-defined-string-literal:
    string-literal ud-suffix
user-defined-character-literal:
    character-literal ud-suffix
ud-suffix:
    identifier

If L is a user-defined-integer-literal, let n be the literal without its ud-suffix. If S contains a literal operator with parameter type unsigned long long, the literal L is treated as a call of the form

operator "" X(nULL)

Otherwise, S shall contain a raw literal operator or a literal operator template ([over.literal]) but not both. If S contains a raw literal operator, the literal L is treated as a call of the form

operator "" X("n")

Otherwise (S contains a literal operator template), L is treated as a call of the form

operator "" X<'c1', 'c2', ... 'ck'>()

where n is the source character sequence c1c2...ck. [ Note: The sequence c1c2...ck can only contain characters from the basic source character set.  — end note ]

If L is a user-defined-floating-literal, let f be the literal without its ud-suffix. If S contains a literal operator with parameter type long double, the literal L is treated as a call of the form

operator "" X(fL)

Otherwise, S shall contain a raw literal operator or a literal operator template ([over.literal]) but not both. If S contains a raw literal operator, the literal L is treated as a call of the form

operator "" X("f")

Otherwise (S contains a literal operator template), L is treated as a call of the form

operator "" X<'c1', 'c2', ... 'ck'>()

where f is the source character sequence c1c2...ck. [ Note: The sequence c1c2...ck can only contain characters from the basic source character set.  — end note ]

If L is a user-defined-string-literal, let str be the literal without its ud-suffix and let len be the number of code units in str (i.e., its length excluding the terminating null character). The literal L is treated as a call of the form

operator "" X(str, len)

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;        u"one"_w;     12_w;         "two"_w;    }

 — end example ]

Example:

int main() {
  L"A" "B" "C"_x;   "P"_x "Q" "R"_y;}

 — end example ]


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4