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
a7e98616
Commit
a7e98616
authored
Oct 29, 2017
by
Victor Zverovich
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Workaround another MSVC madness
parent
db9ffa14
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
17 deletions
+18
-17
include/fmt/format.h
include/fmt/format.h
+18
-17
No files found.
include/fmt/format.h
View file @
a7e98616
...
...
@@ -3518,6 +3518,23 @@ constexpr Iterator parse_format_specs(Iterator it, SpecHandler &handler) {
return
it
;
}
template
<
typename
Handler
,
typename
Char
>
struct
id_adapter
{
constexpr
explicit
id_adapter
(
Handler
&
h
)
:
handler
(
h
)
{}
constexpr
void
operator
()()
{
handler
.
on_arg_id
();
}
constexpr
void
operator
()(
unsigned
id
)
{
handler
.
on_arg_id
(
id
);
}
constexpr
void
operator
()(
basic_string_view
<
Char
>
id
)
{
handler
.
on_arg_id
(
id
);
}
constexpr
void
on_error
(
const
char
*
message
)
{
handler
.
on_error
(
message
);
}
Handler
&
handler
;
};
template
<
typename
Iterator
,
typename
Handler
>
constexpr
void
parse_format_string
(
Iterator
it
,
Handler
&
handler
)
{
using
char_type
=
typename
std
::
iterator_traits
<
Iterator
>::
value_type
;
...
...
@@ -3536,23 +3553,7 @@ constexpr void parse_format_string(Iterator it, Handler &handler) {
}
handler
.
on_text
(
start
,
it
-
1
);
struct
id_adapter
{
constexpr
explicit
id_adapter
(
Handler
&
h
)
:
handler
(
h
)
{}
constexpr
void
operator
()()
{
handler
.
on_arg_id
();
}
constexpr
void
operator
()(
unsigned
id
)
{
handler
.
on_arg_id
(
id
);
}
constexpr
void
operator
()(
basic_string_view
<
char_type
>
id
)
{
handler
.
on_arg_id
(
id
);
}
constexpr
void
on_error
(
const
char
*
message
)
{
handler
.
on_error
(
message
);
}
Handler
&
handler
;
}
adapter
(
handler
);
it
=
parse_arg_id
(
it
,
adapter
);
it
=
parse_arg_id
(
it
,
id_adapter
<
Handler
,
char_type
>
(
handler
));
if
(
*
it
==
'}'
)
{
handler
.
on_replacement_field
(
it
);
}
else
if
(
*
it
==
':'
)
{
...
...
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