You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
One possible approach is to backport std::result_of into nostd::result_of
The other implementation approach is to rework this code to completely avoid the construct.
Visual Studio 2019 compiler takes very strict stance on removed features. There's also a temporary workaround flag that allows to enable deprecated features ( _HAS_DEPRECATED_RESULT_OF ). But I believe it is incorrect for common SDK API header to rely on a feature that's been permanently removed from C++ standard.
I also tested this to confirm that recent gcc-9 and clang-10 are both OK with that deprecated construct, even if a module is compiled in C++20 mode.. But what Visual C++ is doing (not supporting removed features) - seems like the right thing to do.
The text was updated successfully, but these errors were encountered:
I can take a look at it. I hit it when I've been experimenting to measure perf of STL vs nostd, plus verifying ABI compat with different compiler standard flags.
maxgolov
changed the title
function_ref.h implementation uses a feature that's been REMOVED in C++20
function_ref.h implementation uses a feature that's removed in C++20
Jun 11, 2020
This code would no longer compile in strict mode with C++20 enabled in Visual Studio 2019 (16.6.2, tools v142):
opentelemetry-cpp/api/include/opentelemetry/nostd/function_ref.h
Line 66 in 9e5924c
std::result_of has been permanently removed in C++20. Reference:
https://en.cppreference.com/w/cpp/types/result_of
Implementation needs to be rewritten.
One possible approach is to backport std::result_of into nostd::result_of
The other implementation approach is to rework this code to completely avoid the construct.
Visual Studio 2019 compiler takes very strict stance on removed features. There's also a temporary workaround flag that allows to enable deprecated features ( _HAS_DEPRECATED_RESULT_OF ). But I believe it is incorrect for common SDK API header to rely on a feature that's been permanently removed from C++ standard.
I also tested this to confirm that recent gcc-9 and clang-10 are both OK with that deprecated construct, even if a module is compiled in C++20 mode.. But what Visual C++ is doing (not supporting removed features) - seems like the right thing to do.
The text was updated successfully, but these errors were encountered: