diff --git a/include/fmt/core.h b/include/fmt/core.h index 0f3c839e..f0426093 100644 --- a/include/fmt/core.h +++ b/include/fmt/core.h @@ -532,39 +532,21 @@ using string_view = basic_string_view; template struct is_char : std::false_type {}; template <> struct is_char : std::true_type {}; -/** - \rst - Returns a string view of `s`. In order to add custom string type support to - {fmt} provide an overload of `to_string_view` for it in the same namespace as - the type for the argument-dependent lookup to work. - - **Example**:: - - namespace my_ns { - inline string_view to_string_view(const my_string& s) { - return {s.data(), s.length()}; - } - } - std::string message = fmt::format(my_string("The answer is {}"), 42); - \endrst - */ +// Returns a string view of `s`. template ::value)> FMT_INLINE auto to_string_view(const Char* s) -> basic_string_view { return s; } - template inline auto to_string_view(const std::basic_string& s) -> basic_string_view { return s; } - template constexpr auto to_string_view(basic_string_view s) -> basic_string_view { return s; } - template >::value)> inline auto to_string_view(detail::std_string_view s)