Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > about macro definition

Reply
Thread Tools

about macro definition

 
 
hpsoar
Guest
Posts: n/a
 
      03-08-2009
Now I'm reading a book, which annotated the sgi stl. And I found the
names of macros often starts with two underline, such as
__STL_CONFIG_H, I wonder why so, and why not start with only one like
_STL_CONFIG_H
 
Reply With Quote
 
 
 
 
Alf P. Steinbach
Guest
Posts: n/a
 
      03-08-2009
* hpsoar:
> Now I'm reading a book, which annotated the sgi stl. And I found the
> names of macros often starts with two underline, such as
> __STL_CONFIG_H, I wonder why so, and why not start with only one like
> _STL_CONFIG_H


Both forms are reserved to the implementation (of standard library), so it
doesn't matter. It's just a choice they made for whatever reason. An ordinary
C++ program or library should *never* use such reserved name forms, so,
absolutely do not emulate what they do, because that code operatoes under very
different conditions and rules than your code does.


Cheers & hth.,

- Alf

--
Due to hosting requirements I need visits to [http://alfps.izfree.com/].
No ads, and there is some C++ stuff! Just going there is good. Linking
to it is even better! Thanks in advance!
 
Reply With Quote
 
 
 
 
hpsoar
Guest
Posts: n/a
 
      03-08-2009
On 3月8日, 下午3时25分, "Alf P. Steinbach" <(E-Mail Removed)> wrote:
> * hpsoar:
>
> > Now I'm reading a book, which annotated the sgi stl. And I found the
> > names of macros often starts with two underline, such as
> > __STL_CONFIG_H, I wonder why so, and why not start with only one like
> > _STL_CONFIG_H

>
> Both forms are reserved to the implementation (of standard library), so it
> doesn't matter. It's just a choice they made for whatever reason. An ordinary
> C++ program or library should *never* use such reserved name forms, so,
> absolutely do not emulate what they do, because that code operatoes under very
> different conditions and rules than your code does.
>
> Cheers & hth.,
>
> - Alf
>
> --
> Due to hosting requirements I need visits to [http://alfps.izfree.com/].
> No ads, and there is some C++ stuff! Just going there is good. Linking
> to it is even better! Thanks in advance!


thanks
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Run-time template list definition / Run-time variable type definition Pierre Yves C++ 2 01-10-2008 02:52 PM
Automagic determination of definition based on definition location. Jon Slaughter C++ 4 10-26-2005 05:00 PM
can a class definition inside another class's definition Jianli Shen C++ 1 03-13-2005 06:02 PM
How to use #ifndef #define, etc, in a macro definition Peng Yu C++ 6 10-03-2004 11:50 PM
help?: incomplete definition with complete definition in scope Ark C Programming 1 08-07-2004 04:21 PM



Advertisments