[cfe-commits] [libcxx] r124190 - /libcxx/trunk/include/tuple

Douglas Gregor dgregor at apple.com
Tue Jan 25 08:14:21 PST 2011


Author: dgregor
Date: Tue Jan 25 10:14:21 2011
New Revision: 124190

URL: http://llvm.org/viewvc/llvm-project?rev=124190&view=rev
Log:
An rvalue reference cannot bind to an lvalue, so static_cast the
result of the __tuple_leaf::get() call to an rvalue reference when
returning from tuple's get().

Modified:
    libcxx/trunk/include/tuple

Modified: libcxx/trunk/include/tuple
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/tuple?rev=124190&r1=124189&r2=124190&view=diff
==============================================================================
--- libcxx/trunk/include/tuple (original)
+++ libcxx/trunk/include/tuple Tue Jan 25 10:14:21 2011
@@ -589,7 +589,8 @@
 get(tuple<_Tp...>&& __t)
 {
     typedef typename tuple_element<_Ip, tuple<_Tp...> >::type type;
-    return static_cast<__tuple_leaf<_Ip, type>&&>(__t.base_).get();
+    return static_cast<typename tuple_element<_Ip, tuple<_Tp...> >::type&&>(
+             static_cast<__tuple_leaf<_Ip, type>&&>(__t.base_).get());
 }
 
 // tie





More information about the cfe-commits mailing list