Boost logo

Boost :

Subject: Re: [boost] [config] std::unique_ptr, std::ref detection?
From: Daniel James (dnljms_at_[hidden])
Date: 2012-03-03 07:51:27


On 1 March 2012 23:34, Jeffrey Lee Hellrung, Jr.
<jeffrey.hellrung_at_[hidden]> wrote:
>
> I think the important distinction is
>
> "BOOST_NO_INITIALIZER_LISTS is probably useless as
> it only indicates compiler support and initializer lists can't really
> be used without the header."
>
> I wasn't sure whether initializer lists required a header, so I agree with
> Daniel that it's probably redundant.

I was wrong, C++11 added other uses which don't require the header.
Although I don't think portable code would ever need to take advantage
of that.

The situation with the visual c++ 10 beta was that initializer lists
weren't supported, but the header was present. In that case
BOOST_NO_INITIALIZER_LISTS would be defined, but
BOOST_NO_0X_HDR_INITIALIZER_LISTS would not. A compiled library might
still want to define methods which take initializer lists so that they
can be used when linking with a different compiler that does support
them.

If you look at unordered, it now uses
BOOST_NO_0X_HDR_INITIALIZER_LISTS in the headers (they support
std::initializer_list but don't ever create one), but
BOOST_NO_INITIALIZER_LISTS for test cases that actually use an
initializer list.

But.... it looks like including the header in Visual C++ 10 was
actually a mistake:

http://connect.microsoft.com/VisualStudio/feedback/details/533464/the-initializer-list-header-in-the-vc10-release-candidate

It's also confusing having the two macros, very easy to get wrong, and
the potential use cases are pretty dubious.


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