diff --git a/CHANGELOG.md b/CHANGELOG.md index 426ea60d..ab5e8d2c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ HTTP * Make chunk_encode public * Add write, async_write, operator<< for message_headers * Add read, async_read for message_headers +* Fix with_body example WebSocket diff --git a/include/beast/http/parser_v1.hpp b/include/beast/http/parser_v1.hpp index c729d12b..9d013843 100644 --- a/include/beast/http/parser_v1.hpp +++ b/include/beast/http/parser_v1.hpp @@ -111,6 +111,9 @@ public: /** Construct the parser. @param args Forwarded to the message constructor. + + @note This function participates in overload resolution only + if the first argument is not a parser or headers parser. */ #if GENERATING_DOCS template @@ -118,8 +121,13 @@ public: parser_v1(Args&&... args); #else template::type, parser_v1>::value>> + class = typename std::enable_if< + ! std::is_same::type, + headers_parser_v1>::value && + ! std::is_same::type, parser_v1>::value + >::type> explicit parser_v1(Arg1&& arg1, ArgN&&... argn) : m_(std::forward(arg1), @@ -135,7 +143,7 @@ public: */ template explicit - parser_v1(headers_parser_v1&& parser, + parser_v1(headers_parser_v1& parser, Args&&... args) : m_(parser.release(), std::forward(args)...) { @@ -309,7 +317,7 @@ private: @code headers_parser ph; ... - auto p = with_body(std::move(ph)); + auto p = with_body(ph); ... message m = p.release(); @endcode @@ -320,7 +328,7 @@ with_body(headers_parser_v1& parser, Args&&... args) { return parser_v1( - std::move(parser), std::forward(args)...); + parser, std::forward(args)...); } } // http