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 usage of std::result_of with std::invoke_result #8037

Merged

Conversation

thomasspriggs
Copy link
Collaborator

@thomasspriggs thomasspriggs commented Nov 14, 2023

C++17 deprecates std::result_of in favour of std::invoke_result. Updating our code to use the replacement avoids the use of the deprecated version.

  • Each commit message has a non-empty body, explaining why the change was made.
  • Methods or procedures I have added are documented, following the guidelines provided in CODING_STANDARD.md.
  • The feature or user visible behaviour I have added or modified has been documented in the User Guide in doc/cprover-manual/
  • Regression or unit tests are included, or existing tests cover the modified code (in this case I have detailed which ones those are in the commit message).
  • My commit message includes data points confirming performance improvements (if claimed).
  • My PR is restricted to a single feature or bugfix.
  • White-space or formatting changes outside the feature-related changed lines are in commits of their own.

Because infering the return type from the template parameters is a
sizeable portion of the function implementation. So using an `auto` type
tells the compiler that the type is in the return statement and saves us
duplicating the same work in two places.
C++17 deprecates `std::result_of` in favour of `std::invoke_result`.
Updating our code to use the replacement avoids the use of the
reprecated version.
@esteffin esteffin added the Version 6 Pull requests and issues requiring a major version bump label Nov 14, 2023
Copy link

codecov bot commented Nov 14, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (ea77c96) 79.09% compared to head (bd69bdb) 79.09%.

Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #8037   +/-   ##
========================================
  Coverage    79.09%   79.09%           
========================================
  Files         1699     1699           
  Lines       196508   196508           
========================================
  Hits        155430   155430           
  Misses       41078    41078           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@thomasspriggs thomasspriggs merged commit 74075ec into diffblue:develop Nov 15, 2023
36 checks passed
@thomasspriggs thomasspriggs deleted the tas/result_of_deprecated branch November 15, 2023 00:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Version 6 Pull requests and issues requiring a major version bump
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants