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
436acf34
Commit
436acf34
authored
Aug 03, 2019
by
Victor Zverovich
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make formatted_size & format_to_n non-members
parent
82312804
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
21 deletions
+20
-21
include/fmt/compile.h
include/fmt/compile.h
+20
-21
No files found.
include/fmt/compile.h
View file @
436acf34
...
@@ -185,27 +185,6 @@ class prepared_format {
...
@@ -185,27 +185,6 @@ class prepared_format {
prepared_format
()
=
delete
;
prepared_format
()
=
delete
;
std
::
size_t
formatted_size
(
const
Args
&
...
args
)
const
{
const
auto
it
=
this
->
format_to
(
counting_iterator
<
char_type
>
(),
args
...);
return
it
.
count
();
}
template
<
typename
OutputIt
,
FMT_ENABLE_IF
(
internal
::
is_output_iterator
<
OutputIt
>
::
value
)
>
inline
format_to_n_result
<
OutputIt
>
format_to_n
(
OutputIt
out
,
unsigned
n
,
const
Args
&
...
args
)
const
{
format_arg_store
<
typename
format_to_n_context
<
OutputIt
,
char_type
>::
type
,
Args
...
>
as
(
args
...);
typedef
truncating_iterator
<
OutputIt
>
trunc_it
;
typedef
output_range
<
trunc_it
,
char_type
>
range
;
range
r
(
trunc_it
(
out
,
n
));
auto
it
=
this
->
vformat_to
(
r
,
typename
format_to_n_args
<
OutputIt
,
char_type
>::
type
(
as
));
return
{
it
.
base
(),
it
.
count
()};
}
template
<
typename
Container
,
FMT_ENABLE_IF
(
is_contiguous
<
Container
>
::
value
)
>
template
<
typename
Container
,
FMT_ENABLE_IF
(
is_contiguous
<
Container
>
::
value
)
>
inline
std
::
back_insert_iterator
<
Container
>
format_to
(
inline
std
::
back_insert_iterator
<
Container
>
format_to
(
std
::
back_insert_iterator
<
Container
>
out
,
Args
&&
...
args
)
const
{
std
::
back_insert_iterator
<
Container
>
out
,
Args
&&
...
args
)
const
{
...
@@ -723,6 +702,26 @@ std::basic_string<Char> format(const CompiledFormat& cf, const Args&... args) {
...
@@ -723,6 +702,26 @@ std::basic_string<Char> format(const CompiledFormat& cf, const Args&... args) {
return
to_string
(
buffer
);
return
to_string
(
buffer
);
}
}
template
<
typename
OutputIt
,
typename
CompiledFormat
,
typename
...
Args
,
FMT_ENABLE_IF
(
internal
::
is_output_iterator
<
OutputIt
>
::
value
)
>
format_to_n_result
<
OutputIt
>
format_to_n
(
OutputIt
out
,
unsigned
n
,
const
CompiledFormat
&
cf
,
const
Args
&
...
args
)
{
auto
it
=
cf
.
format_to
(
internal
::
truncating_iterator
<
OutputIt
>
(
out
,
n
),
args
...)
.
count
();
return
{
it
.
base
(),
it
.
count
()};
}
template
<
typename
CompiledFormat
,
typename
...
Args
>
std
::
size_t
formatted_size
(
const
CompiledFormat
&
cf
,
const
Args
&
...
args
)
{
return
cf
.
format_to
(
internal
::
counting_iterator
<
typename
CompiledFormat
::
char_type
>
(),
args
...)
.
count
();
}
FMT_END_NAMESPACE
FMT_END_NAMESPACE
#endif // FMT_COMPILE_H_
#endif // FMT_COMPILE_H_
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