Commit 26ca775e authored by Sven Over's avatar Sven Over Committed by Facebook Github Bot

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
parent 5203b6ba
......@@ -39,9 +39,6 @@ class Partial {
: f_(std::forward<Callable>(callable)),
stored_args_(std::forward<Args>(args)...) {}
// full auto doesn't work here due to
// https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70983 :(
template <typename... CArgs>
auto operator()(CArgs&&... cargs) & -> decltype(applyTuple(
static_cast<F&>(f_),
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment