From 1e06e1dbc68fec05e415ca1fe3380fd01be6b90d Mon Sep 17 00:00:00 2001 From: Hannes Roth Date: Tue, 11 Aug 2015 16:11:59 -0700 Subject: [PATCH] (Wangle) Use perfect forwarding for LambdaBufHelper Summary: Perfect forwarding only works if the function is templated on the same type, not if the type is a class template. Discovered by @lbrandy. Reviewed By: @yfeldblum, @lbrandy Differential Revision: D2333005 --- folly/futures/detail/Core.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/folly/futures/detail/Core.h b/folly/futures/detail/Core.h index 252af04a..bca540de 100644 --- a/folly/futures/detail/Core.h +++ b/folly/futures/detail/Core.h @@ -130,7 +130,8 @@ class Core { template class LambdaBufHelper { public: - explicit LambdaBufHelper(F&& func) : func_(std::forward(func)) {} + template + explicit LambdaBufHelper(FF&& func) : func_(std::forward(func)) {} void operator()(Try&& t) { SCOPE_EXIT { this->~LambdaBufHelper(); }; func_(std::move(t)); -- 2.34.1