Re: std::vector crash

From: Paul Russo <russo_at_fnal.gov>
Date: Fri, 17 Aug 2007 13:19:29 -0500


And if you look really carefully, you will notice that ordinary people are allowed to use underscore followed by a lowercase letter, specifically because this is one of the most common naming conventions for data members of a class. Only underscore followed by an uppercase letter is reserved for the implementation.

Kevin Lynch wrote:
> Christian Holm Christensen wrote:

>>> Totally independent remark:
>>> type names should not start with an underscore in C(++). 
>>
>> Why not?!  A valid identifier in C/C++ has the following form
>>     [_a-zA-Z][_a-zA-Z0-9]*
>> That is, a letter or an underscore, follow by zero or more letters,
>> numbers, or underscores.   You can even use UTF encoded identifiers if
>> you like - the standard, I believe, is quite explicit about that.

>
> While not debating the accuracy of your regex, ISO 14882-2003 says:
>
> 2.10 Identifiers [lex.name]
> 2 In addition, some identifiers are reserved for use by C++
> implementations and standard libraries (17.4.3.1.2)
> and shall not be used otherwise; no diagnostic is required.
>
> and
>
> 17.4.3.1.2 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).
>
Received on Fri Aug 17 2007 - 20:19:36 CEST

This archive was generated by hypermail 2.2.0 : Fri Aug 17 2007 - 23:50:02 CEST