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 7638725
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T08:14:35+00:00 2026-05-31T08:14:35+00:00

Arising from my answer to Dynamic array of objects in C++ and as a

  • 0

Arising from my answer to Dynamic array of objects in C++ and as a follow up to What are the rules about using an underscore in a C++ identifier?:
apparently, names beginning with _ followed by an uppercase letter are reserved in the global namespace.

17.4.3.2.1 Global names [lib.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.11) 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.165

165) Such names are also reserved in namespace ::std (17.4.3.1).

In my answer to the first question I had a class that looked like this

class A
{
 private:
   vector<int> _Ints;
}

In the comments I was told the _Ints identifier invokes undefined behavior, since it is a reserved name. However, according to the recent draft of the standard, name look-up of a member variable occurs using the following rule:

3.4.3.1 Class members [class.qual]

If the nested-name-specifier of a qualified-id nominates a class, the name specified after the nested-namespecifier is looked up in the scope of the class (10.2), except for the cases listed below. The name shall
represent one or more members of that class or of one of its base classes

To me, that means that no member variable can ever be part of the global namespace, as its scope is the class.

And now, the question:

Is my understanding correct that member variables will never violate the implementation reserved names rule since they are not in the global namespace? If I am not correct, could someone explain my misunderstanding of the look-up rule?

  • 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-05-31T08:14:36+00:00Added an answer on May 31, 2026 at 8:14 am

    _Int clearly violates the first rule: “Each name that contains a
    double underscore (_ _) or begins with an underscore followed by an
    uppercase letter (2.11) is reserved to the implementation for any
    use.” “any use” means exactly what it says: it could
    be a predefined macro, or trigger some special behavior in the compiler,
    or anything else the compiler author wants. It doesn’t matter where you
    use the name, if you use it, it’s undefined behavior (unless the
    compiler documentation states otherwise).

    More generally, historically at least, compilers have been rather lax,
    and a number of system headers have traditionally included macros with
    names starting with a single underscore followed by a lower case letter.
    It’s probably best avoiding those as well. (Historically, even, there
    have been names without an underscore as well. I know I’ve had problems
    with the name linux becoming 1. No underscores in sight, but…
    There’s not much you can do about this, however, except change the name
    when the conflict occurs.)

    Even more generally, underscores don’t show up that well in some fonts,
    and it’s best avoiding them at either end of a symbol.

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

Sidebar

Related Questions

I am trying to convert my program from using Data.Array to Data.Array.Unboxed. As a
Question arising from my first attempt at using an Async object. I have a
I learned about multiprocessing from Python and I'm having a bit of trouble understanding
I have a requirement to store dates and durations arising from multiple different calendars.
Answer update, 12/22 : Using Peter Shor's observation that there's a homomorphism between distinct
Due to performance issues arising from row locking and a long running query in
Arising out of this question, I'm looking for an elegant (ruby) way to compute
I get the error Ambiguous type variable `p0' in the constraints: (Show p0) arising
in other words, suppose I want to send data, like text, programmatically from a
I have searched many questions regarding session_destroy and the often response from the answerers

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.