Boost logo

Boost :

Subject: Re: [boost] Another set of macros to deprecate (and then remove)?
From: Steve M. Robbins (steve_at_[hidden])
Date: 2012-12-16 23:08:40


On December 14, 2012 10:52:29 AM Marshall Clow wrote:
> On Dec 14, 2012, at 8:38 AM, Steve M. Robbins <steve_at_[hidden]> wrote:
> > On Thu, Dec 13, 2012 at 07:53:06AM -0800, Marshall Clow wrote:
> >> There are a set of macros in Boost.config that describe "features that
> >> are not required by the C++ standard"
> >>
> >> Some of these features have been incorporated into C++11.
> >>
> >> I propose that we retire these macros, and have people use the shiny
> >> C++11 versions.
> >>
> >> In particular:
> >> BOOST_HAS_STATIC_ASSERT should be ! BOOST_NO_CXX11_ASSERT
> >
> > I'm curious why Boost is changing from a positive macro "system has
> > feature X" to a negative one. Of the two options:
> >
> > #ifdef BOOST_HAS_X
> > ...
> >
> > or
> >
> > #ifndef BOOST_NO_X
> > ...
> >
> >
> > I personally find the former much easier to read and the latter
> > double-negative version awkward enough to be error prone. Am I alone
> > in this opinion?
>
> Here's my understanding, based on reading the docs at:
> http://www.boost.org/doc/libs/1_52_0/libs/config/doc/html/boost_config/boo
> st_macro_reference.html
>
>
> For things that are in the standard, we note their absence.
> For example: BOOST_NO_STDC_NAMESPACE and BOOST_NO_CXX11_RVALUE_REFERENCES
>
> For optional (extra?) language/library features, we note their presence
> BOOST_HAS_TR1 or BOOST_HAS_SGI_TYPE_TRAITS

Thanks. This proves that the choice is deliberate.

However, it doesn't answer whether using the double-negative is a good idea.
Why not use BOOST_STDC_NAMESPACE and BOOST_CXX11_RVALUE_REFERENCES instead?

-Steve


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