Boost logo

Boost :

Subject: Re: [boost] [Config] Support for switching between std:: and boost:: equivalents.
From: Rob Stewart (rob.stewart_at_[hidden])
Date: 2015-06-05 20:14:08


On June 5, 2015 10:42:50 AM EDT, Edward Diener <eldiener_at_[hidden]> wrote:
> On 6/5/2015 10:00 AM, Rob Stewart wrote:
> > On June 5, 2015 5:30:03 AM EDT, Edward Diener
> <eldiener_at_[hidden]> wrote:
> >
> >> It is very easy to use. For library 'XXX':
> >>
> >> 1) Just include the particular Boost.config header provided for a
> >> particular interoperable library XXX:
> >>
> >> #include <boost/config/cpp/XXX.hpp>
> >
> > I noticed in your PR that you also provide a header to get all such
> headers at once. I wonder whether the individual headers are really
> that useful. You could keep the implementation you have, but just
> document the one header.
>
> The one header is documented. I have the individual headers to avoid
> flooding the macro namespaces with lots of macros you are not going to
> use.

I know you documented the everything header. I was suggesting that you not document or mention the others.

I don't think the flooding issue you mention is significant. The macro names are reasonably unique and I don't think there are so many that you need worry about defining them all.

> >> 2) Include that library's main header file using the macro provided
> >> for that library:
> >>
> >> #include BOOST_CPP_XXX_HDR
> >
> > Why do you have "CPP" in that name? BOOST_XXX_HDR would seem
> sufficient. I also would suggest using HEADER rather than HDR.
>
> I like to avoid macro name clashes, Having a common prefix, such as
> CPP, tends to do that.

I understand the concern, but I don't think BOOST_ATOMIC_HEADER, BOOST_ATOMIC_NAMESPACE, BOOST_ATOMIC_IS_STD, etc. would be likely to clash.

> I could even change BOOST_CPP_XXX_NS to BOOST_CPP_XXX_NAMESPACE and have everybody type
> out the fully explicit names.

HEADER won't appear very often, so I thought spelling it out would be fine. The namespace macro might be used more often, so I didn't suggest expanding it. OTOH, the longer name can be mitigated by a namespace alias.

___
Rob

(Sent from my portable computation engine)


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