patch by Jesse Towner, and bug fix by Sebastian Redl

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@110724 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Howard Hinnant
2010-08-10 20:48:29 +00:00
parent 45783d2dfd
commit 60a0a8ef24
10 changed files with 168 additions and 38 deletions

View File

@@ -1093,10 +1093,10 @@ private:
#else
static _Tp __t();
static _Up __u();
static bool __f();
#endif
static bool __f();
public:
typedef __typeof__(__f() ? __t() : __u()) type;
typedef decltype(__f() ? __t() : __u()) type;
};
#else
@@ -1135,7 +1135,10 @@ struct common_type<_Tp, _Up, _Vp...>
template <class _Tp>
inline _LIBCPP_INLINE_VISIBILITY
typename remove_reference<_Tp>::type&&
move(_Tp&& __t) {return __t;}
move(_Tp&& __t)
{
return static_cast<typename remove_reference<_Tp>::type&&>(__t);
}
template <class _Tp, class _Up,
class = typename _STD::enable_if<
@@ -1148,8 +1151,7 @@ inline _LIBCPP_INLINE_VISIBILITY
_Tp&&
forward(_Up&& __t)
{
return __t; // to quiet spurious warning
// return static_cast<_Tp&&>(__t);
return static_cast<_Tp&&>(__t);
}
#else // _LIBCPP_MOVE