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>
using
conditional_t
=
typename
std
::
conditional
<
B
,
T
,
F
>::
type
;
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
// shorter symbols: https://godbolt.org/z/sWw4vP. Extra parentheses are needed
// to workaround a bug in MSVC 2019 (see #1140 and #1186).
...
...
@@ -844,8 +846,9 @@ template <typename Context> class basic_format_arg {
const
T
&
value
);
template
<
typename
Visitor
,
typename
Ctx
>
friend
FMT_CONSTEXPR
auto
visit_format_arg
(
Visitor
&&
vis
,
const
basic_format_arg
<
Ctx
>&
arg
)
->
decltype
(
vis
(
0
));
friend
FMT_CONSTEXPR
auto
visit_format_arg
(
Visitor
&&
vis
,
const
basic_format_arg
<
Ctx
>&
arg
)
->
decltype
(
vis
(
0
));
friend
class
basic_format_args
<
Context
>
;
friend
class
internal
::
arg_map
<
Context
>
;
...
...
@@ -877,8 +880,6 @@ template <typename Context> class basic_format_arg {
bool
is_arithmetic
()
const
{
return
internal
::
is_arithmetic
(
type_
);
}
};
struct
monostate
{};
/**
\rst
Visits an argument dispatching to the appropriate visit method based on
...
...
@@ -887,8 +888,9 @@ struct monostate {};
\endrst
*/
template
<
typename
Visitor
,
typename
Context
>
FMT_CONSTEXPR
auto
visit_format_arg
(
Visitor
&&
vis
,
const
basic_format_arg
<
Context
>&
arg
)
->
decltype
(
vis
(
0
))
{
FMT_CONSTEXPR
auto
visit_format_arg
(
Visitor
&&
vis
,
const
basic_format_arg
<
Context
>&
arg
)
->
decltype
(
vis
(
0
))
{
using
char_type
=
typename
Context
::
char_type
;
switch
(
arg
.
type_
)
{
case
internal
:
:
none_type
:
...
...
@@ -926,8 +928,9 @@ FMT_CONSTEXPR auto visit_format_arg(
}
template
<
typename
Visitor
,
typename
Context
>
FMT_DEPRECATED
FMT_CONSTEXPR
auto
visit
(
Visitor
&&
vis
,
const
basic_format_arg
<
Context
>&
arg
)
->
decltype
(
vis
(
0
))
{
FMT_DEPRECATED
FMT_CONSTEXPR
auto
visit
(
Visitor
&&
vis
,
const
basic_format_arg
<
Context
>&
arg
)
->
decltype
(
vis
(
0
))
{
return
visit_format_arg
(
std
::
forward
<
Visitor
>
(
vis
),
arg
);
}
...
...
@@ -950,7 +953,7 @@ template <typename Context> class arg_map {
void
push_back
(
value
<
Context
>
val
)
{
const
auto
&
named
=
*
val
.
named_arg
;
map_
[
size_
]
=
entry
{
named
.
name
,
named
.
template
deserialize
<
Context
>()};
map_
[
size_
]
=
{
named
.
name
,
named
.
template
deserialize
<
Context
>()};
++
size_
;
}
...
...
@@ -980,12 +983,11 @@ class locale_ref {
template
<
typename
Locale
>
Locale
get
()
const
;
};
template
<
typename
Context
,
typename
T
>
struct
get_type
{
static
const
type
value
=
type_constant
<
decltype
(
arg_mapper
<
Context
>
().
map
(
std
::
declval
<
typename
std
::
remove_volatile
<
T
>::
type
>
())),
typename
Context
::
char_type
>::
value
;
};
template
<
typename
Context
,
typename
T
>
using
get_type
=
type_constant
<
decltype
(
arg_mapper
<
Context
>
().
map
(
std
::
declval
<
typename
std
::
remove_volatile
<
T
>::
type
>
())),
typename
Context
::
char_type
>
;
template
<
typename
Context
>
constexpr
unsigned
long
long
get_types
()
{
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