-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
EAC-3238 remove use of deprecated C++17 features #17
EAC-3238 remove use of deprecated C++17 features #17
Conversation
std::result_off is deprecated in c++ 17 and removed in c++20, it has been replaced with std::invoke_result.
Changes include: * Set C++ version once in head file (only used for tests and examples) * Make a new tests and examples target to build all conveniently * Add compile commands for ninja and cmake generators * Bump C++ version for tests and examples to c++ 17
@jstinson-te Do we need to continue to support C++14? |
I believe this library is potentially in use by other projects so I was being cautious. @ggeorgalis are you able to comment on this. Happy to throw away the C++14 support if it is not needed. |
Discussed with @ggeorgalis 1-to-1, we decided that c++14 support is required as there are other teams that use this. Also, this change was proposed before, see #16 this approach is essentially the same, however I believe my macro is more robust to determine the C++ version. |
CI is broken due to an archived repo which has a bad label reference, see https://github.com/thousandeyes/conan-thousandeyes-futures |
Discussed briefly with @ggeorgalis & @jerriley-te and we agreed to merged. |
The
std::result_of
has been deprecated in C++17 and has been completely removed in C++20.This PR detects the C++17 and uses the
std::invoke_result
when the detected C++ version is high enough.This should resolve issues like the following seen on Windows,
Testing
Mac
Built tests and examples with C++17 and C++14, adding a compile time message to prove the correct code macro was compiled. Tests pass with no issues.
Windows
Built tests and examples with C++17 and C++14, adding a compile time message to prove the correct code macro was compiled. Tests pass with no issues.
As a library
Exported the library on Mac and built against the library with no issues.
Exported the library on Windows and built against the library with no issues. Also ran gtest tests as a sanity check, it passed without issues.