mirror of
https://github.com/boostorg/move.git
synced 2025-08-02 13:44:28 +02:00
Fix has_nothrow_move and avoid boost::has_nothrow_move<copyable>::value test as each compiler can deduce a different thing depending on its type analysis.
[SVN r85410]
This commit is contained in:
@@ -41,14 +41,14 @@ struct has_trivial_destructor_after_move
|
|||||||
{};
|
{};
|
||||||
|
|
||||||
//! By default this traits returns
|
//! By default this traits returns
|
||||||
//! <pre>boost::is_nothrow_move_constructible<T>::value || boost::is_nothrow_move_assignable<T>::value </pre>.
|
//! <pre>boost::is_nothrow_move_constructible<T>::value && boost::is_nothrow_move_assignable<T>::value </pre>.
|
||||||
//! Classes with non-throwing move constructor
|
//! Classes with non-throwing move constructor
|
||||||
//! and assignment can specialize this trait to obtain some performance improvements.
|
//! and assignment can specialize this trait to obtain some performance improvements.
|
||||||
template <class T>
|
template <class T>
|
||||||
struct has_nothrow_move
|
struct has_nothrow_move
|
||||||
: public ::boost::move_detail::integral_constant
|
: public ::boost::move_detail::integral_constant
|
||||||
< bool
|
< bool
|
||||||
, boost::is_nothrow_move_constructible<T>::value ||
|
, boost::is_nothrow_move_constructible<T>::value &&
|
||||||
boost::is_nothrow_move_assignable<T>::value
|
boost::is_nothrow_move_assignable<T>::value
|
||||||
>
|
>
|
||||||
{};
|
{};
|
||||||
|
@@ -66,7 +66,6 @@ int main()
|
|||||||
{
|
{
|
||||||
#if defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
|
#if defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
|
||||||
BOOST_STATIC_ASSERT((boost::has_nothrow_move<movable>::value == true));
|
BOOST_STATIC_ASSERT((boost::has_nothrow_move<movable>::value == true));
|
||||||
BOOST_STATIC_ASSERT((boost::has_nothrow_move<copyable>::value == false));
|
|
||||||
BOOST_STATIC_ASSERT((boost::has_move_emulation_enabled<copyable>::value == false));
|
BOOST_STATIC_ASSERT((boost::has_move_emulation_enabled<copyable>::value == false));
|
||||||
BOOST_STATIC_ASSERT((boost::has_move_emulation_enabled<copyable*>::value == false));
|
BOOST_STATIC_ASSERT((boost::has_move_emulation_enabled<copyable*>::value == false));
|
||||||
BOOST_STATIC_ASSERT((boost::has_move_emulation_enabled<int>::value == false));
|
BOOST_STATIC_ASSERT((boost::has_move_emulation_enabled<int>::value == false));
|
||||||
|
Reference in New Issue
Block a user