From f639b4542e084dd4cd5130000b63384a53f50973 Mon Sep 17 00:00:00 2001 From: James Sedgwick Date: Wed, 13 May 2015 17:37:50 -0700 Subject: [PATCH] more restrictive implicit Future construction enabling Summary: Decay so we don't try to instantiate this for attempts to copy Futures See https://www.facebook.com/groups/499316706783616/permalink/863260220389261/ Test Plan: unit Reviewed By: hans@fb.com Subscribers: hannesr, folly-diffs@, jsedgwick, yfeldblum, chalfant FB internal diff: D2062442 Signature: t1:2062442:1431551169:d1ba61537c998067ee7e6f4819f7e0817cc2e700 --- folly/futures/Future-inl.h | 3 +-- folly/futures/Future.h | 8 ++++---- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/folly/futures/Future-inl.h b/folly/futures/Future-inl.h index 62f48007..003c9c89 100644 --- a/folly/futures/Future-inl.h +++ b/folly/futures/Future-inl.h @@ -44,8 +44,7 @@ Future& Future::operator=(Future&& other) noexcept { } template -template ::value, void*>::type> +template Future::Future(T2&& val) : core_(nullptr) { Promise p; p.setValue(std::forward(val)); diff --git a/folly/futures/Future.h b/folly/futures/Future.h index b26369ce..d0824aa8 100644 --- a/folly/futures/Future.h +++ b/folly/futures/Future.h @@ -55,10 +55,10 @@ class Future { Future& operator=(Future&&) noexcept; /// Construct a Future from a value (perfect forwarding) - /* implicit */ - template ::value, void*>::type = nullptr> - Future(T2&& val); + template ::type>::value>::type> + /* implicit */ Future(T2&& val); template