From 21f75da2f60eae905377c75b3be8ddea78ec8e29 Mon Sep 17 00:00:00 2001 From: "Vicente J. Botet Escriba" Date: Mon, 19 Dec 2011 23:22:08 +0000 Subject: [PATCH] Thread: don't overload move when BOOST_NO_RVALUE_REFERENCES is not defined [SVN r76074] --- test/test_move_function.cpp | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) 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); }