std::function is copyable, the standard requires that callables used to construct it also be copyable:
template<class F> function(F f);
Fshall be CopyConstructible.
fshall be Callable (126.96.36.199) for argument types
ArgTypesand return type
R. The copy constructor and destructor of A shall not throw exceptions.`
This implies that it is not possible to form an
std::function from a non-copyable bind object or a lambda that captured a move-only type such as
It seems possible to implement such a move-only wrapper for move-only callables. Is there a standard library move-only equivalent for
std::function or, is there a common workaround for this problem?