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
026f9917
Commit
026f9917
authored
Mar 16, 2020
by
Victor Zverovich
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Simplify dynamic store
parent
9f70fc3e
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
26 deletions
+9
-26
include/fmt/core.h
include/fmt/core.h
+9
-26
No files found.
include/fmt/core.h
View file @
026f9917
...
...
@@ -1206,14 +1206,6 @@ inline basic_format_arg<Context> make_arg(const T& value) {
return
make_arg
<
Context
>
(
value
);
}
template
<
typename
T
,
typename
Char
>
struct
is_string_view
:
std
::
false_type
{};
template
<
typename
Char
>
struct
is_string_view
<
basic_string_view
<
Char
>
,
Char
>
:
std
::
true_type
{};
template
<
typename
Char
>
struct
is_string_view
<
std_string_view
<
Char
>
,
Char
>
:
std
::
true_type
{};
template
<
typename
T
>
struct
is_reference_wrapper
:
std
::
false_type
{};
template
<
typename
T
>
...
...
@@ -1233,31 +1225,21 @@ class dyn_arg_storage {
T
value
;
template
<
typename
Arg
>
FMT_CONSTEXPR
storage_node
(
const
Arg
&
arg
,
owning_ptr
&&
next
)
:
value
(
arg
)
{
this
->
next
=
std
::
move
(
next
);
// Must be initialised after value.
}
FMT_CONSTEXPR
storage_node
(
const
Arg
&
arg
)
:
value
(
arg
)
{}
template
<
typename
Char
>
FMT_CONSTEXPR
storage_node
(
const
basic_string_view
<
Char
>&
arg
,
owning_ptr
&&
next
)
:
value
(
arg
.
data
(),
arg
.
size
())
{
this
->
next
=
std
::
move
(
next
);
// Must be initialised after value.
}
FMT_CONSTEXPR
storage_node
(
const
basic_string_view
<
Char
>&
arg
)
:
value
(
arg
.
data
(),
arg
.
size
())
{}
};
storage_node_base
<>::
owning_ptr
head_
{
nullptr
}
;
storage_node_base
<>::
owning_ptr
head_
;
public:
dyn_arg_storage
()
=
default
;
dyn_arg_storage
(
const
dyn_arg_storage
&
)
=
delete
;
dyn_arg_storage
(
dyn_arg_storage
&&
)
=
default
;
dyn_arg_storage
&
operator
=
(
const
dyn_arg_storage
&
)
=
delete
;
dyn_arg_storage
&
operator
=
(
dyn_arg_storage
&&
)
=
default
;
template
<
typename
T
,
typename
Arg
>
const
T
&
push
(
const
Arg
&
arg
)
{
auto
node
=
new
storage_node
<
T
>
(
arg
,
std
::
move
(
head_
));
auto
next
=
std
::
move
(
head_
);
auto
node
=
new
storage_node
<
T
>
(
arg
);
head_
.
reset
(
node
);
head_
->
next
=
std
::
move
(
next
);
return
node
->
value
;
}
};
...
...
@@ -1396,7 +1378,8 @@ class dynamic_format_arg_store
using
type
=
std
::
integral_constant
<
bool
,
!
(
internal
::
is_reference_wrapper
<
T
>::
value
||
internal
::
is_string_view
<
T
,
char_type
>::
value
||
std
::
is_same
<
T
,
basic_string_view
<
char_type
>>::
value
||
std
::
is_same
<
T
,
internal
::
std_string_view
<
char_type
>>::
value
||
(
mapped_type
!=
internal
::
type
::
cstring_type
&&
mapped_type
!=
internal
::
type
::
string_type
&&
mapped_type
!=
internal
::
type
::
custom_type
&&
...
...
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