From 520af370425c90283b3a7472e3fc6cee214b8815 Mon Sep 17 00:00:00 2001 From: Danny Robson Date: Tue, 16 Apr 2019 10:18:10 +1000 Subject: [PATCH] format: support string_view as a string --- format.hpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/format.hpp b/format.hpp index 6cc98afb..dd3247f7 100644 --- a/format.hpp +++ b/format.hpp @@ -265,9 +265,13 @@ namespace cruft::format { break; case type_t::STRING: - if (!std::is_same_v> && !std::is_same_v) - throw std::runtime_error ("expected string value"); - break; + if (std::is_same_v>) + break; + if (std::is_same_v) + break; + if (std::is_same_v) + break; + throw std::runtime_error ("expected string value"); case type_t::POINTER: if (!std::is_pointer_v && !std::is_integral_v)