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

Changed result_of to invoke_result for C++20 compatibility. #261

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mkloczko
Copy link
Contributor

Result_of is no longer in C++20.

@mkloczko
Copy link
Contributor Author

Oh well it did work locally.

@emil-e
Copy link
Owner

emil-e commented Nov 28, 2020

Oh well it did work locally.

That's because invoke_result is not available in C++11 and CI actually builds for C++11.

@mkloczko
Copy link
Contributor Author

mkloczko commented Nov 28, 2020

Maybe a class could be implemented that chooses either result_of or invoke_result based on C++ version using ifdefs?

@emil-e
Copy link
Owner

emil-e commented Nov 28, 2020 via email

@mkloczko
Copy link
Contributor Author

mkloczko commented Nov 28, 2020

Where could I add such a class?

@Warwolt
Copy link

Warwolt commented Dec 17, 2020

@mkloczko One alternative would be to replace all the usages of std::result_of with a macro or intermediate template and use an #ifdef inside that intermediary to select between passing the arguments to std::result_of or std::invoke_result based on the selected compiler standard.

@emil-e
Copy link
Owner

emil-e commented Dec 20, 2020

@Warwolt I don't have time to do this myself but what I would do is create a class (struct) template that inherits from the appropriate one using ifdefs.

@mkloczko
Copy link
Contributor Author

mkloczko commented Jan 2, 2021

Just in case the newer solution is in #269 (couldn't change the source branch).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants