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

fix: use std::invoke_result instead of std::result_of #143

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
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
8 changes: 8 additions & 0 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
{
#if (defined(__cplusplus) && __cplusplus >= 201703L)
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
{
#if (defined(__cplusplus) && __cplusplus >= 201703L)
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
9 changes: 8 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,14 @@ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/output)
# ==============================================================================
# Configure compilers

set(CMAKE_CXX_STANDARD 11)
include(CheckCXXCompilerFlag)
CHECK_CXX_COMPILER_FLAG("-std=c++17" COMPILER_SUPPORTS_CXX17)
if(COMPILER_SUPPORTS_CXX17)
set(CMAKE_CXX_STANDARD 17)
else()
set(CMAKE_CXX_STANDARD 11)
endif()

if ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Weverything \
-Wno-c++98-compat \
Expand Down