source: NonGTP/Boost/boost/ptr_container/detail/move.hpp @ 857

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