#pragma once
-#include "folly/wangle/Executor.h"
-#include "folly/wangle/Future.h"
-#include "folly/Optional.h"
+#include <folly/wangle/Executor.h>
+#include <folly/wangle/Future.h>
+#include <folly/Optional.h>
namespace folly { namespace wangle {
future_ = starter_.getFuture();
}
+template <class T>
+Later<T>::Later(Future<T>&& f) {
+ MoveWrapper<Future<T>> fw(std::move(f));
+ *this = Later<void>()
+ .then([fw](Try<void>&&) mutable {
+ return std::move(*fw);
+ });
+}
+
template <typename T>
Later<T>::Later(Promise<void>&& starter)
: starter_(std::forward<Promise<void>>(starter)) { }