Move friend function template definition

This commit is contained in:
Vinnie Falco
2019-04-08 15:12:51 -07:00
parent b701d72ddb
commit 1de60a0462
2 changed files with 35 additions and 13 deletions

View File

@ -1,3 +1,9 @@
Version 249:
* Move friend function template definition
--------------------------------------------------------------------------------
Version 248:
* Don't use a moved-from handler

View File

@ -655,12 +655,7 @@ public:
teardown(
boost::beast::role_type role,
ssl_stream<SyncStream>& stream,
boost::system::error_code& ec)
{
// Just forward it to the underlying ssl::stream
using boost::beast::websocket::teardown;
teardown(role, *stream.p_, ec);
}
boost::system::error_code& ec);
template<class AsyncStream, class TeardownHandler>
friend
@ -668,16 +663,37 @@ public:
async_teardown(
boost::beast::role_type role,
ssl_stream<AsyncStream>& stream,
TeardownHandler&& handler)
{
// Just forward it to the underlying ssl::stream
using boost::beast::websocket::async_teardown;
async_teardown(role, *stream.p_,
std::forward<TeardownHandler>(handler));
}
TeardownHandler&& handler);
#endif
};
#if ! BOOST_BEAST_DOXYGEN
template<class SyncStream>
void
teardown(
boost::beast::role_type role,
ssl_stream<SyncStream>& stream,
boost::system::error_code& ec)
{
// Just forward it to the underlying ssl::stream
using boost::beast::websocket::teardown;
teardown(role, *stream.p_, ec);
}
template<class AsyncStream, class TeardownHandler>
void
async_teardown(
boost::beast::role_type role,
ssl_stream<AsyncStream>& stream,
TeardownHandler&& handler)
{
// Just forward it to the underlying ssl::stream
using boost::beast::websocket::async_teardown;
async_teardown(role, *stream.p_,
std::forward<TeardownHandler>(handler));
}
#endif
} // beast
} // boost