lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


>>> I'm sorry, but I don't understand a single word of this.  Can you
>>> explain with less generalities?  I'm writing strict C++, which I guess
>>> corresponds to "compliance with standards", but I don't follow the
>>> next sentence.
>>
>> You seem not to be obeying the C++ standards.  If you were obeying them,
>> then you would not be defining a function named "__gc", or any other
>> identifier that starts with two underscores, and this particular compiler
>> keyword "__gc" would not disturb you by its existence.
>
> Is this a C++0x thing?  I use __new, __index, __newindex, __string,
> __gc everywhere in my code and GCC has not complained a bit, so I
> don't see how this isn't compliant with the C++ standard.  Do you have
> documentation of this claim?

ISO/IEC 14882:1998(E) (according to Google):

17.4.3.1.2 - Global names [lib.global.names]

-1- 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 (lex.key) 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.*

          [Footnote: Such names are also reserved in namespace ::std
(lib.reserved.names). --- end foonote]


HTH,
Alexander.