Closed daniel-j-h closed 11 years ago
Is there a reason the enqueue function doesn't capture the type-deduced function as universal reference? E.g.:
template<typename Function> auto enqueue(Function&& f) -> std::future<decltype(std::forward<F>(f)())>;
This would allows us to std::forward(f) later on, preserving the rvalue/lvalue type.
This should handle situations nicely where we enqueue
Sorry for the lat answer, I was stuck in the military for a few weeks... The only reason is my still limited knowledge of C++11 ;). I incorporated this in the develop branch.
Is there a reason the enqueue function doesn't capture the type-deduced function as universal reference? E.g.:
This would allows us to std::forward(f) later on, preserving the rvalue/lvalue type.
This should handle situations nicely where we enqueue