|
Boost : |
Subject: Re: [boost] [smart_ptr] error with nullptr_t
From: Peter Dimov (lists_at_[hidden])
Date: 2013-01-02 14:00:48
Dean Michael Berris wrote:
> Would there be a way to determine whether the user is using libstdc++
> on the Mac from Boost.Config?
>
> I distinctly remember that most standard Mac OS X installations come
> with a frozen version of libstdc++ (GCC's 4.2) which has patches from
> Apple. Apple's Clang I supports C++11 but only really works if you
> link with libc++ (or maybe if you get an updated libstdc++ with
> patches to work on OS X with clang). Being able to check the version
> of libstdc++ being used should give you a better way of making this
> determination.
This is what libstdcpp3.hpp has to say on the matter:
// stdlibc++ C++0x support is detected via __GNUC__, __GNUC_MINOR__, and
possibly
// __GNUC_PATCHLEVEL__ at the suggestion of Jonathan Wakely, one of the
stdlibc++
// developers. He also commented:
//
// "I'm not sure how useful __GLIBCXX__ is for your purposes, for
instance in
// GCC 4.2.4 it is set to 20080519 but in GCC 4.3.0 it is set to
20080305.
// Although 4.3.0 was released earlier than 4.2.4, it has better C++0x
support
// than any release in the 4.2 series."
//
// Another resource for understanding stdlibc++ features is:
//
http://gcc.gnu.org/onlinedocs/libstdc++/manual/status.html#manual.intro.status.standard.200x
It uses the compiler version to determine library features. Now... according
to gcc.hpp, nullptr (and by assumption std::nullptr_t) first appeared in g++
4.6, so if we set BOOST_NO_CXX11_NULLPTR_T for pre-4.6 in libstdcpp3.hpp and
if Apple's clang defines its GCC version as 4.2, as I suspect it would, then
it might work. But I have no way to check.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk