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
83dd2ab9
Commit
83dd2ab9
authored
Sep 16, 2017
by
Victor Zverovich
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Simplify dynamic_specs_handler
parent
5a8ae0bb
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
7 deletions
+9
-7
fmt/format.h
fmt/format.h
+9
-7
No files found.
fmt/format.h
View file @
83dd2ab9
...
...
@@ -3238,22 +3238,24 @@ class dynamic_specs_handler: public specs_setter<Char> {
template
<
typename
Id
>
void
on_dynamic_width
(
Id
arg_id
)
{
s
et
(
specs_
.
width_ref
,
arg_id
);
s
pecs_
.
width_ref
=
make_arg_ref
(
arg_id
);
}
template
<
typename
Id
>
void
on_dynamic_precision
(
Id
arg_id
)
{
s
et
(
specs_
.
precision_ref
,
arg_id
);
s
pecs_
.
precision_ref
=
make_arg_ref
(
arg_id
);
}
private:
using
arg_ref
=
arg_ref
<
Char
>
;
template
<
typename
Id
>
void
set
(
arg_ref
<
Char
>
&
ref
,
Id
arg_id
)
{
re
f
=
arg_ref
<
Char
>
(
arg_id
);
arg_ref
make_arg_ref
(
Id
arg_id
)
{
re
turn
arg_ref
(
arg_id
);
}
void
set
(
arg_ref
<
Char
>
&
ref
,
auto_id
)
{
re
f
.
kind
=
arg_ref
<
Char
>::
NONE
;
arg_ref
make_arg_ref
(
auto_id
)
{
re
turn
arg_ref
(
arg_ref
::
NONE
)
;
}
dynamic_format_specs
<
Char
>
&
specs_
;
...
...
@@ -3291,7 +3293,7 @@ Iterator parse_arg_id(Iterator it, Handler handler) {
// format specifiers.
template
<
typename
Iterator
,
typename
Handler
>
Iterator
parse_format_specs
(
Iterator
it
,
Handler
&
handler
)
{
typedef
typename
Iterator
::
value_type
char
_type
;
using
char_type
=
typename
Iterator
::
value
_type
;
// Parse fill and alignment.
if
(
char_type
c
=
*
it
)
{
auto
p
=
it
+
1
;
...
...
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