From 7f413ec31d3c7ad9cde6f5fe4ec06d9ee6b758b2 Mon Sep 17 00:00:00 2001 From: James Sedgwick Date: Thu, 30 Apr 2015 13:13:55 -0700 Subject: [PATCH] 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 --- folly/futures/helpers.h | 3 ++- folly/futures/test/FutureTest.cpp | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) 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; }); -- 2.34.1