Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
F
fmt
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Libraries
fmt
Commits
7e42c65b
Commit
7e42c65b
authored
Jun 03, 2019
by
Victor Zverovich
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Document a more useful to_string_view overload
parent
1e6e87cb
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
6 deletions
+6
-6
doc/api.rst
doc/api.rst
+1
-1
include/fmt/core.h
include/fmt/core.h
+5
-5
No files found.
doc/api.rst
View file @
7e42c65b
...
...
@@ -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)
...
...
include/fmt/core.h
View file @
7e42c65b
...
...
@@ -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
(
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment