mirror of
https://github.com/fmtlib/fmt.git
synced 2024-12-24 12:14:26 +00:00
Document a more useful to_string_view overload
This commit is contained in:
parent
1e6e87cb74
commit
7e42c65bb6
@ -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(
|
||||
|
Loading…
Reference in New Issue
Block a user