ccia_code_samples icon indicating copy to clipboard operation
ccia_code_samples copied to clipboard

`std::result_of` deprecation

Open ITHelpDec opened this issue 1 year ago • 0 comments

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

ITHelpDec avatar Apr 23 '23 19:04 ITHelpDec