Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8620613
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T06:37:20+00:00 2026-06-12T06:37:20+00:00

In C++11, we get user-defined literals. The C++ standard has examples of these, such

  • 0

In C++11, we get user-defined literals. The C++ standard has examples of these, such as:

long double operator "" _w(long double);

And it says the literal should start with an underscore:

17.6.4.3.5 User-defined literal suffixes
Literal suffix identifiers that do not start with an underscore are reserved for future standardization.

However, there’s another section in the standard that says

17.6.4.3.2 Global names
Certain sets of names and function signatures are always reserved to the implementation:
— Each name that contains a double underscore _ _ or begins with an underscore followed by an uppercase letter (2.12) is reserved to the implementation for any use.
— Each name that begins with an underscore is reserved to the implementation for use as a name in the global namespace.

I’m looking to better understand exactly what 17.6.4.3.2 (Global names) says/means and how it relates to 17.6.4.3.5 (User-defined literal suffixes). Specifically:

  • Does the second part of 17.6.4.3.2 (Global names) require user-defined literals (like the above _w) to be defined in a namespace (that is, not in the global namespace)? If so, I wish the standard would’ve illustrated this.
  • I presume that the first part of 17.6.4.3.2 (Global names) rules out user-defined literals like _W (followed by upper case) and __w and _w__ (two consecutive underscores). Correct?

Edit:

As a follow up, there’s a part of the standard that says:

13.5.8 User-defined literals
[…]
2 A declaration whose declarator-id is a literal-operator-id shall be a declaration of a namespace-scope function or function template (it could be a friend function (11.3)), an explicit instantiation or specialization of a function template, or a using-declaration (7.3.3). A function declared with a literal-operator-id is a literal operator. A function template declared with a literal-operator-id is a literal operator template.

Emphasis mine. When it says “namespace-scope” does that mean user-defined literals need to be declared in a user-defined namespace (i.e. not in the global namespace)?

Later edit:

It did not exist when the question was first asked, but now there is also this related question and answer, which readers can additionally check after reviewing the answers below.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T06:37:21+00:00Added an answer on June 12, 2026 at 6:37 am

    What’s in a name? 3 Basic concepts [basic] tells us:

    4 A name is a use of an identifier (2.11), operator-function-id (13.5), literal-operator-id (13.5.8), conversion-function-id (12.3.2), or template-id (14.2) that denotes an entity or label (6.6.4, 6.1).

    which we cross-reference with 13.5.8 User-defined literals [over.literal]:

    literal-operator-id:
    operator "" identifier

    While the name of a literal operator involves an identifier, that identifier does not denote an entity. (Or it’s a different identifier and different name that denotes another entity or label altogether.) As such the name of a literal operator never starts with an underscore.

    Something like operator""__w is problematic but this is not new: int i__0; is reserved as well.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

this is a route I defined: GET /user/:id controllers.Users.show(id: Long) this is the handler
The new user-defined literal concept in C++ suggests some very interesting uses of string-literals,
I am trying to get the user defined global hot key for my application.
i'm trying to get this program to break down a user defined amount of
I get user input including non-ASCII characters and non-printable characters, such as \xc2d \xa0
Is it possible to get a list of the user defined functions in JavaScript?
If I have user defined exceptions in my code, I can't get Boost test
Is there a way to get user-defined php functions, variables, constants from a php
How can I get a user-defined function to re-evaluate itself based on changed data
Is it possible to group user defined variables and get all variable names and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.