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
c5ebecf7
Commit
c5ebecf7
authored
Mar 30, 2018
by
Victor Zverovich
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Document format_to_n
parent
3cf05263
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
1 deletion
+13
-1
doc/api.rst
doc/api.rst
+3
-0
include/fmt/format.h
include/fmt/format.h
+10
-1
No files found.
doc/api.rst
View file @
c5ebecf7
...
...
@@ -135,6 +135,9 @@ Output iterator support
-----------------------
.. doxygenfunction:: fmt::format_to(OutputIt, string_view, const Args&...)
.. doxygenfunction:: fmt::format_to_n(OutputIt, size_t string_view, const Args&...)
.. doxygenstruct:: fmt::format_to_n_result
:members:
Literal-based API
-----------------
...
...
include/fmt/format.h
View file @
c5ebecf7
...
...
@@ -3256,7 +3256,7 @@ struct format_handler : internal::error_handler {
basic_arg
<
Context
>
arg
;
};
/** Formats arguments and writes the output to the
buffer
. */
/** Formats arguments and writes the output to the
range
. */
template
<
typename
ArgFormatter
,
typename
Char
,
typename
Context
>
typename
Context
::
iterator
vformat_to
(
typename
ArgFormatter
::
range
out
,
basic_string_view
<
Char
>
format_str
,
...
...
@@ -3419,10 +3419,19 @@ inline typename std::enable_if<
template
<
typename
OutputIt
>
struct
format_to_n_result
{
/** Iterator past the end of the output range. */
OutputIt
out
;
/** Total (not truncated) output size. */
std
::
size_t
size
;
};
/**
\rst
Formats arguments, writes up to ``n`` characters of the result to the output
iterator ``out`` and returns the total output size and the iterator past the end
of the output range.
\endrst
*/
template
<
typename
OutputIt
,
typename
...
Args
>
inline
format_to_n_result
<
OutputIt
>
format_to_n
(
OutputIt
out
,
std
::
size_t
n
,
string_view
format_str
,
const
Args
&
...
args
)
{
...
...
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