Boost logo

Boost :

From: Terje Slettebø (tslettebo_at_[hidden])
Date: 2003-01-08 17:02:33


>From: "David Abrahams" <dave_at_[hidden]>

> "Paul Mensonides" <pmenso57_at_[hidden]> writes:
>
> >> hartmutkaiser_at_[hidden] (Hartmut Kaiser) writes:
> >>
> >> >
> >> > // The following expands to
> >> > //
> >> > // typedef char (&sizeN_t)[N];
> >> > //
> >> > // for N = 1..BOOST_MAX_SIZETYPE_COUNT
> >> > #define SIZETYPE(z, n, nil) \
> >> > typedef char (&size ## n ## _t)[n]; \
> >> > /**/
> >>
> >> 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 ;-)

Even then, you're not home and dry. Kevlin Henney has mentioned that names
ending with "_t" are reserved by POSIX, so they shouldn't be used in
non-implementation code. This includes size1_t, etc., as generated by the
above macro.

Regards,

Terje


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