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