diff options
Diffstat (limited to 'src/string_utils.hh')
| -rw-r--r-- | src/string_utils.hh | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/string_utils.hh b/src/string_utils.hh index e0adc181..a11aaa91 100644 --- a/src/string_utils.hh +++ b/src/string_utils.hh @@ -136,14 +136,12 @@ decltype(auto) to_string(const StronglyTypedNumber<RealType, ValueType>& val) namespace detail { -template<typename T> constexpr bool is_string = std::is_convertible<T, StringView>::value; +template<typename T> requires std::is_convertible_v<T, StringView> +StringView format_param(const T& val) { return val; } -template<typename T, class = std::enable_if_t<not is_string<T>>> +template<typename T> requires (not std::is_convertible_v<T, StringView>) decltype(auto) format_param(const T& val) { return to_string(val); } -template<typename T, class = std::enable_if_t<is_string<T>>> -StringView format_param(const T& val) { return val; } - } String format(StringView fmt, ArrayView<const StringView> params); |
