comment out store tuple

This commit is contained in:
Xiaoxi Wang 2022-06-13 13:36:19 -07:00
parent 1de6c09307
commit ea2edebbeb
2 changed files with 7 additions and 0 deletions

View File

@ -181,6 +181,7 @@ TEST_CASE("/flow/genericactors/AsyncListener") {
return Void(); return Void();
} }
#if false
TEST_CASE("/flow/genericactors/generic/storeTuple") { TEST_CASE("/flow/genericactors/generic/storeTuple") {
state std::vector<UID> resA; state std::vector<UID> resA;
state int resB; state int resB;
@ -197,3 +198,4 @@ TEST_CASE("/flow/genericactors/generic/storeTuple") {
ASSERT(resC == 2.0); ASSERT(resC == 2.0);
return Void(); return Void();
} }
#endif

View File

@ -300,6 +300,10 @@ Future<Void> store(T& out, Future<T> what) {
}); });
} }
#if false
// NOTE: Think twice whether create a new struct for a complex return type is better before using tuple.
// If we just use the return type once, is it worth to create a new struct?
// And enable the unit test in genericactors.actor.cpp
template <class A, class... Bs> template <class A, class... Bs>
Future<Void> storeTuple(Future<std::tuple<A, Bs...>> what, A& a, Bs&... b) { Future<Void> storeTuple(Future<std::tuple<A, Bs...>> what, A& a, Bs&... b) {
return map(what, [&](std::tuple<A, Bs...> const& v) { return map(what, [&](std::tuple<A, Bs...> const& v) {
@ -307,6 +311,7 @@ Future<Void> storeTuple(Future<std::tuple<A, Bs...>> what, A& a, Bs&... b) {
return Void(); return Void();
}); });
} }
#endif
template <class T> template <class T>
Future<Void> storeOrThrow(T& out, Future<Optional<T>> what, Error e = key_not_found()) { Future<Void> storeOrThrow(T& out, Future<Optional<T>> what, Error e = key_not_found()) {