This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Predefined macros for rvalue reference support?


David Fang wrote:
Can someone please tell me how a library can detect whether the
compiler supports rvalue references? I'm trying to enable move
support for boost::shared_ptr. Thanks.

Hi, Do you mean at configure-time?

No, I need a compile time check. The Boost config system is not configure-based; it relies on the predefined preprocessor macros.

You mean something like a template metaprogramming test or trait? one that doesn't use the rvalue-reference syntax but can still distinguish between having and not having it?

No, I'm looking for a combination of predefined preprocessor macros that indicates that the compiler is in a mode where it recognizes &&. Something like


#ifdef __RVALUE_REFERENCE

or

#ifdef __GXX_EXPERIMENTAL_CXX0X__

or possibly

#if defined( __GXX_EXPERIMENTAL_CXX0X__ ) && !defined( __STRICT_ANSI__ )


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]