format: support string_view as a string
This commit is contained in:
parent
71c44b3293
commit
520af37042
10
format.hpp
10
format.hpp
@ -265,9 +265,13 @@ namespace cruft::format {
|
||||
break;
|
||||
|
||||
case type_t::STRING:
|
||||
if (!std::is_same_v<ValueT, view<const char*>> && !std::is_same_v<ValueT, std::string>)
|
||||
throw std::runtime_error ("expected string value");
|
||||
break;
|
||||
if (std::is_same_v<ValueT, view<const char*>>)
|
||||
break;
|
||||
if (std::is_same_v<ValueT, std::string>)
|
||||
break;
|
||||
if (std::is_same_v<ValueT, std::string_view>)
|
||||
break;
|
||||
throw std::runtime_error ("expected string value");
|
||||
|
||||
case type_t::POINTER:
|
||||
if (!std::is_pointer_v<ValueT> && !std::is_integral_v<ValueT>)
|
||||
|
Loading…
Reference in New Issue
Block a user