diff --git a/3rd_party/include/opentracing/variant/variant.hpp b/3rd_party/include/opentracing/variant/variant.hpp index 7b6bb47..8f2db96 100644 --- a/3rd_party/include/opentracing/variant/variant.hpp +++ b/3rd_party/include/opentracing/variant/variant.hpp @@ -167,7 +167,11 @@ struct enable_if_type template struct result_of_unary_visit { +#if (defined(__cplusplus) && __cplusplus >= 201703L) + using type = typename std::invoke_result::type; +#else using type = typename std::result_of::type; +#endif }; template @@ -179,7 +183,11 @@ struct result_of_unary_visit struct result_of_binary_visit { +#if (defined(__cplusplus) && __cplusplus >= 201703L) + using type = typename std::invoke_result::type; +#else using type = typename std::result_of::type; +#endif }; template diff --git a/CMakeLists.txt b/CMakeLists.txt index a451844..483a1a3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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 \