Boost logo

Boost :

From: Paul Mensonides (pmenso57_at_[hidden])
Date: 2003-01-08 15:54:34


----- Original Message -----
From: "David Abrahams" <dave_at_[hidden]>

> >> Careful; isn't the symbol "_t" reserved to the implementation in this
> > context?
> >
> > I thought it was only if the underscore was followed by a capital
letter, as
> > in "_T".
>
> 17.4.3.1.2 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 upper- case 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)
>
> I guess the global namespace doesn't apply to macros, huh ;-)

This is a good question. The obvious reasoning is to protect library names
and extention keywords from macros in particular. However, what is this:

namespace A {

struct _xyz { };

#define MACRO(id) id

MACRO(_xyz) var;

} // A

In other words, once '_xyz' goes into the macro as an argument, it *could*
be considered to be in the global scope. However, I think that is partially
the purpose of the second half of bullet one above (i.e. '_U')--to
distinguish between macro identifiers and regular C++ identifiers.

Paul Mensonides


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk