forked from OSchip/llvm-project
[libc++] Enable the rvalue overloads of operator<< and operator>> even in C++03.
Continuing to eliminate no-longer-needed uses of _LIBCPP_CXX03_LANG. Differential Revision: https://reviews.llvm.org/D104725
This commit is contained in:
parent
ad4bb82809
commit
585496803c
|
@ -1376,8 +1376,6 @@ ws(basic_istream<_CharT, _Traits>& __is)
|
||||||
return __is;
|
return __is;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef _LIBCPP_CXX03_LANG
|
|
||||||
|
|
||||||
template <class _Stream, class _Tp, class = void>
|
template <class _Stream, class _Tp, class = void>
|
||||||
struct __is_istreamable : false_type { };
|
struct __is_istreamable : false_type { };
|
||||||
|
|
||||||
|
@ -1388,7 +1386,7 @@ struct __is_istreamable<_Stream, _Tp, decltype(
|
||||||
|
|
||||||
template <class _Stream, class _Tp, class = typename enable_if<
|
template <class _Stream, class _Tp, class = typename enable_if<
|
||||||
_And<is_base_of<ios_base, _Stream>,
|
_And<is_base_of<ios_base, _Stream>,
|
||||||
__is_istreamable<_Stream&, _Tp&&>>::value
|
__is_istreamable<_Stream&, _Tp&&> >::value
|
||||||
>::type>
|
>::type>
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
_Stream&& operator>>(_Stream&& __is, _Tp&& __x)
|
_Stream&& operator>>(_Stream&& __is, _Tp&& __x)
|
||||||
|
@ -1397,8 +1395,6 @@ _Stream&& operator>>(_Stream&& __is, _Tp&& __x)
|
||||||
return _VSTD::move(__is);
|
return _VSTD::move(__is);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // _LIBCPP_CXX03_LANG
|
|
||||||
|
|
||||||
template <class _CharT, class _Traits>
|
template <class _CharT, class _Traits>
|
||||||
class _LIBCPP_TEMPLATE_VIS basic_iostream
|
class _LIBCPP_TEMPLATE_VIS basic_iostream
|
||||||
: public basic_istream<_CharT, _Traits>,
|
: public basic_istream<_CharT, _Traits>,
|
||||||
|
|
|
@ -1024,8 +1024,6 @@ flush(basic_ostream<_CharT, _Traits>& __os)
|
||||||
return __os;
|
return __os;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef _LIBCPP_CXX03_LANG
|
|
||||||
|
|
||||||
template <class _Stream, class _Tp, class = void>
|
template <class _Stream, class _Tp, class = void>
|
||||||
struct __is_ostreamable : false_type { };
|
struct __is_ostreamable : false_type { };
|
||||||
|
|
||||||
|
@ -1036,7 +1034,7 @@ struct __is_ostreamable<_Stream, _Tp, decltype(
|
||||||
|
|
||||||
template <class _Stream, class _Tp, class = typename enable_if<
|
template <class _Stream, class _Tp, class = typename enable_if<
|
||||||
_And<is_base_of<ios_base, _Stream>,
|
_And<is_base_of<ios_base, _Stream>,
|
||||||
__is_ostreamable<_Stream&, const _Tp&>>::value
|
__is_ostreamable<_Stream&, const _Tp&> >::value
|
||||||
>::type>
|
>::type>
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
_Stream&& operator<<(_Stream&& __os, const _Tp& __x)
|
_Stream&& operator<<(_Stream&& __os, const _Tp& __x)
|
||||||
|
@ -1045,8 +1043,6 @@ _Stream&& operator<<(_Stream&& __os, const _Tp& __x)
|
||||||
return _VSTD::move(__os);
|
return _VSTD::move(__os);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // _LIBCPP_CXX03_LANG
|
|
||||||
|
|
||||||
template<class _CharT, class _Traits, class _Allocator>
|
template<class _CharT, class _Traits, class _Allocator>
|
||||||
basic_ostream<_CharT, _Traits>&
|
basic_ostream<_CharT, _Traits>&
|
||||||
operator<<(basic_ostream<_CharT, _Traits>& __os,
|
operator<<(basic_ostream<_CharT, _Traits>& __os,
|
||||||
|
|
|
@ -6,8 +6,6 @@
|
||||||
//
|
//
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
|
|
||||||
// UNSUPPORTED: c++03
|
|
||||||
|
|
||||||
// Make sure the rvalue overload of operator>> isn't part of the overload set
|
// Make sure the rvalue overload of operator>> isn't part of the overload set
|
||||||
// when the type is not input streamable from a lvalue stream.
|
// when the type is not input streamable from a lvalue stream.
|
||||||
|
|
||||||
|
|
|
@ -6,8 +6,6 @@
|
||||||
//
|
//
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
|
|
||||||
// UNSUPPORTED: c++03
|
|
||||||
|
|
||||||
// <istream>
|
// <istream>
|
||||||
|
|
||||||
// template <class Stream, class T>
|
// template <class Stream, class T>
|
||||||
|
@ -77,7 +75,7 @@ int main(int, char**)
|
||||||
// test perfect forwarding
|
// test perfect forwarding
|
||||||
assert(called == false);
|
assert(called == false);
|
||||||
std::istringstream ss;
|
std::istringstream ss;
|
||||||
std::istringstream&& result = (std::move(ss) >> A{});
|
std::istringstream&& result = (std::move(ss) >> A());
|
||||||
assert(&result == &ss);
|
assert(&result == &ss);
|
||||||
assert(called);
|
assert(called);
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,8 +6,6 @@
|
||||||
//
|
//
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
|
|
||||||
// UNSUPPORTED: c++03
|
|
||||||
|
|
||||||
// Make sure the rvalue overload of operator<< isn't part of the overload set
|
// Make sure the rvalue overload of operator<< isn't part of the overload set
|
||||||
// when the type is not output streamable into a lvalue stream.
|
// when the type is not output streamable into a lvalue stream.
|
||||||
|
|
||||||
|
|
|
@ -6,8 +6,6 @@
|
||||||
//
|
//
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
|
|
||||||
// UNSUPPORTED: c++03
|
|
||||||
|
|
||||||
// <ostream>
|
// <ostream>
|
||||||
|
|
||||||
// template <class Stream, class T>
|
// template <class Stream, class T>
|
||||||
|
|
Loading…
Reference in New Issue