summaryrefslogtreecommitdiff
path: root/boost/asio/basic_io_object.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'boost/asio/basic_io_object.hpp')
-rw-r--r--boost/asio/basic_io_object.hpp17
1 files changed, 16 insertions, 1 deletions
diff --git a/boost/asio/basic_io_object.hpp b/boost/asio/basic_io_object.hpp
index 5912228ec7..d490a161f6 100644
--- a/boost/asio/basic_io_object.hpp
+++ b/boost/asio/basic_io_object.hpp
@@ -2,7 +2,7 @@
// basic_io_object.hpp
// ~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2016 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2017 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -113,6 +113,11 @@ protected:
* @note Available only for services that support movability,
*/
basic_io_object& operator=(basic_io_object&& other);
+
+ /// Perform a converting move-construction of a basic_io_object.
+ template <typename IoObjectService1>
+ basic_io_object(IoObjectService1& other_service,
+ typename IoObjectService1::implementation_type& other_implementation);
#endif // defined(GENERATING_DOCUMENTATION)
/// Protected destructor to prevent deletion through this type.
@@ -192,6 +197,16 @@ protected:
service_->move_construct(implementation, other.implementation);
}
+ template <typename IoObjectService1>
+ basic_io_object(IoObjectService1& other_service,
+ typename IoObjectService1::implementation_type& other_implementation)
+ : service_(&boost::asio::use_service<IoObjectService>(
+ other_service.get_io_service()))
+ {
+ service_->converting_move_construct(implementation,
+ other_service, other_implementation);
+ }
+
~basic_io_object()
{
service_->destroy(implementation);