Date
2016-11-01.19:58:26
Message id
8490

Content

The definition of the call_wrapper type in the C++17 CD means this fails to compile:

#include <functional>

struct abc { virtual void f() const = 0; };
struct derived : abc { void f() const { } };
struct F { bool operator()(abc&) { return false; } };
derived d;
bool b = std::not_fn(F{})(static_cast<abc&&>(d));

The problem is that the return types use result_of_t<F(abc)> and F(abc) is not a valid function type, because it takes an abstract class by value.

The return types should use result_of_t<F(Args&&...)> instead.