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
406e632b
Commit
406e632b
authored
May 31, 2019
by
Victor Zverovich
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
result_of -> invoke_result_t
parent
49f78a42
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
11 deletions
+8
-11
include/fmt/core.h
include/fmt/core.h
+8
-11
No files found.
include/fmt/core.h
View file @
406e632b
...
...
@@ -215,18 +215,15 @@ using std_string_view = std::experimental::basic_string_view<Char>;
template
<
typename
T
>
struct
std_string_view
{};
#endif
template
<
typename
>
struct
result_of
;
#if (__cplusplus >= 201703L || \
(defined(_MSVC_LANG) && _MSVC_LANG >= 201703L)) && \
__cpp_lib_is_invocable >= 201703L
template
<
typename
F
,
typename
...
Args
>
struct
result_of
<
F
(
Args
...)
>
:
std
::
invoke_result
<
F
,
Args
...
>
{}
;
using
invoke_result_t
=
std
::
invoke_result_t
<
F
,
Args
...
>
;
#else
// A
workaround for gcc 4.4 that doesn't allow F to be a reference
.
// A
n implementation of invoke_result for pre-C++17
.
template
<
typename
F
,
typename
...
Args
>
struct
result_of
<
F
(
Args
...)
>
:
std
::
result_of
<
typename
std
::
remove_reference
<
F
>::
type
(
Args
...)
>
{};
using
invoke_result_t
=
typename
std
::
result_of
<
F
(
Args
...)
>::
type
;
#endif
// Casts nonnegative integer to unsigned.
...
...
@@ -906,8 +903,8 @@ template <typename Context> class basic_format_arg {
const
T
&
value
);
template
<
typename
Visitor
,
typename
Ctx
>
friend
FMT_CONSTEXPR
typename
internal
::
result_of
<
Visitor
(
int
)
>::
type
visit_format_arg
(
Visitor
&&
vis
,
const
basic_format_arg
<
Ctx
>&
arg
);
friend
FMT_CONSTEXPR
internal
::
invoke_result_t
<
Visitor
,
int
>
visit_format_arg
(
Visitor
&&
vis
,
const
basic_format_arg
<
Ctx
>&
arg
);
friend
class
basic_format_args
<
Context
>
;
friend
class
internal
::
arg_map
<
Context
>
;
...
...
@@ -949,7 +946,7 @@ struct monostate {};
\endrst
*/
template
<
typename
Visitor
,
typename
Context
>
FMT_CONSTEXPR
typename
internal
::
result_of
<
Visitor
(
int
)
>::
type
visit_format_arg
(
FMT_CONSTEXPR
internal
::
invoke_result_t
<
Visitor
,
int
>
visit_format_arg
(
Visitor
&&
vis
,
const
basic_format_arg
<
Context
>&
arg
)
{
typedef
typename
Context
::
char_type
char_type
;
switch
(
arg
.
type_
)
{
...
...
@@ -988,8 +985,8 @@ FMT_CONSTEXPR typename internal::result_of<Visitor(int)>::type visit_format_arg(
}
template
<
typename
Visitor
,
typename
Context
>
FMT_DEPRECATED
FMT_CONSTEXPR
typename
internal
::
result_of
<
Visitor
(
int
)
>::
type
visit
(
Visitor
&&
vis
,
const
basic_format_arg
<
Context
>&
arg
)
{
FMT_DEPRECATED
FMT_CONSTEXPR
internal
::
invoke_result_t
<
Visitor
,
int
>
visit
(
Visitor
&&
vis
,
const
basic_format_arg
<
Context
>&
arg
)
{
return
visit_format_arg
(
std
::
forward
<
Visitor
>
(
vis
),
arg
);
}
...
...
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