From 2cdaf51119b866a9869349d42c196afbae2b7367 Mon Sep 17 00:00:00 2001 From: Vinnie Falco Date: Thu, 22 Nov 2018 21:02:58 -0800 Subject: [PATCH] http::message is not-a boost::empty_value fix #1306 --- CHANGELOG.md | 1 + .../boost/beast/http/detail/type_traits.hpp | 4 ++-- include/boost/beast/http/message.hpp | 19 +++++++++++-------- include/boost/beast/http/type_traits.hpp | 2 +- 4 files changed, 15 insertions(+), 11 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ce678721..12e84775 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ Version 192: * Use mp11::integer_sequence * Tidy up warnings and deprecated usage +* http::message is not-a boost::empty_value -------------------------------------------------------------------------------- diff --git a/include/boost/beast/http/detail/type_traits.hpp b/include/boost/beast/http/detail/type_traits.hpp index b849446b..d36d868c 100644 --- a/include/boost/beast/http/detail/type_traits.hpp +++ b/include/boost/beast/http/detail/type_traits.hpp @@ -19,10 +19,10 @@ namespace beast { namespace http { template -struct header; +class header; template -struct message; +class message; template class parser; diff --git a/include/boost/beast/http/message.hpp b/include/boost/beast/http/message.hpp index 45098814..1030bd0b 100644 --- a/include/boost/beast/http/message.hpp +++ b/include/boost/beast/http/message.hpp @@ -47,16 +47,17 @@ namespace http { */ #if BOOST_BEAST_DOXYGEN template -struct header : Fields +class header : public Fields #else template -struct header; +class header; template -struct header : Fields +class header : public Fields #endif { +public: static_assert(is_fields::value, "Fields requirements not met"); @@ -229,7 +230,7 @@ struct header : Fields private: template - friend struct message; + friend class message; template friend @@ -258,8 +259,9 @@ private: A `header` includes the start-line and header-fields. */ template -struct header : Fields +class header : public Fields { +public: static_assert(is_fields::value, "Fields requirements not met"); @@ -418,7 +420,7 @@ struct header : Fields private: #if ! BOOST_BEAST_DOXYGEN template - friend struct message; + friend class message; template friend @@ -487,13 +489,14 @@ using value_type_t = typename T::value_type; field value pairs. */ template -struct message - : header +class message + : public header #if ! BOOST_BEAST_DOXYGEN , boost::empty_value< typename Body::value_type> #endif { +public: /// The base class used to hold the header portion of the message. using header_type = header; diff --git a/include/boost/beast/http/type_traits.hpp b/include/boost/beast/http/type_traits.hpp index d3b897f8..037b8f37 100644 --- a/include/boost/beast/http/type_traits.hpp +++ b/include/boost/beast/http/type_traits.hpp @@ -25,7 +25,7 @@ namespace beast { namespace http { template -struct message; +class message; /** Determine if `T` meets the requirements of @b Body.