fix return type for map
authorJames Sedgwick <jsedgwick@fb.com>
Thu, 30 Apr 2015 20:13:55 +0000 (13:13 -0700)
committerPraveen Kumar Ramakrishnan <praveenr@fb.com>
Tue, 12 May 2015 00:01:36 +0000 (17:01 -0700)
Summary:
facepalm

Test Plan: unit

Reviewed By: hans@fb.com

Subscribers: folly-diffs@, jsedgwick, yfeldblum, chalfant

FB internal diff: D2036523

Tasks: 6925951

Signature: t1:2036523:1430423049:b69ace0256eeacdd43490465dc1c862f054a0098

folly/futures/helpers.h
folly/futures/test/FutureTest.cpp

index 7fd7950851b2b4eb32828255d246bb5cef15e8f9..c39d6686f01f8e6360e9627b54133bc98944ca4b 100644 (file)
@@ -58,7 +58,8 @@ namespace futures {
    */
   template <class It, class F,
             class ItT = typename std::iterator_traits<It>::value_type,
-            class Result = decltype(std::declval<ItT>().then(std::declval<F>()))>
+            class Result
+      = typename decltype(std::declval<ItT>().then(std::declval<F>()))::value_type>
   std::vector<Future<Result>> map(It first, It last, F func);
 
   // Sugar for the most common case
index da3e1c5cd17d323e0a6af8696657354b732b2087..5b7be30673253d72ae4c64d6a9435c305191f441 100644 (file)
@@ -1765,7 +1765,7 @@ TEST(Map, Basic) {
   fs.push_back(p3.getFuture());
 
   int c = 0;
-  auto fs2 = futures::map(fs, [&](int i){
+  std::vector<Future<void>> fs2 = futures::map(fs, [&](int i){
     c += i;
   });