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
55010a9d
Commit
55010a9d
authored
Jun 04, 2021
by
Daniela Engert
Committed by
Victor Zverovich
Jun 11, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Support non-`char` overloads (module)
parent
0193e7c4
Changes
2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
141 additions
and
18 deletions
+141
-18
include/fmt/format.h
include/fmt/format.h
+16
-3
test/module-test.cc
test/module-test.cc
+125
-15
No files found.
include/fmt/format.h
View file @
55010a9d
...
...
@@ -2624,6 +2624,20 @@ template <typename Char>
void
vformat_to
(
buffer
<
Char
>&
buf
,
basic_string_view
<
Char
>
fmt
,
basic_format_args
<
buffer_context
<
type_identity_t
<
Char
>>>
args
,
locale_ref
loc
)
{
// workaround for msvc bug regarding name-lookup in module
// link names into function scope
using
detail
::
arg_formatter
;
using
detail
::
buffer_appender
;
using
detail
::
custom_formatter
;
using
detail
::
default_arg_formatter
;
using
detail
::
get_arg
;
using
detail
::
locale_ref
;
using
detail
::
parse_format_specs
;
using
detail
::
specs_checker
;
using
detail
::
specs_handler
;
using
detail
::
to_unsigned
;
using
detail
::
type
;
using
detail
::
write
;
auto
out
=
buffer_appender
<
Char
>
(
buf
);
if
(
fmt
.
size
()
==
2
&&
equal2
(
fmt
.
data
(),
"{}"
))
{
auto
arg
=
args
.
get
(
0
);
...
...
@@ -2680,13 +2694,12 @@ void vformat_to(buffer<Char>& buf, basic_string_view<Char> fmt,
begin
=
parse_format_specs
(
begin
,
end
,
handler
);
if
(
begin
==
end
||
*
begin
!=
'}'
)
on_error
(
"missing '}' in format string"
);
auto
f
=
detail
::
arg_formatter
<
Char
>
{
context
.
out
(),
specs
,
context
.
locale
()};
auto
f
=
arg_formatter
<
Char
>
{
context
.
out
(),
specs
,
context
.
locale
()};
context
.
advance_to
(
visit_format_arg
(
f
,
arg
));
return
begin
;
}
};
parse_format_string
<
false
>
(
fmt
,
format_handler
(
out
,
fmt
,
args
,
loc
));
detail
::
parse_format_string
<
false
>
(
fmt
,
format_handler
(
out
,
fmt
,
args
,
loc
));
}
#ifndef FMT_HEADER_ONLY
...
...
test/module-test.cc
View file @
55010a9d
This diff is collapsed.
Click to expand 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