From ff2dc67afa2a8984978993578e56d84dcb85d875 Mon Sep 17 00:00:00 2001 From: Vinnie Falco Date: Wed, 8 Nov 2017 20:13:02 -0800 Subject: [PATCH] Some basic_fields special members are protected --- CHANGELOG.md | 1 + include/boost/beast/http/basic_parser.hpp | 37 ++++++++++++----------- 2 files changed, 21 insertions(+), 17 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 76341141..0acea507 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ Version 140: * Fix utf8_checker test failures * Fix signature for async_read_some, and tests * Tidy up basic_parser +* Some basic_fields special members are protected -------------------------------------------------------------------------------- diff --git a/include/boost/beast/http/basic_parser.hpp b/include/boost/beast/http/basic_parser.hpp index 30a7c888..552adec7 100644 --- a/include/boost/beast/http/basic_parser.hpp +++ b/include/boost/beast/http/basic_parser.hpp @@ -230,6 +230,26 @@ class basic_parser state state_ = state::nothing_yet; // initial state unsigned f_ = 0; // flags +protected: + /// Default constructor + basic_parser() = default; + + /// Move constructor + basic_parser(basic_parser &&) = default; + + /// Move assignment + basic_parser& operator=(basic_parser &&) = default; + + /** Move constructor + + @note + + After the move, the only valid operation on the + moved-from object is destruction. + */ + template + basic_parser(basic_parser&&); + public: /// `true` if this parser parses requests, `false` for responses. using is_request = @@ -241,26 +261,9 @@ public: /// Copy constructor basic_parser(basic_parser const&) = delete; - /// Move constructor - basic_parser(basic_parser &&) = default; - - /// Move assignment - basic_parser& operator=(basic_parser &&) = default; - /// Copy assignment basic_parser& operator=(basic_parser const&) = delete; - /// Default constructor - basic_parser() = default; - - /** Move constructor - - After the move, the only valid operation on the - moved-from object is destruction. - */ - template - basic_parser(basic_parser&&); - /** Returns a reference to this object as a @ref basic_parser. This is used to pass a derived class where a base class is