From: Hannes Roth Date: Tue, 11 Aug 2015 23:11:59 +0000 (-0700) Subject: (Wangle) Use perfect forwarding for LambdaBufHelper X-Git-Tag: v0.54.0~16 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=1e06e1dbc68fec05e415ca1fe3380fd01be6b90d;p=folly.git (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 --- 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));