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
32544b61
Commit
32544b61
authored
Jun 11, 2019
by
Victor Zverovich
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
More cleanup
parent
39f522a1
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
13 deletions
+14
-13
include/fmt/core.h
include/fmt/core.h
+7
-13
include/fmt/format.h
include/fmt/format.h
+7
-0
No files found.
include/fmt/core.h
View file @
32544b61
...
...
@@ -1094,9 +1094,10 @@ template <typename Context, typename... Args> class format_arg_store {
friend
class
basic_format_args
<
Context
>
;
public:
static
constexpr
unsigned
long
long
TYPES
=
static
constexpr
unsigned
long
long
types
=
is_packed
?
internal
::
encode_types
<
Context
,
Args
...
>
()
:
internal
::
is_unpacked_bit
|
num_args
;
FMT_DEPRECATED
static
constexpr
unsigned
long
long
TYPES
=
types
;
format_arg_store
(
const
Args
&
...
args
)
:
data_
{
internal
::
make_arg
<
is_packed
,
Context
>
(
args
)...}
{}
...
...
@@ -1173,7 +1174,7 @@ template <typename Context> class basic_format_args {
*/
template
<
typename
...
Args
>
basic_format_args
(
const
format_arg_store
<
Context
,
Args
...
>&
store
)
:
types_
(
static_cast
<
unsigned
long
long
>
(
store
.
TYPES
))
{
:
types_
(
static_cast
<
unsigned
long
long
>
(
store
.
types
))
{
set_data
(
store
.
data_
);
}
...
...
@@ -1206,23 +1207,16 @@ template <typename Context> class basic_format_args {
// It is a separate type rather than an alias to make symbols readable.
struct
format_args
:
basic_format_args
<
format_context
>
{
template
<
typename
...
Args
>
format_args
(
Args
&&
...
arg
)
:
basic_format_args
<
format_context
>
(
std
::
forward
<
Args
>
(
arg
)...)
{}
format_args
(
Args
&&
...
arg
s
)
:
basic_format_args
<
format_context
>
(
std
::
forward
<
Args
>
(
arg
s
)...)
{}
};
struct
wformat_args
:
basic_format_args
<
wformat_context
>
{
template
<
typename
...
Args
>
wformat_args
(
Args
&&
...
arg
)
:
basic_format_args
<
wformat_context
>
(
std
::
forward
<
Args
>
(
arg
)...)
{}
wformat_args
(
Args
&&
...
arg
s
)
:
basic_format_args
<
wformat_context
>
(
std
::
forward
<
Args
>
(
arg
s
)...)
{}
};
namespace
internal
{
template
<
typename
Context
>
FMT_CONSTEXPR
typename
Context
::
format_arg
get_arg
(
Context
&
ctx
,
unsigned
id
)
{
auto
arg
=
ctx
.
arg
(
id
);
if
(
!
arg
)
ctx
.
on_error
(
"argument index out of range"
);
return
arg
;
}
template
<
typename
Char
>
struct
named_arg_base
{
basic_string_view
<
Char
>
name
;
...
...
include/fmt/format.h
View file @
32544b61
...
...
@@ -1737,6 +1737,13 @@ FMT_CONSTEXPR void set_dynamic_spec(T& value, FormatArg arg, ErrorHandler eh) {
struct
auto_id
{};
template
<
typename
Context
>
FMT_CONSTEXPR
typename
Context
::
format_arg
get_arg
(
Context
&
ctx
,
unsigned
id
)
{
auto
arg
=
ctx
.
arg
(
id
);
if
(
!
arg
)
ctx
.
on_error
(
"argument index out of range"
);
return
arg
;
}
// The standard format specifier handler with checking.
template
<
typename
ParseContext
,
typename
Context
>
class
specs_handler
:
public
specs_setter
<
typename
Context
::
char_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