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
fbc38b90
Commit
fbc38b90
authored
6 years ago
by
Victor Zverovich
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Pass heavy arguments by ref
parent
8dc69b9d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
5 deletions
+6
-5
include/fmt/core.h
include/fmt/core.h
+1
-1
include/fmt/format.h
include/fmt/format.h
+5
-4
No files found.
include/fmt/core.h
View file @
fbc38b90
...
...
@@ -720,7 +720,7 @@ class basic_format_arg {
template
<
typename
Visitor
,
typename
Ctx
>
friend
FMT_CONSTEXPR
typename
internal
::
result_of
<
Visitor
(
int
)
>::
type
visit
(
Visitor
&&
vis
,
basic_format_arg
<
Ctx
>
arg
);
visit
(
Visitor
&&
vis
,
const
basic_format_arg
<
Ctx
>
&
arg
);
friend
class
basic_format_args
<
Context
>
;
friend
class
internal
::
arg_map
<
Context
>
;
...
...
This diff is collapsed.
Click to expand it.
include/fmt/format.h
View file @
fbc38b90
...
...
@@ -1165,7 +1165,7 @@ struct monostate {};
*/
template
<
typename
Visitor
,
typename
Context
>
FMT_CONSTEXPR
typename
internal
::
result_of
<
Visitor
(
int
)
>::
type
visit
(
Visitor
&&
vis
,
basic_format_arg
<
Context
>
arg
)
{
visit
(
Visitor
&&
vis
,
const
basic_format_arg
<
Context
>
&
arg
)
{
typedef
typename
Context
::
char_type
char_type
;
switch
(
arg
.
type_
)
{
case
internal
:
:
none_type
:
...
...
@@ -2405,7 +2405,7 @@ class basic_writer {
// <left-padding><value><right-padding>
// where <value> is written by f(it).
template
<
typename
F
>
void
write_padded
(
std
::
size_t
size
,
const
align_spec
&
spec
,
F
f
);
void
write_padded
(
std
::
size_t
size
,
const
align_spec
&
spec
,
F
&&
f
);
template
<
typename
F
>
struct
padded_int_writer
{
...
...
@@ -2755,7 +2755,7 @@ class basic_writer {
template
<
typename
Range
>
template
<
typename
F
>
void
basic_writer
<
Range
>::
write_padded
(
std
::
size_t
size
,
const
align_spec
&
spec
,
F
f
)
{
std
::
size_t
size
,
const
align_spec
&
spec
,
F
&&
f
)
{
unsigned
width
=
spec
.
width
();
if
(
width
<=
size
)
return
f
(
reserve
(
size
));
...
...
@@ -3250,7 +3250,8 @@ class dynamic_formatter {
template
<
typename
Range
,
typename
Char
>
typename
basic_format_context
<
Range
,
Char
>::
format_arg
basic_format_context
<
Range
,
Char
>::
get_arg
(
basic_string_view
<
char_type
>
name
)
{
basic_format_context
<
Range
,
Char
>::
get_arg
(
basic_string_view
<
char_type
>
name
)
{
map_
.
init
(
this
->
args
());
format_arg
arg
=
map_
.
find
(
name
);
if
(
arg
.
type
()
==
internal
::
none_type
)
...
...
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