From de523833e3b27b1a83777c461a1b4fbdd70c0689 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Sat, 29 Jul 2023 11:20:07 +0100 Subject: Don't need a specific handler for string_view->string --- icespider/core/ihttpRequest.h | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/icespider/core/ihttpRequest.h b/icespider/core/ihttpRequest.h index 5141068..e226e42 100644 --- a/icespider/core/ihttpRequest.h +++ b/icespider/core/ihttpRequest.h @@ -59,6 +59,8 @@ namespace IceSpider { virtual std::ostream & dump(std::ostream & s) const = 0; + static_assert(std::is_constructible_v); + template [[nodiscard]] inline std::optional getFrom(const K & key, OptionalString (IHttpRequest::*src)(const K &) const) const @@ -67,12 +69,9 @@ namespace IceSpider { if constexpr (std::is_convertible::value) { return *v; } - else if constexpr (std::is_constructible::value) { + else if constexpr (std::is_constructible::value) { return T(*v); } - else if constexpr (std::is_same::value) { - return std::to_string(*v); - } else { try { return boost::lexical_cast(*v); -- cgit v1.2.3