From c5a1615301d70e67078a21aeea3e6c0f2bfe0188 Mon Sep 17 00:00:00 2001 From: Vinnie Falco Date: Sun, 29 Oct 2017 06:45:33 -0700 Subject: [PATCH] basic_fields returns const values --- CHANGELOG.md | 6 ++++++ include/boost/beast/http/fields.hpp | 14 +++++++------- include/boost/beast/http/impl/fields.ipp | 14 +++++++------- 3 files changed, 20 insertions(+), 14 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d5eb4103..32d1c2eb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +Version 131: + +* basic_fields returns const values + +-------------------------------------------------------------------------------- + Version 130: * Tidy up fallthrough warning diff --git a/include/boost/beast/http/fields.hpp b/include/boost/beast/http/fields.hpp index 3ce63723..cf9945fd 100644 --- a/include/boost/beast/http/fields.hpp +++ b/include/boost/beast/http/fields.hpp @@ -93,15 +93,15 @@ public: value_type& operator=(value_type const&) = delete; /// Returns the field enum, which can be @ref field::unknown - field + field const name() const; /// Returns the field name as a string - string_view + string_view const name_string() const; /// Returns the value of the field - string_view + string_view const value() const; }; @@ -280,7 +280,7 @@ public: @throws std::out_of_range if the field is not found. */ - string_view + string_view const at(field name) const; /** Returns the value for a field, or throws an exception. @@ -294,7 +294,7 @@ public: @throws std::out_of_range if the field is not found. */ - string_view + string_view const at(string_view name) const; /** Returns the value for a field, or `""` if it does not exist. @@ -304,7 +304,7 @@ public: @param name The name of the field. */ - string_view + string_view const operator[](field name) const; /** Returns the value for a case-insensitive matching header, or `""` if it does not exist. @@ -314,7 +314,7 @@ public: @param name The name of the field. */ - string_view + string_view const operator[](string_view name) const; //-------------------------------------------------------------------------- diff --git a/include/boost/beast/http/impl/fields.ipp b/include/boost/beast/http/impl/fields.ipp index dd712d8a..f787ee92 100644 --- a/include/boost/beast/http/impl/fields.ipp +++ b/include/boost/beast/http/impl/fields.ipp @@ -291,7 +291,7 @@ value_type(field name, template inline -field +field const basic_fields:: value_type:: name() const @@ -301,7 +301,7 @@ name() const template inline -string_view +string_view const basic_fields:: value_type:: name_string() const @@ -313,7 +313,7 @@ name_string() const template inline -string_view +string_view const basic_fields:: value_type:: value() const @@ -465,7 +465,7 @@ operator=(basic_fields const& other) -> //------------------------------------------------------------------------------ template -string_view +string_view const basic_fields:: at(field name) const { @@ -478,7 +478,7 @@ at(field name) const } template -string_view +string_view const basic_fields:: at(string_view name) const { @@ -490,7 +490,7 @@ at(string_view name) const } template -string_view +string_view const basic_fields:: operator[](field name) const { @@ -502,7 +502,7 @@ operator[](field name) const } template -string_view +string_view const basic_fields:: operator[](string_view name) const {