|
sl@0
|
1 |
// (C) Copyright Daniel Wallin 2004.
|
|
sl@0
|
2 |
// Distributed under the Boost Software License, Version 1.0. (See accompanying
|
|
sl@0
|
3 |
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt.)
|
|
sl@0
|
4 |
|
|
sl@0
|
5 |
// Contains the definitions of the class template move_source and the function
|
|
sl@0
|
6 |
// template move, which together make move pointers moveable.
|
|
sl@0
|
7 |
|
|
sl@0
|
8 |
#ifndef BOOST_MOVE_HPP_INCLUDED
|
|
sl@0
|
9 |
#define BOOST_MOVE_HPP_INCLUDED
|
|
sl@0
|
10 |
|
|
sl@0
|
11 |
namespace boost { namespace ptr_container_detail {
|
|
sl@0
|
12 |
|
|
sl@0
|
13 |
namespace move_ptrs {
|
|
sl@0
|
14 |
|
|
sl@0
|
15 |
template<typename Ptr>
|
|
sl@0
|
16 |
class move_source {
|
|
sl@0
|
17 |
public:
|
|
sl@0
|
18 |
move_source(Ptr& ptr) : ptr_(ptr) {}
|
|
sl@0
|
19 |
Ptr& ptr() const { return ptr_; }
|
|
sl@0
|
20 |
private:
|
|
sl@0
|
21 |
Ptr& ptr_;
|
|
sl@0
|
22 |
move_source(const Ptr&);
|
|
sl@0
|
23 |
};
|
|
sl@0
|
24 |
|
|
sl@0
|
25 |
} // End namespace move_ptrs.
|
|
sl@0
|
26 |
|
|
sl@0
|
27 |
|
|
sl@0
|
28 |
template<typename T>
|
|
sl@0
|
29 |
move_ptrs::move_source<T> move(T& x)
|
|
sl@0
|
30 |
{ return move_ptrs::move_source<T>(x); }
|
|
sl@0
|
31 |
|
|
sl@0
|
32 |
} // namespace 'ptr_container_detail'
|
|
sl@0
|
33 |
} // End namespace boost.
|
|
sl@0
|
34 |
|
|
sl@0
|
35 |
#endif // #ifndef BOOST_MOVE_HPP_INCLUDED
|