movemove_sourcemove
The function template move allows the user to transfer owenership explicitly from one instance of unique_ptr or unique_obj to another in cases where implicit transfer of ownership is disallowed.
<boost/interfaces/move.hpp>It should never be necessary to include this header directly, since it is included by <boost/interfaces/unique_ptr.hpp> and <boost/interfaces/unique_obj.hpp>.
namespace boost { namespace interfaces { template<typename Ptr> class move_source { public: move_source(Ptr& ptr); Ptr& ptr() const; }; template<typename Ptr> move_ptrs::move_source<Ptr> move(Ptr& x); } } // End namespace boost::interfaces
move_sourceThe class template move_source serves as the return type of move and as a constuctor argument to unique_ptr and unique_obj. It is simply a reference wrapper — boost::reference_wrapper could have been used instead.
| Ptr | - |
A type having a 'move constuctor' — i.e., a constructor taking a const reference to move_source<Ptr>.
|
move_source::move_sourcemove_source(Ptr& ptr);
Constructs an instance of move_source which wraps the given instance of the template parameter Ptr.
move_source::ptr Ptr& ptr() const;
Returns a reference to the instance of the template parameter Ptr wrapped by this instance of move_source.
moveUsed to transfer ownership explcitly from one instance of unique_ptr or unique_obj to another.
| Ptr | - |
A type having a 'move constuctor' — i.e., a constructor taking a const reference to move_source<Ptr>.
|
template<typename Ptr> interfaces::move_source<Ptr> move(Ptr& x);
Returns an instance of move_source which wraps the given instance of the template parameter Ptr.
Revised 13 Jan, 2005
© Copyright Jonathan Turkanis, 2005
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)
Sha'arei Tefila, an Orthodox Shul (Synagogue) in Salt Lake City, Utah Chabad Lubavitch of Utah