diff --git a/test/test_move_function.cpp b/test/test_move_function.cpp index d28b6524..a9820423 100644 --- a/test/test_move_function.cpp +++ b/test/test_move_function.cpp @@ -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 #include @@ -89,10 +89,18 @@ namespace user_test_ns } bool move_called=false; - + struct nc: public boost::shared_ptr { +#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); }