diff --git a/doc/api.rst b/doc/api.rst index 49c6eea7..c1c3ee2f 100644 --- a/doc/api.rst +++ b/doc/api.rst @@ -210,7 +210,7 @@ Utilities .. doxygenfunction:: fmt::to_wstring(const T&) -.. doxygenfunction:: fmt::to_string_view(const basic_string&) +.. doxygenfunction:: fmt::to_string_view(const Char*) .. doxygenfunction:: fmt::join(const Range&, string_view) diff --git a/include/fmt/core.h b/include/fmt/core.h index baee5ea9..f65d22f2 100644 --- a/include/fmt/core.h +++ b/include/fmt/core.h @@ -461,6 +461,11 @@ template struct is_char : std::is_integral {}; std::string message = fmt::format(my_string("The answer is {}"), 42); \endrst */ +template ::value)> +inline basic_string_view to_string_view(const Char* s) { + return s; +} + template inline basic_string_view to_string_view( const std::basic_string& s) { @@ -472,11 +477,6 @@ inline basic_string_view to_string_view(basic_string_view s) { return s; } -template ::value)> -inline basic_string_view to_string_view(const Char* s) { - return s; -} - template >::value)> inline basic_string_view to_string_view(