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

std::result_of deprecation #30

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

Conversation

ITHelpDec
Copy link

Suggestion

See here for reasons why std::invoke_result_t is to be used over std::result_of<>::type.

Code also amended functionally to make the template variadic (whitespace and naming amendments preferential and optional).

At the very least, lines 3 and 6 need to be amended to include typename in order to compile.

Line 3

std::future<std::result_of<F(A&&)>::type>
std::future<typename std::result_of<F(A&&)>::type>

Line 6

typedef std::result_of<F(A&&)>::type result_type;
typedef typename std::result_of<F(A&&)>::type result_type;

Tested in Xcode 14.3

See [here](https://en.cppreference.com/w/cpp/types/result_of#Notes) for reasons why `std::invoke_result_t` is to be used over `std::result_of<>::type`.

Code also amended functionally to make the template variadic (whitespace and naming amendments preferential and optional).

At the very least, lines 3 and 6 need to be amended to include `typename` in order to compile.

.:. Line 3 .:.
std::future<std::result_of<F(A&&)>::type>
std::future<typename std::result_of<F(A&&)>::type>

.:. Line 6 .:.
typedef std::result_of<F(A&&)>::type result_type;
typedef typename std::result_of<F(A&&)>::type result_type;
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.

1 participant