template <class T, class VecT>
struct CollectContextHelper<T, VecT,
typename std::enable_if<std::is_same<T, VecT>::value>::type> {
- static inline std::vector<T>& getResults(std::vector<VecT>& results) {
- return results;
+ static inline std::vector<T>&& getResults(std::vector<VecT>& results) {
+ return std::move(results);
}
};
EXPECT_THROW(allf.value(), eggs_t);
}
+
+ // move only compiles
+ {
+ vector<Promise<unique_ptr<int>>> promises(10);
+ vector<Future<unique_ptr<int>>> futures;
+
+ for (auto& p : promises)
+ futures.push_back(p.getFuture());
+
+ collect(futures.begin(), futures.end());
+ }
+
}
struct NotDefaultConstructible {