On 1 April 2013 15:58, Vicente J. Botet Escriba wrote:
Le 01/04/13 16:35, Jonathan Wakely a écrit :
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?
Maybe my installation is not correct, but with it __GXX_EXPERIMENTAL_CXX0X__ is not defined. Could some check it?
I see it still defined with GCC 4.8 or 4.9
BTW, there are some pages pointing to this problem on the net.
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.
Maybe there is a bug on gcc-4.8 ;-)
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.
I'm not using it directly, but via boost/config.hpp
A related topic I've been meaning to raise is that
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
I don't know if some documentation needs to be updated, but if you have check it, could you to commit it?
I haven't checked it, and I don't have commit rights. I'll run the tests and report back ...