/*
- * Copyright 2015 Facebook, Inc.
+ * Copyright 2016 Facebook, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
template <class T>
void Promise<T>::setException(folly::exception_wrapper e) {
- fulfilTry(folly::Try<T>(e));
+ setTry(folly::Try<T>(e));
}
template <class T>
-void Promise<T>::fulfilTry(folly::Try<T>&& t) {
+void Promise<T>::setTry(folly::Try<T>&& t) {
throwIfFulfilled();
*value_ = std::move(t);
static_assert(!std::is_same<T, void>::value,
"Use setValue() instead");
- fulfilTry(folly::Try<T>(std::forward<M>(v)));
+ setTry(folly::Try<T>(std::forward<M>(v)));
}
template <class T>
static_assert(std::is_same<T, void>::value,
"Use setValue(value) instead");
- fulfilTry(folly::Try<void>());
+ setTry(folly::Try<void>());
}
template <class T>
template <class F>
-void Promise<T>::fulfil(F&& func) {
- fulfilTry(makeTryFunction(std::forward<F>(func)));
+void Promise<T>::setWith(F&& func) {
+ setTry(makeTryWith(std::forward<F>(func)));
}
}}