Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r85766 - in trunk: boost/asio/detail libs/asio/test/generic libs/asio/test/ip
From: chris_at_[hidden]
Date: 2013-09-17 18:38:04


Author: chris_kohlhoff
Date: 2013-09-17 18:38:04 EDT (Tue, 17 Sep 2013)
New Revision: 85766
URL: http://svn.boost.org/trac/boost/changeset/85766

Log:
Enable move support for Microsoft Visual C++ 2012.

Text files modified:
   trunk/boost/asio/detail/config.hpp | 5 +++++
   trunk/boost/asio/detail/win_iocp_socket_service.hpp | 18 ++++++++++++++++++
   trunk/libs/asio/test/generic/datagram_protocol.cpp | 3 ++-
   trunk/libs/asio/test/generic/raw_protocol.cpp | 3 ++-
   trunk/libs/asio/test/generic/stream_protocol.cpp | 3 ++-
   trunk/libs/asio/test/ip/tcp.cpp | 4 ++--
   6 files changed, 31 insertions(+), 5 deletions(-)

Modified: trunk/boost/asio/detail/config.hpp
==============================================================================
--- trunk/boost/asio/detail/config.hpp Tue Sep 17 18:32:13 2013 (r85765)
+++ trunk/boost/asio/detail/config.hpp 2013-09-17 18:38:04 EDT (Tue, 17 Sep 2013) (r85766)
@@ -97,6 +97,11 @@
 # endif // defined(__GXX_EXPERIMENTAL_CXX0X__)
 # endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 5)) || (__GNUC__ > 4)
 # endif // defined(__GNUC__)
+# if defined(BOOST_ASIO_MSVC)
+# if (_MSC_VER >= 1700)
+# define BOOST_ASIO_HAS_MOVE 1
+# endif // (_MSC_VER >= 1700)
+# endif // defined(BOOST_ASIO_MSVC)
 # endif // !defined(BOOST_ASIO_DISABLE_MOVE)
 #endif // !defined(BOOST_ASIO_HAS_MOVE)
 

Modified: trunk/boost/asio/detail/win_iocp_socket_service.hpp
==============================================================================
--- trunk/boost/asio/detail/win_iocp_socket_service.hpp Tue Sep 17 18:32:13 2013 (r85765)
+++ trunk/boost/asio/detail/win_iocp_socket_service.hpp 2013-09-17 18:38:04 EDT (Tue, 17 Sep 2013) (r85766)
@@ -166,6 +166,24 @@
     other_impl.remote_endpoint_ = endpoint_type();
   }
 
+ // Move-construct a new socket implementation from another protocol type.
+ template <typename Protocol1>
+ void converting_move_construct(implementation_type& impl,
+ typename win_iocp_socket_service<
+ Protocol1>::implementation_type& other_impl)
+ {
+ this->base_move_construct(impl, other_impl);
+
+ impl.protocol_ = protocol_type(other_impl.protocol_);
+ other_impl.protocol_ = typename Protocol1::endpoint().protocol();
+
+ impl.have_remote_endpoint_ = other_impl.have_remote_endpoint_;
+ other_impl.have_remote_endpoint_ = false;
+
+ impl.remote_endpoint_ = other_impl.remote_endpoint_;
+ other_impl.remote_endpoint_ = typename Protocol1::endpoint();
+ }
+
   // Open a new socket implementation.
   boost::system::error_code open(implementation_type& impl,
       const protocol_type& protocol, boost::system::error_code& ec)

Modified: trunk/libs/asio/test/generic/datagram_protocol.cpp
==============================================================================
--- trunk/libs/asio/test/generic/datagram_protocol.cpp Tue Sep 17 18:32:13 2013 (r85765)
+++ trunk/libs/asio/test/generic/datagram_protocol.cpp 2013-09-17 18:38:04 EDT (Tue, 17 Sep 2013) (r85766)
@@ -79,7 +79,8 @@
 
 #if defined(BOOST_ASIO_HAS_MOVE)
     dp::socket socket5(std::move(socket4));
- dp::socket socket6(boost::asio::ip::udp::socket(ios));
+ boost::asio::ip::udp::socket udp_socket(ios);
+ dp::socket socket6(std::move(udp_socket));
 #endif // defined(BOOST_ASIO_HAS_MOVE)
 
     // basic_datagram_socket operators.

Modified: trunk/libs/asio/test/generic/raw_protocol.cpp
==============================================================================
--- trunk/libs/asio/test/generic/raw_protocol.cpp Tue Sep 17 18:32:13 2013 (r85765)
+++ trunk/libs/asio/test/generic/raw_protocol.cpp 2013-09-17 18:38:04 EDT (Tue, 17 Sep 2013) (r85766)
@@ -79,7 +79,8 @@
 
 #if defined(BOOST_ASIO_HAS_MOVE)
     rp::socket socket5(std::move(socket4));
- rp::socket socket6(boost::asio::ip::icmp::socket(ios));
+ boost::asio::ip::icmp::socket icmp_socket(ios);
+ rp::socket socket6(std::move(icmp_socket));
 #endif // defined(BOOST_ASIO_HAS_MOVE)
 
     // basic_datagram_socket operators.

Modified: trunk/libs/asio/test/generic/stream_protocol.cpp
==============================================================================
--- trunk/libs/asio/test/generic/stream_protocol.cpp Tue Sep 17 18:32:13 2013 (r85765)
+++ trunk/libs/asio/test/generic/stream_protocol.cpp 2013-09-17 18:38:04 EDT (Tue, 17 Sep 2013) (r85766)
@@ -89,7 +89,8 @@
 
 #if defined(BOOST_ASIO_HAS_MOVE)
     sp::socket socket5(std::move(socket4));
- sp::socket socket6(boost::asio::ip::tcp::socket(ios));
+ boost::asio::ip::tcp::socket tcp_socket(ios);
+ sp::socket socket6(std::move(tcp_socket));
 #endif // defined(BOOST_ASIO_HAS_MOVE)
 
     // basic_stream_socket operators.

Modified: trunk/libs/asio/test/ip/tcp.cpp
==============================================================================
--- trunk/libs/asio/test/ip/tcp.cpp Tue Sep 17 18:32:13 2013 (r85765)
+++ trunk/libs/asio/test/ip/tcp.cpp 2013-09-17 18:38:04 EDT (Tue, 17 Sep 2013) (r85766)
@@ -203,7 +203,7 @@
 #endif // !defined(BOOST_ASIO_WINDOWS_RUNTIME)
 
 #if defined(BOOST_ASIO_HAS_MOVE)
- ip::tcp::socket socket7(std::move(socket6));
+ ip::tcp::socket socket7(std::move(socket5));
 #endif // defined(BOOST_ASIO_HAS_MOVE)
 
     // basic_stream_socket operators.
@@ -662,7 +662,7 @@
 #endif // !defined(BOOST_ASIO_WINDOWS_RUNTIME)
 
 #if defined(BOOST_ASIO_HAS_MOVE)
- ip::tcp::acceptor acceptor7(std::move(acceptor6));
+ ip::tcp::acceptor acceptor7(std::move(acceptor5));
 #endif // defined(BOOST_ASIO_HAS_MOVE)
 
     // basic_socket_acceptor operators.


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk