about macro definition

Discussion in 'C++' started by hpsoar, Mar 8, 2009.

  1. hpsoar

    hpsoar Guest

    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
     
    hpsoar, Mar 8, 2009
    #1
    1. Advertising

  2. * 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!
     
    Alf P. Steinbach, Mar 8, 2009
    #2
    1. Advertising

  3. hpsoar

    hpsoar Guest

    On 3ÔÂ8ÈÕ, ÏÂÎç3ʱ25·Ö, "Alf P. Steinbach" <> 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
     
    hpsoar, Mar 8, 2009
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Peng Yu
    Replies:
    6
    Views:
    6,511
    Method Man
    Oct 4, 2004
  2. Jianli Shen
    Replies:
    1
    Views:
    645
    Victor Bazarov
    Mar 13, 2005
  3. Ark
    Replies:
    1
    Views:
    452
    Chris Torek
    Aug 7, 2004
  4. Jon Slaughter
    Replies:
    4
    Views:
    473
    Jon Slaughter
    Oct 26, 2005
  5. Pierre Yves
    Replies:
    2
    Views:
    526
    Pierre Yves
    Jan 10, 2008
Loading...

Share This Page