Commit 63df3083 authored by James Sedgwick's avatar James Sedgwick Committed by facebook-github-bot-4

fix SharedPromise<T>::setWith

Summary: was using the renamed/nonexistent makeTryFunction

Reviewed By: @elliottneilclark

Differential Revision: D2416178
parent 3a529d4c
......@@ -102,7 +102,7 @@ void SharedPromise<T>::setValue(M&& v) {
template <class T>
template <class F>
void SharedPromise<T>::setWith(F&& func) {
setTry(makeTryFunction(std::forward<F>(func)));
setTry(makeTryWith(std::forward<F>(func)));
}
template <class T>
......
......@@ -100,3 +100,9 @@ TEST(SharedPromise, moveMove) {
p = std::move(p2);
p.setValue(std::make_shared<int>(1));
}
TEST(SharedPromise, setWith) {
SharedPromise<int> p;
p.setWith([]{ return 1; });
EXPECT_EQ(1, p.getFuture().value());
}
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