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
afdbbac7
Commit
afdbbac7
authored
Jun 10, 2019
by
Victor Zverovich
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cleanup
parent
e33fe14f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
15 deletions
+17
-15
include/fmt/core.h
include/fmt/core.h
+17
-15
No files found.
include/fmt/core.h
View file @
afdbbac7
...
@@ -197,6 +197,8 @@ template <bool B, class T, class F>
...
@@ -197,6 +197,8 @@ template <bool B, class T, class F>
using
conditional_t
=
typename
std
::
conditional
<
B
,
T
,
F
>::
type
;
using
conditional_t
=
typename
std
::
conditional
<
B
,
T
,
F
>::
type
;
template
<
bool
B
>
using
bool_constant
=
std
::
integral_constant
<
bool
,
B
>
;
template
<
bool
B
>
using
bool_constant
=
std
::
integral_constant
<
bool
,
B
>
;
struct
monostate
{};
// An enable_if helper to be used in template parameters which results in much
// An enable_if helper to be used in template parameters which results in much
// shorter symbols: https://godbolt.org/z/sWw4vP. Extra parentheses are needed
// shorter symbols: https://godbolt.org/z/sWw4vP. Extra parentheses are needed
// to workaround a bug in MSVC 2019 (see #1140 and #1186).
// to workaround a bug in MSVC 2019 (see #1140 and #1186).
...
@@ -844,8 +846,9 @@ template <typename Context> class basic_format_arg {
...
@@ -844,8 +846,9 @@ template <typename Context> class basic_format_arg {
const
T
&
value
);
const
T
&
value
);
template
<
typename
Visitor
,
typename
Ctx
>
template
<
typename
Visitor
,
typename
Ctx
>
friend
FMT_CONSTEXPR
auto
visit_format_arg
(
friend
FMT_CONSTEXPR
auto
visit_format_arg
(
Visitor
&&
vis
,
Visitor
&&
vis
,
const
basic_format_arg
<
Ctx
>&
arg
)
->
decltype
(
vis
(
0
));
const
basic_format_arg
<
Ctx
>&
arg
)
->
decltype
(
vis
(
0
));
friend
class
basic_format_args
<
Context
>
;
friend
class
basic_format_args
<
Context
>
;
friend
class
internal
::
arg_map
<
Context
>
;
friend
class
internal
::
arg_map
<
Context
>
;
...
@@ -877,8 +880,6 @@ template <typename Context> class basic_format_arg {
...
@@ -877,8 +880,6 @@ template <typename Context> class basic_format_arg {
bool
is_arithmetic
()
const
{
return
internal
::
is_arithmetic
(
type_
);
}
bool
is_arithmetic
()
const
{
return
internal
::
is_arithmetic
(
type_
);
}
};
};
struct
monostate
{};
/**
/**
\rst
\rst
Visits an argument dispatching to the appropriate visit method based on
Visits an argument dispatching to the appropriate visit method based on
...
@@ -887,8 +888,9 @@ struct monostate {};
...
@@ -887,8 +888,9 @@ struct monostate {};
\endrst
\endrst
*/
*/
template
<
typename
Visitor
,
typename
Context
>
template
<
typename
Visitor
,
typename
Context
>
FMT_CONSTEXPR
auto
visit_format_arg
(
FMT_CONSTEXPR
auto
visit_format_arg
(
Visitor
&&
vis
,
Visitor
&&
vis
,
const
basic_format_arg
<
Context
>&
arg
)
->
decltype
(
vis
(
0
))
{
const
basic_format_arg
<
Context
>&
arg
)
->
decltype
(
vis
(
0
))
{
using
char_type
=
typename
Context
::
char_type
;
using
char_type
=
typename
Context
::
char_type
;
switch
(
arg
.
type_
)
{
switch
(
arg
.
type_
)
{
case
internal
:
:
none_type
:
case
internal
:
:
none_type
:
...
@@ -926,8 +928,9 @@ FMT_CONSTEXPR auto visit_format_arg(
...
@@ -926,8 +928,9 @@ FMT_CONSTEXPR auto visit_format_arg(
}
}
template
<
typename
Visitor
,
typename
Context
>
template
<
typename
Visitor
,
typename
Context
>
FMT_DEPRECATED
FMT_CONSTEXPR
auto
visit
(
FMT_DEPRECATED
FMT_CONSTEXPR
auto
visit
(
Visitor
&&
vis
,
Visitor
&&
vis
,
const
basic_format_arg
<
Context
>&
arg
)
->
decltype
(
vis
(
0
))
{
const
basic_format_arg
<
Context
>&
arg
)
->
decltype
(
vis
(
0
))
{
return
visit_format_arg
(
std
::
forward
<
Visitor
>
(
vis
),
arg
);
return
visit_format_arg
(
std
::
forward
<
Visitor
>
(
vis
),
arg
);
}
}
...
@@ -950,7 +953,7 @@ template <typename Context> class arg_map {
...
@@ -950,7 +953,7 @@ template <typename Context> class arg_map {
void
push_back
(
value
<
Context
>
val
)
{
void
push_back
(
value
<
Context
>
val
)
{
const
auto
&
named
=
*
val
.
named_arg
;
const
auto
&
named
=
*
val
.
named_arg
;
map_
[
size_
]
=
entry
{
named
.
name
,
named
.
template
deserialize
<
Context
>()};
map_
[
size_
]
=
{
named
.
name
,
named
.
template
deserialize
<
Context
>()};
++
size_
;
++
size_
;
}
}
...
@@ -980,12 +983,11 @@ class locale_ref {
...
@@ -980,12 +983,11 @@ class locale_ref {
template
<
typename
Locale
>
Locale
get
()
const
;
template
<
typename
Locale
>
Locale
get
()
const
;
};
};
template
<
typename
Context
,
typename
T
>
struct
get_type
{
template
<
typename
Context
,
typename
T
>
static
const
type
value
=
type_constant
<
using
get_type
=
decltype
(
arg_mapper
<
Context
>
().
map
(
type_constant
<
decltype
(
arg_mapper
<
Context
>
().
map
(
std
::
declval
<
typename
std
::
remove_volatile
<
T
>::
type
>
())),
std
::
declval
<
typename
std
::
remove_volatile
<
T
>::
type
>
())),
typename
Context
::
char_type
>::
value
;
typename
Context
::
char_type
>
;
};
template
<
typename
Context
>
constexpr
unsigned
long
long
get_types
()
{
template
<
typename
Context
>
constexpr
unsigned
long
long
get_types
()
{
return
0
;
return
0
;
...
...
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