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

Replace std::result_of with std::invoke_result #392

Merged
merged 5 commits into from
Dec 16, 2020
Merged

Replace std::result_of with std::invoke_result #392

merged 5 commits into from
Dec 16, 2020

Conversation

Friendly0Fire
Copy link
Contributor

C++17 deprecates std::result_of<T> and C++20 completely removes it from the spec in favor of std::invoke_result<T>, preventing compilation of g3log if using C++20-level features.

This is the simplest fix which merely replaces all instances of the former with the latter, but it will break compilation on C++14 or older. It would also be possible to make an alias of these templates and use macro compile flags to preserve compatibility with C++14, but I wasn't sure if that would be necessary.

I also took the liberty to use the *_t declarations which are much less verbose.

@Friendly0Fire Friendly0Fire changed the title Replaced result_of with invoke_result_t. Replace std::result_of with std::invoke_result Dec 6, 2020
@KjellKod
Copy link
Owner

KjellKod commented Dec 6, 2020

Thanks. Before I merge this I need to creat a branch and release for “last release with C++14 support”.

On your end, please update the CI configuration to work with your changes. Once the tests are working I’ll review this PR

@Friendly0Fire Friendly0Fire marked this pull request as draft December 6, 2020 17:17
@Friendly0Fire Friendly0Fire marked this pull request as ready for review December 6, 2020 17:54
@Friendly0Fire
Copy link
Contributor Author

Any idea when this can be merged?

@KjellKod
Copy link
Owner

Thanks for the reminder. I’ve planned to create the release w/tagging and review and this this PR this ongoing week

Copy link
Owner

@KjellKod KjellKod left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Kick ass change. Just one tiny file removal and it should be good to go (pending my testing)

@@ -0,0 +1,7 @@
{
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please remove this file

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done!

@KjellKod KjellKod merged commit e28f559 into KjellKod:master Dec 16, 2020
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.

2 participants