2
0
mirror of https://github.com/boostorg/thread.git synced 2026-02-02 09:22:10 +00:00

Thread: don't overload move when BOOST_NO_RVALUE_REFERENCES is not defined

[SVN r76074]
This commit is contained in:
Vicente J. Botet Escriba
2011-12-19 23:22:08 +00:00
parent 233dbf8075
commit 21f75da2f6

View File

@@ -1,6 +1,6 @@
// Copyright (C) 2007-8 Anthony Williams
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
#include <boost/thread/thread.hpp>
#include <boost/test/unit_test.hpp>
@@ -89,10 +89,18 @@ namespace user_test_ns
}
bool move_called=false;
struct nc:
public boost::shared_ptr<int>
{
#ifndef BOOST_NO_RVALUE_REFERENCES
nc() {}
nc(nc&&)
{
move_called=true;
return nc();
}
#endif
nc move()
{
move_called=true;
@@ -104,7 +112,11 @@ namespace user_test_ns
void test_move_for_user_defined_type_unaffected()
{
user_test_ns::nc src;
#ifndef BOOST_NO_RVALUE_REFERENCES
user_test_ns::nc dest=boost::move(src);
#else
user_test_ns::nc dest=move(src);
#endif
BOOST_CHECK(user_test_ns::move_called);
}