Commit ec3d4073 authored by Nathan Bronson's avatar Nathan Bronson Committed by Facebook Github Bot 7

explicit return types in Partial to work around gcc bug

Summary: Workaround for https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70983

Reviewed By: mhx, spacedentist

Differential Revision: D3724410

fbshipit-source-id: 692b1c1f49211a4170900505339794f09cec2369
parent 930cf162
......@@ -32,8 +32,14 @@ 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) & {
auto operator()(CArgs&&... cargs) & -> decltype(applyTuple(
static_cast<F&>(f_),
static_cast<Tuple&>(stored_args_),
std::forward_as_tuple(std::forward<CArgs>(cargs)...))) {
return applyTuple(
static_cast<F&>(f_),
static_cast<Tuple&>(stored_args_),
......@@ -41,7 +47,10 @@ class Partial {
}
template <typename... CArgs>
auto operator()(CArgs&&... cargs) const& {
auto operator()(CArgs&&... cargs) const& -> decltype(applyTuple(
static_cast<F const&>(f_),
static_cast<Tuple const&>(stored_args_),
std::forward_as_tuple(std::forward<CArgs>(cargs)...))) {
return applyTuple(
static_cast<F const&>(f_),
static_cast<Tuple const&>(stored_args_),
......@@ -49,7 +58,10 @@ class Partial {
}
template <typename... CArgs>
auto operator()(CArgs&&... cargs) && {
auto operator()(CArgs&&... cargs) && -> decltype(applyTuple(
static_cast<F&&>(f_),
static_cast<Tuple&&>(stored_args_),
std::forward_as_tuple(std::forward<CArgs>(cargs)...))) {
return applyTuple(
static_cast<F&&>(f_),
static_cast<Tuple&&>(stored_args_),
......
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