This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: Predefined macros for rvalue reference support?
- From: David Fang <fang at csl dot cornell dot edu>
- To: Peter Dimov <pdimov at mmltd dot net>
- Cc: <libstdc++ at gcc dot gnu dot org>
- Date: Sat, 28 Apr 2007 12:59:09 -0400 (EDT)
- Subject: 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!)