Skip to content
This repository has been archived by the owner on Jan 26, 2024. It is now read-only.

Replace std::result_of with std::invoke_result for C++17 compiles #145

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions 3rd_party/include/opentracing/variant/variant.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,11 @@ struct enable_if_type
template <typename F, typename V, typename Enable = void>
struct result_of_unary_visit
{
using type = typename std::result_of<F(V&)>::type;
#ifdef __cpp_lib_is_invocable
using type = typename std::invoke_result<F, V&>::type;
#else
using type = typename std::result_of<F(V&)>::type;
#endif
};

template <typename F, typename V>
Expand All @@ -179,7 +183,11 @@ struct result_of_unary_visit<F, V, typename enable_if_type<typename F::result_ty
template <typename F, typename V, typename Enable = void>
struct result_of_binary_visit
{
using type = typename std::result_of<F(V&, V&)>::type;
#ifdef __cpp_lib_is_invocable
using type = typename std::invoke_result<F, V&, V&>::type;
#else
using type = typename std::result_of<F(V&, V&)>::type;
#endif
};

template <typename F, typename V>
Expand Down