From: Aaryaman Sagar Date: Thu, 24 Aug 2017 21:42:53 +0000 (-0700) Subject: unwrapTryTuple only accepted rvalue tuple types X-Git-Tag: v2017.08.28.00~7 X-Git-Url: http://plrg.eecs.uci.edu/git/?p=folly.git;a=commitdiff_plain;h=374d408bcd0283dffd5b0bec78685bc17e567c43 unwrapTryTuple only accepted rvalue tuple types Summary: unwrapTryTuple only accepted rvalue tuple types, this diff fixes that to work with forwarding reference tuple types. Also reduces the number of template instantiations Reviewed By: yfeldblum Differential Revision: D5682996 fbshipit-source-id: ee6dd2c20d8dfca33e769a98a6ca56fa96c73b72 --- diff --git a/folly/Makefile.am b/folly/Makefile.am index d2ed843e..18aa5bd4 100644 --- a/folly/Makefile.am +++ b/folly/Makefile.am @@ -82,7 +82,6 @@ nobase_follyinclude_HEADERS = \ detail/SocketFastOpen.h \ detail/StaticSingletonManager.h \ detail/ThreadLocalDetail.h \ - detail/TryDetail.h \ detail/TurnSequencer.h \ detail/UncaughtExceptionCounter.h \ Demangle.h \ diff --git a/folly/Try-inl.h b/folly/Try-inl.h index 8adeb423..e70fce72 100644 --- a/folly/Try-inl.h +++ b/folly/Try-inl.h @@ -16,8 +16,10 @@ #pragma once -#include +#include + #include +#include namespace folly { @@ -163,10 +165,31 @@ makeTryWith(F&& f) { } } -template -std::tuple unwrapTryTuple(std::tuple...>&& ts) { - return detail::TryTuple::unwrap( - std::forward...>>(ts)); +namespace try_detail { + +/** + * Trait that removes the layer of Try abstractions from the passed in type + */ +template +struct RemoveTry; +template