Greatly scale back ambitions of emulating move semantics in C++03 mode. It was causing more problems than it solved. This fixes http://llvm.org/bugs/show_bug.cgi?id=12704.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@155918 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -1297,6 +1297,31 @@ forward(typename std::remove_reference<_Tp>::type&& __t) _NOEXCEPT
|
||||
|
||||
#else // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
|
||||
template <class _Tp>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
_Tp&
|
||||
move(_Tp& __t)
|
||||
{
|
||||
return __t;
|
||||
}
|
||||
|
||||
template <class _Tp>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
const _Tp&
|
||||
move(const _Tp& __t)
|
||||
{
|
||||
return __t;
|
||||
}
|
||||
|
||||
template <class _Tp>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
_Tp&
|
||||
forward(typename std::remove_reference<_Tp>::type& __t) _NOEXCEPT
|
||||
{
|
||||
return __t;
|
||||
}
|
||||
|
||||
|
||||
template <class _Tp>
|
||||
class __rv
|
||||
{
|
||||
@@ -1309,90 +1334,6 @@ public:
|
||||
explicit __rv(_Trr& __t) : t_(__t) {}
|
||||
};
|
||||
|
||||
template <class _Tp>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
typename enable_if
|
||||
<
|
||||
!is_convertible<_Tp, __rv<_Tp> >::value,
|
||||
_Tp&
|
||||
>::type
|
||||
move(_Tp& __t)
|
||||
{
|
||||
return __t;
|
||||
}
|
||||
|
||||
template <class _Tp>
|
||||
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
|
||||
move(_Tp& __t)
|
||||
{
|
||||
return _Tp(__rv<_Tp>(__t));
|
||||
}
|
||||
|
||||
template <class _Tp, class _Up>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
typename enable_if
|
||||
<
|
||||
!is_convertible<_Tp, __rv<_Tp> >::value,
|
||||
typename add_lvalue_reference<_Tp>::type
|
||||
>::type
|
||||
forward(_Up& __t)
|
||||
{
|
||||
return __t;
|
||||
}
|
||||
|
||||
template <class _Tp, class _Up>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
typename enable_if
|
||||
<
|
||||
!is_convertible<_Tp, __rv<_Tp> >::value,
|
||||
typename add_lvalue_reference<_Tp>::type
|
||||
>::type
|
||||
forward(const _Up& __t)
|
||||
{
|
||||
return __t;
|
||||
}
|
||||
|
||||
template <class _Tp, class _Up>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
typename enable_if
|
||||
<
|
||||
is_convertible<_Tp, __rv<_Tp> >::value,
|
||||
_Tp
|
||||
>::type
|
||||
forward(_Up& __t)
|
||||
{
|
||||
return _Tp(__rv<_Tp>(__t));
|
||||
}
|
||||
|
||||
template <class _Tp, class _Up>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
typename enable_if
|
||||
<
|
||||
is_convertible<_Tp, __rv<_Tp> >::value,
|
||||
_Tp
|
||||
>::type
|
||||
forward(const _Up& __t)
|
||||
{
|
||||
return _Tp(__rv<_Tp>(__t));
|
||||
}
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
|
||||
template <class _Tp>
|
||||
|
Reference in New Issue
Block a user