Workaround gcc oddity with Future::within()
Summary: Prior to this diff, the two `Future::within(Duration, Timekeeper* = nullptr)` overloads were the same typewise but they used different symbols: Return-type differences: * rvalue-qualified overload returned `Future<T>` * lvalue-qualified overload returned `auto` (which resolved to `Future<T>`) Parameter *name* differences: * rvalue-qualified overload has unnamed formal-parameters (it is a declaration but not a definition). * lvalue-qualified overload has named formal-parameters (it is both a declaration and a definition). These seemingly innocuous differences caused gcc to choke: when the `this` object was a `Future<...>` object returned by value, gcc reported the following error: "error: call of overloaded ‘within(std::chrono::minutes)’ is ambiguous", specifically pointing to the two `Future::within(Duration, Timekeeper* = nullptr)` overloads. Conversely clang had no problem with that callsite. gcc stopped issuing the spurious error-message after this diff's changes, that is, after making the signatures of the two overloads identical in every respect except for the rvalue-qualification vs. lvalue-qualification. Reviewed By: yfeldblum Differential Revision: D9474736 fbshipit-source-id: 758001090e5487bd70c9853940807cbdeba8ac94
Showing
Please register or sign in to comment