forked from boostorg/type_traits
Move trivial/nothrow construct traits closer into line with the standard.
This commit is contained in:
1 parent
b069b3ce3c
commit
ae76223bab
4 files changed
+22
-17
No files matched your search
@@ -48,6 +48,14 @@ template <> struct has_trivial_move_constructor<void const> : public false_type{
|
||||
template <> struct has_trivial_move_constructor<void volatile> : public false_type{};
|
||||
template <> struct has_trivial_move_constructor<void const volatile> : public false_type{};
|
||||
#endif
|
||||
// What should we do with reference types??? The standard seems to suggest these are trivial, even if the thing they reference is not:
|
||||
template <class T> struct has_trivial_move_constructor<T&> : public true_type{};
|
||||
#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES
|
||||
template <class T> struct has_trivial_move_constructor<T&&> : public true_type{};
|
||||
#endif
|
||||
// Arrays can not be explicitly copied:
|
||||
template <class T, std::size_t N> struct has_trivial_move_constructor<T[N]> : public false_type{};
|
||||
template <class T> struct has_trivial_move_constructor<T[]> : public false_type{};
|
||||
|
||||
} // namespace boost
|
||||
|
||||
|
||||
@@ -24,10 +24,6 @@ struct is_nothrow_move_constructible : public integral_constant<bool, BOOST_IS_N
|
||||
|
||||
template <class T> struct is_nothrow_move_constructible<volatile T> : public ::boost::false_type {};
|
||||
template <class T> struct is_nothrow_move_constructible<const volatile T> : public ::boost::false_type{};
|
||||
template <class T> struct is_nothrow_move_constructible<T&> : public ::boost::false_type{};
|
||||
#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES
|
||||
template <class T> struct is_nothrow_move_constructible<T&&> : public ::boost::false_type{};
|
||||
#endif
|
||||
|
||||
#elif !defined(BOOST_NO_CXX11_NOEXCEPT) && !defined(BOOST_NO_SFINAE_EXPR)
|
||||
|
||||
@@ -53,10 +49,6 @@ template <class T> struct is_nothrow_move_constructible
|
||||
|
||||
template <class T> struct is_nothrow_move_constructible<volatile T> : public ::boost::false_type {};
|
||||
template <class T> struct is_nothrow_move_constructible<const volatile T> : public ::boost::false_type{};
|
||||
template <class T> struct is_nothrow_move_constructible<T&> : public ::boost::false_type{};
|
||||
#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES
|
||||
template <class T> struct is_nothrow_move_constructible<T&&> : public ::boost::false_type{};
|
||||
#endif
|
||||
|
||||
#else
|
||||
|
||||
@@ -80,6 +72,11 @@ template <> struct is_nothrow_move_constructible<void const> : false_type{};
|
||||
template <> struct is_nothrow_move_constructible<void volatile> : false_type{};
|
||||
template <> struct is_nothrow_move_constructible<void const volatile> : false_type{};
|
||||
#endif
|
||||
// References are always trivially constructible, even if the thing they reference is not:
|
||||
template <class T> struct is_nothrow_move_constructible<T&> : public ::boost::true_type{};
|
||||
#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES
|
||||
template <class T> struct is_nothrow_move_constructible<T&&> : public ::boost::true_type{};
|
||||
#endif
|
||||
|
||||
} // namespace boost
|
||||
|
||||
|
||||
Reference in new issue
Block a user