Skip to content
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

broken build: std::result_of is removed in C++20 #1934

Closed
niclar opened this issue Mar 6, 2023 · 3 comments · Fixed by #1956
Closed

broken build: std::result_of is removed in C++20 #1934

niclar opened this issue Mar 6, 2023 · 3 comments · Fixed by #1956
Labels
bug Something isn't working

Comments

@niclar
Copy link
Contributor

niclar commented Mar 6, 2023

-Can you make the usage of the now deprecated and removed std::result_of conditional on the C++ revision. C++2x builds are now broken.

HEAD: adbed1b

@niclar niclar changed the title std::result_of is removed in C++20 broken build: std::result_of is removed in C++20 Mar 6, 2023
@elBoberido
Copy link
Member

@niclar I think this is easy to fix. It should be possible to add a language version switch in iceoryx_platform/linux/include/iceoryx_platform/platform_settings.hpp similar to what is done in iceoryx_platform/linux/include/iceoryx_platform/attributes.hpp. I might also be a good idea to move the invoke_result alias somewhere else since it is a bit out of place in platform_setting.hpp

@elfenpiff @mossmaurice Objections? Ideas?

@niclar
Copy link
Contributor Author

niclar commented Mar 7, 2023

as a temporary workaround one can override the removal as;

if(WIN32)
    add_compile_definitions(_HAS_DEPRECATED_RESULT_OF)
else()
    add_compile_definitions(_LIBCPP_ENABLE_CXX20_REMOVED_TYPE_TRAITS)
endif()

@elBoberido
Copy link
Member

@niclar sure, but we already have the machinery to use invoke_result for C++17 and above. No need to rely on deprecated functionality on newer C++ standards. We just have to do the same we did with attributes.hpp and add a language version switch. On macOS and Windows we already use std::invoke_result.

Would you like to implement this?

@elBoberido elBoberido added the bug Something isn't working label Mar 7, 2023
albtam pushed a commit to ApexAI/iceoryx that referenced this issue Apr 3, 2023
albtam pushed a commit to ApexAI/iceoryx that referenced this issue Apr 3, 2023
albtam pushed a commit to ApexAI/iceoryx that referenced this issue Apr 3, 2023
albtam pushed a commit to ApexAI/iceoryx that referenced this issue Apr 3, 2023
elBoberido added a commit that referenced this issue Apr 3, 2023
iox-#1934 Alias invoke_result to correct implementation based on C++ version
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants