From 1de60a046292dcd42bb0097176e0139ba4ad051b Mon Sep 17 00:00:00 2001 From: Vinnie Falco Date: Mon, 8 Apr 2019 15:12:51 -0700 Subject: [PATCH] Move friend function template definition --- CHANGELOG.md | 6 ++++ include/boost/beast/ssl/ssl_stream.hpp | 42 ++++++++++++++++++-------- 2 files changed, 35 insertions(+), 13 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 43e39095..8771c7e1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +Version 249: + +* Move friend function template definition + +-------------------------------------------------------------------------------- + Version 248: * Don't use a moved-from handler diff --git a/include/boost/beast/ssl/ssl_stream.hpp b/include/boost/beast/ssl/ssl_stream.hpp index b96dbdda..cab2463d 100644 --- a/include/boost/beast/ssl/ssl_stream.hpp +++ b/include/boost/beast/ssl/ssl_stream.hpp @@ -655,12 +655,7 @@ public: teardown( boost::beast::role_type role, ssl_stream& 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 friend @@ -668,16 +663,37 @@ public: async_teardown( boost::beast::role_type role, ssl_stream& stream, - TeardownHandler&& handler) - { - // Just forward it to the underlying ssl::stream - using boost::beast::websocket::async_teardown; - async_teardown(role, *stream.p_, - std::forward(handler)); - } + TeardownHandler&& handler); #endif }; +#if ! BOOST_BEAST_DOXYGEN +template +void +teardown( + boost::beast::role_type role, + ssl_stream& 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 +void +async_teardown( + boost::beast::role_type role, + ssl_stream& stream, + TeardownHandler&& handler) +{ + // Just forward it to the underlying ssl::stream + using boost::beast::websocket::async_teardown; + async_teardown(role, *stream.p_, + std::forward(handler)); +} +#endif + } // beast } // boost