opentracing / opentracing-cpp

OpenTracing API for C++. 🛑 This library is DEPRECATED! https://github.com/opentracing/specification/issues/163
http://opentracing.io
Apache License 2.0
320 stars 115 forks source link

C++20 compatibility for library users / std::result_of removed #144

Open xgcssch opened 2 years ago

xgcssch commented 2 years ago

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' thestd::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
            };
perseoGI commented 1 year ago

I would also greatly appreciate this change.

perseoGI commented 9 months ago

Any progress???

Oberon00 commented 9 months ago

@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?