[cfe-commits] [libcxx] r150488 - /libcxx/trunk/include/type_traits
Howard Hinnant
hhinnant at apple.com
Tue Feb 14 08:03:09 PST 2012
Author: hhinnant
Date: Tue Feb 14 10:03:09 2012
New Revision: 150488
URL: http://llvm.org/viewvc/llvm-project?rev=150488&view=rev
Log:
Provide a move(const T&) overload for C++03 mode to enable moving from rvalues. This is to support proxy references. Fixes r10858112.
Modified:
libcxx/trunk/include/type_traits
Modified: libcxx/trunk/include/type_traits
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/type_traits?rev=150488&r1=150487&r2=150488&view=diff
==============================================================================
--- libcxx/trunk/include/type_traits (original)
+++ libcxx/trunk/include/type_traits Tue Feb 14 10:03:09 2012
@@ -1322,6 +1322,18 @@
inline _LIBCPP_INLINE_VISIBILITY
typename enable_if
<
+ !is_convertible<_Tp, __rv<_Tp> >::value,
+ const _Tp&
+>::type
+move(const _Tp& __t)
+{
+ return __t;
+}
+
+template <class _Tp>
+inline _LIBCPP_INLINE_VISIBILITY
+typename enable_if
+<
is_convertible<_Tp, __rv<_Tp> >::value,
_Tp
>::type
More information about the cfe-commits
mailing list