Summary:
MSVC has a bug where it is unable to match an out-of-line constructor (and
possibly other kind of member) to the definition if it is implicitly referenced
before the definition is processed. The guilty method is
SemiFuture<Unit> makeSemiFuture(). Moving it after the constructor definitions
resolves the issue.
Reviewed By: yfeldblum
Differential Revision:
D6042277
fbshipit-source-id:
97fe97c0edf3df3d9e3b808968b450c73959b600
return makeSemiFuture(Try<typename std::decay<T>::type>(std::forward<T>(t)));
}
-inline SemiFuture<Unit> makeSemiFuture() {
- return makeSemiFuture(Unit{});
-}
-
// makeSemiFutureWith(SemiFuture<T>()) -> SemiFuture<T>
template <class F>
typename std::enable_if<
detach();
}
+// This must be defined after the constructors to avoid a bug in MSVC
+// https://connect.microsoft.com/VisualStudio/feedback/details/3142777/out-of-line-constructor-definition-after-implicit-reference-causes-incorrect-c2244
+inline SemiFuture<Unit> makeSemiFuture() {
+ return makeSemiFuture(Unit{});
+}
+
template <class T>
T& SemiFuture<T>::value() & {
throwIfInvalid();