|
968 | 968 | \indextext{\idxcode{_}|see{character, underscore}}%
|
969 | 969 | \indextext{character!underscore!in identifier}%
|
970 | 970 | \indextext{reserved identifier}%
|
971 |
| -In addition, some identifiers are reserved for use by \Cpp{} |
| 971 | +In addition, some identifiers |
| 972 | +%FIXME: "appearing" isn't quite right here - reword? |
| 973 | +appearing as \grammarterm{token}{s} or \grammarterm{pp-tokens} |
| 974 | +are reserved for use by \Cpp{} |
972 | 975 | implementations and shall
|
973 | 976 | not be used otherwise; no diagnostic is required.
|
974 | 977 | \begin{itemize}
|
|
2257 | 2260 | parameter type \tcode{unsigned long long}, the literal \placeholder{L} is treated as a call of
|
2258 | 2261 | the form
|
2259 | 2262 | \begin{codeblock}
|
2260 |
| -operator "" @\placeholder{X}@(@\placeholder{n}@ULL) |
| 2263 | +operator ""@\placeholder{X}@(@\placeholder{n}@ULL) |
2261 | 2264 | \end{codeblock}
|
2262 | 2265 | Otherwise, \placeholder{S} shall contain a raw literal operator
|
2263 | 2266 | or a numeric literal operator template\iref{over.literal} but not both.
|
2264 | 2267 | If \placeholder{S} contains a raw literal operator,
|
2265 | 2268 | the literal \placeholder{L} is treated as a call of the form
|
2266 | 2269 | \begin{codeblock}
|
2267 |
| -operator "" @\placeholder{X}@("@\placeholder{n}@") |
| 2270 | +operator ""@\placeholder{X}@("@\placeholder{n}@") |
2268 | 2271 | \end{codeblock}
|
2269 | 2272 | Otherwise (\placeholder{S} contains a numeric literal operator template),
|
2270 | 2273 | \placeholder{L} is treated as a call of the form
|
2271 | 2274 | \begin{codeblock}
|
2272 |
| -operator "" @\placeholder{X}@<'@$c_1$@', '@$c_2$@', ... '@$c_k$@'>() |
| 2275 | +operator ""@\placeholder{X}@<'@$c_1$@', '@$c_2$@', ... '@$c_k$@'>() |
2273 | 2276 | \end{codeblock}
|
2274 | 2277 | where \placeholder{n} is the source character sequence $c_1c_2...c_k$.
|
2275 | 2278 | \begin{note}
|
|
2283 | 2286 | with parameter type \tcode{long double}, the literal \placeholder{L} is treated as a call of
|
2284 | 2287 | the form
|
2285 | 2288 | \begin{codeblock}
|
2286 |
| -operator "" @\placeholder{X}@(@\placeholder{f}@L) |
| 2289 | +operator ""@\placeholder{X}@(@\placeholder{f}@L) |
2287 | 2290 | \end{codeblock}
|
2288 | 2291 | Otherwise, \placeholder{S} shall contain a raw literal operator
|
2289 | 2292 | or a numeric literal operator template\iref{over.literal} but not both.
|
2290 | 2293 | If \placeholder{S} contains a raw literal operator,
|
2291 | 2294 | the \grammarterm{literal} \placeholder{L} is treated as a call of the form
|
2292 | 2295 | \begin{codeblock}
|
2293 |
| -operator "" @\placeholder{X}@("@\placeholder{f}@") |
| 2296 | +operator ""@\placeholder{X}@("@\placeholder{f}@") |
2294 | 2297 | \end{codeblock}
|
2295 | 2298 | Otherwise (\placeholder{S} contains a numeric literal operator template),
|
2296 | 2299 | \placeholder{L} is treated as a call of the form
|
2297 | 2300 | \begin{codeblock}
|
2298 |
| -operator "" @\placeholder{X}@<'@$c_1$@', '@$c_2$@', ... '@$c_k$@'>() |
| 2301 | +operator ""@\placeholder{X}@<'@$c_1$@', '@$c_2$@', ... '@$c_k$@'>() |
2299 | 2302 | \end{codeblock}
|
2300 | 2303 | where \placeholder{f} is the source character sequence $c_1c_2...c_k$.
|
2301 | 2304 | \begin{note}
|
|
2313 | 2316 | a well-formed \grammarterm{template-argument},
|
2314 | 2317 | the literal \placeholder{L} is treated as a call of the form
|
2315 | 2318 | \begin{codeblock}
|
2316 |
| -operator "" @\placeholder{X}@<@\placeholder{str}{}@>() |
| 2319 | +operator ""@\placeholder{X}@<@\placeholder{str}{}@>() |
2317 | 2320 | \end{codeblock}
|
2318 | 2321 | Otherwise, the literal \placeholder{L} is treated as a call of the form
|
2319 | 2322 | \begin{codeblock}
|
2320 |
| -operator "" @\placeholder{X}@(@\placeholder{str}{}@, @\placeholder{len}{}@) |
| 2323 | +operator ""@\placeholder{X}@(@\placeholder{str}{}@, @\placeholder{len}{}@) |
2321 | 2324 | \end{codeblock}
|
2322 | 2325 |
|
2323 | 2326 | \pnum
|
|
2328 | 2331 | literal \placeholder{L} is treated as a call
|
2329 | 2332 | of the form
|
2330 | 2333 | \begin{codeblock}
|
2331 |
| -operator "" @\placeholder{X}@(@\placeholder{ch}{}@) |
| 2334 | +operator ""@\placeholder{X}@(@\placeholder{ch}{}@) |
2332 | 2335 | \end{codeblock}
|
2333 | 2336 |
|
2334 | 2337 | \pnum
|
2335 | 2338 | \begin{example}
|
2336 | 2339 | \begin{codeblock}
|
2337 |
| -long double operator "" _w(long double); |
2338 |
| -std::string operator "" _w(const char16_t*, std::size_t); |
2339 |
| -unsigned operator "" _w(const char*); |
| 2340 | +long double operator ""_w(long double); |
| 2341 | +std::string operator ""_w(const char16_t*, std::size_t); |
| 2342 | +unsigned operator ""_w(const char*); |
2340 | 2343 | int main() {
|
2341 |
| - 1.2_w; // calls \tcode{operator "" _w(1.2L)} |
2342 |
| - u"one"_w; // calls \tcode{operator "" _w(u"one", 3)} |
2343 |
| - 12_w; // calls \tcode{operator "" _w("12")} |
| 2344 | + 1.2_w; // calls \tcode{operator ""_w(1.2L)} |
| 2345 | + u"one"_w; // calls \tcode{operator ""_w(u"one", 3)} |
| 2346 | + 12_w; // calls \tcode{operator ""_w("12")} |
2344 | 2347 | "two"_w; // error: no applicable literal operator
|
2345 | 2348 | }
|
2346 | 2349 | \end{codeblock}
|
|
0 commit comments