*
* auto args = std::make_tuple(1, false);
* int res = apply(foo, args);
- * @encode
+ * @endcode
**/
template <class F, class Tuple>
constexpr auto apply(F&& f, Tuple&& t)
[](TaskUnion& buffer, Args... args) -> R {
// Delete F when we go out of scope:
std::unique_ptr<F> code(*reinterpret_cast<F**>(&buffer));
- (*code)(std::forward<Args>(args)...);
+ return (*code)(std::forward<Args>(args)...);
},
// Destroy:
[](TaskUnion& buffer) {