File tree 6 files changed +31
-5
lines changed
6 files changed +31
-5
lines changed Original file line number Diff line number Diff line change 97
97
# endif // defined(__GXX_EXPERIMENTAL_CXX0X__)
98
98
# endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 5)) || (__GNUC__ > 4)
99
99
# endif // defined(__GNUC__)
100
+ # if defined(ASIO_MSVC)
101
+ # if (_MSC_VER >= 1700)
102
+ # define ASIO_HAS_MOVE 1
103
+ # endif // (_MSC_VER >= 1700)
104
+ # endif // defined(ASIO_MSVC)
100
105
# endif // !defined(ASIO_DISABLE_MOVE)
101
106
#endif // !defined(ASIO_HAS_MOVE)
102
107
Original file line number Diff line number Diff line change @@ -165,6 +165,24 @@ class win_iocp_socket_service : public win_iocp_socket_service_base
165
165
other_impl.remote_endpoint_ = endpoint_type ();
166
166
}
167
167
168
+ // Move-construct a new socket implementation from another protocol type.
169
+ template <typename Protocol1>
170
+ void converting_move_construct (implementation_type& impl,
171
+ typename win_iocp_socket_service<
172
+ Protocol1>::implementation_type& other_impl)
173
+ {
174
+ this ->base_move_construct (impl, other_impl);
175
+
176
+ impl.protocol_ = protocol_type (other_impl.protocol_ );
177
+ other_impl.protocol_ = typename Protocol1::endpoint ().protocol ();
178
+
179
+ impl.have_remote_endpoint_ = other_impl.have_remote_endpoint_ ;
180
+ other_impl.have_remote_endpoint_ = false ;
181
+
182
+ impl.remote_endpoint_ = other_impl.remote_endpoint_ ;
183
+ other_impl.remote_endpoint_ = typename Protocol1::endpoint ();
184
+ }
185
+
168
186
// Open a new socket implementation.
169
187
asio::error_code open (implementation_type& impl,
170
188
const protocol_type& protocol, asio::error_code& ec)
Original file line number Diff line number Diff line change @@ -79,7 +79,8 @@ void test()
79
79
80
80
#if defined(ASIO_HAS_MOVE)
81
81
dp::socket socket5 (std::move (socket4));
82
- dp::socket socket6 (asio::ip::udp::socket (ios));
82
+ asio::ip::udp::socket udp_socket (ios);
83
+ dp::socket socket6 (std::move (udp_socket));
83
84
#endif // defined(ASIO_HAS_MOVE)
84
85
85
86
// basic_datagram_socket operators.
Original file line number Diff line number Diff line change @@ -79,7 +79,8 @@ void test()
79
79
80
80
#if defined(ASIO_HAS_MOVE)
81
81
rp::socket socket5 (std::move (socket4));
82
- rp::socket socket6 (asio::ip::icmp::socket (ios));
82
+ asio::ip::icmp::socket icmp_socket (ios);
83
+ rp::socket socket6 (std::move (icmp_socket));
83
84
#endif // defined(ASIO_HAS_MOVE)
84
85
85
86
// basic_datagram_socket operators.
Original file line number Diff line number Diff line change @@ -89,7 +89,8 @@ void test()
89
89
90
90
#if defined(ASIO_HAS_MOVE)
91
91
sp::socket socket5 (std::move (socket4));
92
- sp::socket socket6 (asio::ip::tcp::socket (ios));
92
+ asio::ip::tcp::socket tcp_socket (ios);
93
+ sp::socket socket6 (std::move (tcp_socket));
93
94
#endif // defined(ASIO_HAS_MOVE)
94
95
95
96
// basic_stream_socket operators.
Original file line number Diff line number Diff line change @@ -203,7 +203,7 @@ void test()
203
203
#endif // !defined(ASIO_WINDOWS_RUNTIME)
204
204
205
205
#if defined(ASIO_HAS_MOVE)
206
- ip::tcp::socket socket7 (std::move (socket6 ));
206
+ ip::tcp::socket socket7 (std::move (socket5 ));
207
207
#endif // defined(ASIO_HAS_MOVE)
208
208
209
209
// basic_stream_socket operators.
@@ -662,7 +662,7 @@ void test()
662
662
#endif // !defined(ASIO_WINDOWS_RUNTIME)
663
663
664
664
#if defined(ASIO_HAS_MOVE)
665
- ip::tcp::acceptor acceptor7 (std::move (acceptor6 ));
665
+ ip::tcp::acceptor acceptor7 (std::move (acceptor5 ));
666
666
#endif // defined(ASIO_HAS_MOVE)
667
667
668
668
// basic_socket_acceptor operators.
You can’t perform that action at this time.
0 commit comments