From: James Sedgwick Date: Thu, 30 Apr 2015 20:13:55 +0000 (-0700) Subject: fix return type for map X-Git-Tag: v0.38.0~28 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=7f413ec31d3c7ad9cde6f5fe4ec06d9ee6b758b2;p=folly.git fix return type for map 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 --- diff --git a/folly/futures/helpers.h b/folly/futures/helpers.h index 7fd79508..c39d6686 100644 --- a/folly/futures/helpers.h +++ b/folly/futures/helpers.h @@ -58,7 +58,8 @@ namespace futures { */ template ::value_type, - class Result = decltype(std::declval().then(std::declval()))> + class Result + = typename decltype(std::declval().then(std::declval()))::value_type> std::vector> map(It first, It last, F func); // Sugar for the most common case diff --git a/folly/futures/test/FutureTest.cpp b/folly/futures/test/FutureTest.cpp index da3e1c5c..5b7be306 100644 --- a/folly/futures/test/FutureTest.cpp +++ b/folly/futures/test/FutureTest.cpp @@ -1765,7 +1765,7 @@ TEST(Map, Basic) { fs.push_back(p3.getFuture()); int c = 0; - auto fs2 = futures::map(fs, [&](int i){ + std::vector> fs2 = futures::map(fs, [&](int i){ c += i; });