Please quote some context. From Google Groups, don't use the Reply link
at the bottom of the message, click on Show Options at the top of the
message and use the Reply link revealed there. I wrote:
Just a small nit: names that start with an underscore followed by an
uppercase letter are reserved for the implementation. You should not
use them in your own code. So READER_H_ would be a better choice.
Hi Gavin,
Well its not like that.
It is.
It's just some programming style.
It's not.
You can actually use these names.
You *can*, and you may get away with no problems. I said you *should
not*. The language standard agrees with me.
17.4.3.1.2
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 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.
As I said, this is a relatively minor point. But once you know them,
the rules are very simple and help ensure that you will not have name
clashes with the implementation.
There are a few other places where these kind
of names are used. Suppose i am building a big library and I want
others to use it. There I declare names starting with underscore and
write it to mean that is my system (The whole software as it is).
What happens if my program uses your library and someone else's library
too, and you have both used that naming convention? Why not just put
your library in its own namespace?
The most convenient way that I found out is you keep your own name n number
for this. So lets say you have <Some-File-Name>.h is the file. So
please take this name and give
#ifndef _<Some-file-name><DATE stamp><Time stamp>
Or something like that.
Something like that, yes - just without the leading underscore.
Gavin Deane