asio C++ library

PrevUpHomeNext
basic_socket::operator= (2 of 2 overloads)

Move-assign a basic_socket from a socket of another protocol type.

template<
    typename Protocol1>
enable_if< is_convertible< Protocol1, Protocol >::value, basic_socket >::type & operator=(
    basic_socket< Protocol1 > && other);

This assignment operator moves a socket from one object to another.

Parameters

other

The other basic_socket object from which the move will occur.

Remarks

Following the move, the moved-from object is in the same state as if constructed using the basic_socket(io_context&) constructor.


PrevUpHomeNext