- changed milestone to 2018.03.31 release
- assigned issue to
missing template - to_future
Issue #78
resolved
'to_future' seems to be missing. This code does not compile:
future<int> f[2];
future<int,int,double> result = to_future (f[0], f[1], 1.0);
Comments (6)
-
-
- changed milestone to 2017.12.31 release
-
- changed component to Compliance
- changed milestone to 2018.03.31 release
In the 1/10/18 meeting, John recommended keeping only the single-argument version and excising the variadic version from the spec.
Note related spec issue 104
-
-
assigned issue to
-
assigned issue to
-
This is what I believe is a spec-compliant implementation of
to_future()
usingmake_future()
andwhen_all()
:template<typename T> struct future_collapse { using type = future<T>; static type make(T arg) { return make_future(std::move(arg)); } }; template<typename ...T> struct future_collapse<future<T...>> { using type = future<T...>; static type make(future<T...> arg) { return std::move(arg); } }; template<typename ...Arg> auto to_future(Arg ...args) -> decltype(when_all(future_collapse<Arg>::make(args)...)) { return when_all(future_collapse<Arg>::make(args)...); }
It may need to be modified to account for John's
future1
stuff. -
- changed status to resolved
We have modified the spec to match the implementation. See spec issue 104.
- Log in to comment
Bug confirmed.
Full example:
Too late to fix for this release.