I'm basically trying do do this:
using Type = SomeTypeThatIWantToMove;
std::promise<Type> promised_result;
std::future<Type> promised_future = promised_result.get_future();
using Callback = std::function<void()>;
Callback function_which_should_be_movable =
[this, future_result(std::move(promised_future))]() mutable
{
this->some_function(future_result.get()); // signature: void some_function(const Type&)
};
using ResultBuilder = std::function<Type(Callback&&)>;
// result_builder is of type ResultBuilder
Type thingy = result_builder(std::move(function_which_should_be_movable));
MinGW tell me, that the Move-Constructor of function_which_should_be_movable is deleted, because the Copy-constructor of std::future is deleted. However, I don't see why the compiler would attempt to copy the future instead of moving it.