From 4c4f19b913644eab501cdb41fc198b7e958e9f8a Mon Sep 17 00:00:00 2001 From: cxx23 <164133010+cxx24@users.noreply.github.com> Date: Sat, 18 May 2024 23:10:34 -0700 Subject: [PATCH] Update any_str_ops.hpp add support for std::string_view --- rtb/datacache/any_str_ops.hpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/rtb/datacache/any_str_ops.hpp b/rtb/datacache/any_str_ops.hpp index 4dd4a96..a7fce45 100644 --- a/rtb/datacache/any_str_ops.hpp +++ b/rtb/datacache/any_str_ops.hpp @@ -28,12 +28,13 @@ namespace boost { #endif #include +#include namespace ufw { /** * Functor for containers transparent across `std::string`, - * `boost::container::string`, `boost::string_view`, and `char const*`. + * `boost::container::string`, `boost::string_view`, `std::string_view` and `char const*`. */ template struct any_str_op { @@ -48,11 +49,13 @@ namespace ufw { using shm_str_t = typename boost::container::basic_string; using std_str_t = std::basic_string>; using str_view_t = boost::basic_string_view; + using std_str_view_t = std::basic_string_view; static str_view_t view(char_t const* x) { return {x}; } static str_view_t view(shm_str_t const& x) { return {x.data(), x.size()}; } static str_view_t view(std_str_t const& x) { return {x}; } static str_view_t view(str_view_t x) { return x; } + static str_view_t view(std_str_view_t const& x) { return {x.data(), x.size()}; } }; template