Skip to content

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