1 //////////////////////////////////////////////////////////////////////////////
3 // (C) Copyright Ion Gaztanaga 2009.
4 // Distributed under the Boost Software License, Version 1.0.
5 // (See accompanying file LICENSE_1_0.txt or copy at
6 // http://www.boost.org/LICENSE_1_0.txt)
8 // See http://www.boost.org/libs/move for documentation.
10 //////////////////////////////////////////////////////////////////////////////
11 #ifndef BOOST_MOVE_TEST_MOVABLE_HPP
12 #define BOOST_MOVE_TEST_MOVABLE_HPP
14 #include <boost/move/detail/config_begin.hpp>
17 //header file "movable.hpp"
18 #include <boost/move/core.hpp>
19 #include <boost/move/traits.hpp>
24 BOOST_MOVABLE_BUT_NOT_COPYABLE(movable)
28 movable() : value_(1){}
30 //Move constructor and assignment
31 movable(BOOST_RV_REF(movable) m)
32 { value_ = m.value_; m.value_ = 0; }
34 movable & operator=(BOOST_RV_REF(movable) m)
35 { value_ = m.value_; m.value_ = 0; return *this; }
37 bool moved() const //Observer
40 int value() const //Observer
47 struct has_nothrow_move<movable>
49 static const bool value = true;
55 #include <boost/move/detail/config_end.hpp>
57 #endif //BOOST_MOVE_TEST_MOVABLE_HPP