From d2c954b7c80b7c63880c3fde55028c169f553239 Mon Sep 17 00:00:00 2001 From: James Sedgwick Date: Fri, 17 Apr 2015 08:45:58 -0700 Subject: [PATCH] fix collect for non-default-constructible types Summary: as above Test Plan: compile Reviewed By: agoder@fb.com Subscribers: folly-diffs@, jsedgwick, yfeldblum, chalfant FB internal diff: D1999218 Signature: t1:1999218:1429217794:0278955bb471fe73a14ccedb59eae80b98acdbf3 --- folly/futures/Future-inl.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/folly/futures/Future-inl.h b/folly/futures/Future-inl.h index abcfcb86..7a2ffc2b 100644 --- a/folly/futures/Future-inl.h +++ b/folly/futures/Future-inl.h @@ -586,9 +586,8 @@ namespace detail { template struct CollectContext { - explicit CollectContext(int n) : count(0), threw(false) { - results.resize(n); - } + explicit CollectContext(int n) : count(0), threw(false) {} + Promise> p; std::vector results; std::atomic count; -- 2.34.1