|
Boost : |
Subject: Re: [boost] [config] gcc-4.8 and __GXX_EXPERIMENTAL_CXX0X__
From: Jonathan Wakely (jwakely.boost_at_[hidden])
Date: 2013-04-01 10:35:56
On 1 April 2013 15:17, Vicente J. Botet Escriba wrote:
> Hi,
>
> it seems that gcc-4.8 doesn't defines any more __GXX_EXPERIMENTAL_CXX0X__
> when the flag -std=c++11 is given.
Are you sure?
The standard library no longer checks it, using __cplusplus >= 201103L
instead, but the compiler still defines the old macro. The old macro
is still documented as being defined.
> This means that all the BOOST_NO_CXX11_ are defined.
>
> Could something be done to make usable gcc-4.8 in c++11 mode?
You could check the value of __cplusplus instead, because
__GXX_EXPERIMENTAL_CXX0X__ will stop being defined at some point
eventually.
A related topic I've been meaning to raise is that
<boost/config/stdlib/libstdcpp3.hpp> unconditionally defines:
// C++0x headers not yet (fully!) implemented
//
# define BOOST_NO_CXX11_HDR_THREAD
This is incorrect. Depending on how GCC was configured libstdc++ has
provided a complete <thread> since at least version 4.4, and for GCC
4.8 it unconditionally provides a complete <thread>.
This should be correct:
#if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 4)
# define BOOST_NO_CXX11_HDR_THREAD
#elif (__GNUC__ == 4 && __GNUC_MINOR__ < 8)
# if !(defined(_GLIBCXX_HAS_GTHREADS) &&
defined(_GLIBCXX_USE_C99_STDINT_TR1) &&
defined(_GLIBCXX_USE_SCHED_YIELD) && defined(_GLIBCXX_USE_NANOSLEEP)
&& defined(__GXX_EXPERIMENTAL_CXX0X__))
# define BOOST_NO_CXX11_HDR_THREAD
#elif __cplusplus < 201103L
# define BOOST_NO_CXX11_HDR_THREAD
#endif
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk