Commit 7e42c65b authored by Victor Zverovich's avatar Victor Zverovich

Document a more useful to_string_view overload

parent 1e6e87cb
......@@ -210,7 +210,7 @@ Utilities
.. doxygenfunction:: fmt::to_wstring(const T&)
.. doxygenfunction:: fmt::to_string_view(const basic_string<Char, Traits, Allocator>&)
.. doxygenfunction:: fmt::to_string_view(const Char*)
.. doxygenfunction:: fmt::join(const Range&, string_view)
......
......@@ -461,6 +461,11 @@ template <typename T> struct is_char : std::is_integral<T> {};
std::string message = fmt::format(my_string("The answer is {}"), 42);
\endrst
*/
template <typename Char, FMT_ENABLE_IF(is_char<Char>::value)>
inline basic_string_view<Char> to_string_view(const Char* s) {
return s;
}
template <typename Char, typename Traits, typename Allocator>
inline basic_string_view<Char> to_string_view(
const std::basic_string<Char, Traits, Allocator>& s) {
......@@ -472,11 +477,6 @@ inline basic_string_view<Char> to_string_view(basic_string_view<Char> s) {
return s;
}
template <typename Char, FMT_ENABLE_IF(is_char<Char>::value)>
inline basic_string_view<Char> to_string_view(const Char* s) {
return s;
}
template <typename Char,
FMT_ENABLE_IF(!std::is_empty<internal::std_string_view<Char>>::value)>
inline basic_string_view<Char> to_string_view(
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment