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?


> 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?  If it suffices to check for syntax
support, the following minimalist autoconf test might suffice:

dnl wrap in AC_LANG_PUSH/POP(C++)
AC_COMPILE_IFELSE(
	AC_LANG_PROGRAM([typedef int&& RRI;],[]),
	[set_rvalue_ref_flag=yes],
	[set_rvalue_ref_flag=no]
)

Fang


David Fang
Computer Systems Laboratory
Electrical & Computer Engineering
Cornell University
http://www.csl.cornell.edu/~fang/
	-- (2400 baud? Netscape 3.0?? lynx??? No problem!)


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