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


_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to