From: Sven Over Date: Tue, 13 Jun 2017 16:17:06 +0000 (-0700) Subject: remove misleading comment in Partial.h X-Git-Tag: v2017.06.19.00~27 X-Git-Url: http://plrg.eecs.uci.edu/git/?p=folly.git;a=commitdiff_plain;h=26ca775e4e9edf6b36afff172a4d9798810f5333 remove misleading comment in Partial.h Summary: The removed comment cites a gcc compiler bug as a reason to spell out the return type of the three operator() methods. While that compiler bug can lead to compiler errors in some situations, it is not the only reason why we need the return type arrow notation. If the compiler tries to instantiate operator() with a set of parameters that the embedded function does not accept, then the substitution failure is inside decltype, which is not a compiler error (SFINAE) but just means that the Partial class doesn't define operator() for that parameter signature. Without decltype, the body of operator() is ill-formed and that is a compiler error. Reviewed By: meyering Differential Revision: D5236537 fbshipit-source-id: 7daa0fbcf128a2c7c5c36532a5402deba394e1b8 --- diff --git a/folly/Partial.h b/folly/Partial.h index 518e91ed..b3914528 100644 --- a/folly/Partial.h +++ b/folly/Partial.h @@ -39,9 +39,6 @@ class Partial { : f_(std::forward(callable)), stored_args_(std::forward(args)...) {} - // full auto doesn't work here due to - // https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70983 :( - template auto operator()(CArgs&&... cargs) & -> decltype(applyTuple( static_cast(f_),