From 7e42c65bb68adb32158a4ac2255413aa232a4e53 Mon Sep 17 00:00:00 2001 From: Victor Zverovich Date: Mon, 3 Jun 2019 11:57:08 -0700 Subject: [PATCH] Document a more useful to_string_view overload --- doc/api.rst | 2 +- include/fmt/core.h | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) 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(