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
a103b9bc
Commit
a103b9bc
authored
Mar 04, 2018
by
Victor Zverovich
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Workaround missed optimization in gcc (#668)
parent
bb47109a
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
4 deletions
+11
-4
include/fmt/core.h
include/fmt/core.h
+11
-4
No files found.
include/fmt/core.h
View file @
a103b9bc
...
...
@@ -1187,11 +1187,16 @@ std::wstring vformat(wstring_view format_str, wformat_args args);
*/
template
<
typename
...
Args
>
inline
std
::
string
format
(
string_view
format_str
,
const
Args
&
...
args
)
{
return
vformat
(
format_str
,
make_args
(
args
...));
// This should be just
// return vformat(format_str, make_args(args...));
// but gcc has trouble optimizing the latter, so break it down.
arg_store
<
context
,
Args
...
>
as
(
args
...);
return
vformat
(
format_str
,
as
);
}
template
<
typename
...
Args
>
inline
std
::
wstring
format
(
wstring_view
format_str
,
const
Args
&
...
args
)
{
return
vformat
(
format_str
,
make_args
<
wcontext
>
(
args
...));
arg_store
<
wcontext
,
Args
...
>
as
(
args
...);
return
vformat
(
format_str
,
as
);
}
FMT_API
void
vprint
(
std
::
FILE
*
f
,
string_view
format_str
,
format_args
args
);
...
...
@@ -1207,7 +1212,8 @@ FMT_API void vprint(std::FILE *f, string_view format_str, format_args args);
*/
template
<
typename
...
Args
>
inline
void
print
(
std
::
FILE
*
f
,
string_view
format_str
,
const
Args
&
...
args
)
{
vprint
(
f
,
format_str
,
make_args
(
args
...));
arg_store
<
context
,
Args
...
>
as
(
args
...);
vprint
(
f
,
format_str
,
as
);
}
FMT_API
void
vprint
(
string_view
format_str
,
format_args
args
);
...
...
@@ -1223,7 +1229,8 @@ FMT_API void vprint(string_view format_str, format_args args);
*/
template
<
typename
...
Args
>
inline
void
print
(
string_view
format_str
,
const
Args
&
...
args
)
{
vprint
(
format_str
,
make_args
(
args
...));
arg_store
<
context
,
Args
...
>
as
(
args
...);
vprint
(
format_str
,
as
);
}
}
// namespace fmt
...
...
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