C++20 compatibility for library users / std::result_of removed
As a library user, i would like to compile my code using the C++20 standard.
But in /3rd_party/include/opentracing/variant/variant.hpp' the std::result_of<>` template is used:
This template was removed in C++20: see https://en.cppreference.com/w/cpp/types/result_of
std::invoke_result<> can be used as an drop in replacement.
To make the code still compile in C++ versions below C++17 the code can use
__cpp_lib_is_invocable (https://en.cppreference.com/w/cpp/feature_test) to different
e. g.
template <typename F, typename V, typename Enable = void>
struct result_of_unary_visit
{
#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, typename Enable = void>
struct result_of_binary_visit
{
#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
};
I would also greatly appreciate this change.
Any progress???
@perseoGI This project is no longer maintained https://github.com/opentracing/specification/issues/163
@yurishkuro: The deprecation notice is quite well-hidden in the current GitHub UI, maybe add it to readme or set the repository to archived/read-only?