From 50ce5f7396efd69e5f0dc6f784e51044ddfada0d Mon Sep 17 00:00:00 2001 From: Damian Jarek Date: Fri, 21 Jun 2019 19:06:26 +0200 Subject: [PATCH] More split compilation in rfc7230.hpp * Moved `find` and `exists` to the `ipp` file. * Fixed missing include file in MSVC. Signed-off-by: Damian Jarek --- CHANGELOG.md | 6 ++++ include/boost/beast/http/impl/rfc7230.hpp | 34 ----------------------- include/boost/beast/http/impl/rfc7230.ipp | 31 +++++++++++++++++++++ include/boost/beast/http/rfc7230.hpp | 12 ++++---- 4 files changed, 43 insertions(+), 40 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 10f456c0..a1ba5cff 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +Version 260: + +* More split compilation in rfc7230.hpp + +-------------------------------------------------------------------------------- + Version 259: * Reduce the number of instantiations of filter_token_list diff --git a/include/boost/beast/http/impl/rfc7230.hpp b/include/boost/beast/http/impl/rfc7230.hpp index 11e424b4..40e2fff0 100644 --- a/include/boost/beast/http/impl/rfc7230.hpp +++ b/include/boost/beast/http/impl/rfc7230.hpp @@ -244,27 +244,6 @@ cend() const -> return const_iterator{s_.end(), s_.end()}; } -template -auto -ext_list:: -find(T const& s) -> - const_iterator -{ - return std::find_if(begin(), end(), - [&s](value_type const& v) - { - return iequals(s, v.first); - }); -} - -template -bool -ext_list:: -exists(T const& s) -{ - return find(s) != end(); -} - //------------------------------------------------------------------------------ @@ -378,19 +357,6 @@ cend() const -> return const_iterator{s_.end(), s_.end()}; } -template -bool -token_list:: -exists(T const& s) -{ - return std::find_if(begin(), end(), - [&s](value_type const& v) - { - return iequals(s, v); - } - ) != end(); -} - template bool validate_list(detail::basic_parsed_list< diff --git a/include/boost/beast/http/impl/rfc7230.ipp b/include/boost/beast/http/impl/rfc7230.ipp index cf60cefa..6b46493e 100644 --- a/include/boost/beast/http/impl/rfc7230.ipp +++ b/include/boost/beast/http/impl/rfc7230.ipp @@ -11,6 +11,7 @@ #define BOOST_BEAST_HTTP_IMPL_RFC7230_IPP #include +#include namespace boost { namespace beast { @@ -123,6 +124,24 @@ increment() } } +auto +ext_list:: +find(string_view const& s) -> const_iterator +{ + return std::find_if(begin(), end(), + [&s](value_type const& v) + { + return beast::iequals(s, v.first); + }); +} + +bool +ext_list:: +exists(string_view const& s) +{ + return find(s) != end(); +} + void token_list::const_iterator:: increment() @@ -169,6 +188,18 @@ increment() } } +bool +token_list:: +exists(string_view const& s) +{ + return std::find_if(begin(), end(), + [&s](value_type const& v) + { + return beast::iequals(s, v); + } + ) != end(); +} + } // http } // beast } // boost diff --git a/include/boost/beast/http/rfc7230.hpp b/include/boost/beast/http/rfc7230.hpp index bc2498db..c83494e6 100644 --- a/include/boost/beast/http/rfc7230.hpp +++ b/include/boost/beast/http/rfc7230.hpp @@ -190,17 +190,17 @@ public: @return An iterator to the matching token, or `end()` if no token exists. */ - template + BOOST_BEAST_DECL const_iterator - find(T const& s); + find(string_view const& s); /** Return `true` if a token is present in the list. @param s The token to find. A case-insensitive comparison is used. */ - template + BOOST_BEAST_DECL bool - exists(T const& s); + exists(string_view const& s); }; //------------------------------------------------------------------------------ @@ -275,9 +275,9 @@ public: @param s The token to find. A case-insensitive comparison is used. */ - template + BOOST_BEAST_DECL bool - exists(T const& s); + exists(string_view const& s); }; /** A list of tokens in a comma separated HTTP field value.