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
template <typename F>
class LambdaBufHelper {
public:
- explicit LambdaBufHelper(F&& func) : func_(std::forward<F>(func)) {}
+ template <typename FF>
+ explicit LambdaBufHelper(FF&& func) : func_(std::forward<FF>(func)) {}
void operator()(Try<T>&& t) {
SCOPE_EXIT { this->~LambdaBufHelper(); };
func_(std::move(t));