X-Git-Url: http://plrg.eecs.uci.edu/git/?p=folly.git;a=blobdiff_plain;f=folly%2Ffutures%2FFuture-inl.h;h=446a88f34baa6c139b0519d53113ee7bfdfb01fd;hp=59498af986ef9768a745b502e7968af11e32a555;hb=cc7a5803e4dc766f182f9bb7f507a04b167c131f;hpb=42111d8713cb17e524e097a49f93c9084c084a45 diff --git a/folly/futures/Future-inl.h b/folly/futures/Future-inl.h index 59498af9..446a88f3 100644 --- a/folly/futures/Future-inl.h +++ b/folly/futures/Future-inl.h @@ -49,14 +49,10 @@ Future::Future(T2&& val) : core_(new detail::Core(Try(std::forward(val)))) {} template -template ::value, - int>::type> +template Future::Future() : core_(new detail::Core(Try())) {} - template Future::~Future() { detach(); @@ -452,6 +448,16 @@ bool Future::isReady() const { return core_->ready(); } +template +bool Future::hasValue() { + return getTry().hasValue(); +} + +template +bool Future::hasException() { + return getTry().hasException(); +} + template void Future::raise(exception_wrapper exception) { core_->raise(std::move(exception));