variadic_future
variadic_future copied to clipboard
Determine what should happen if a stream handler throws an exception
My immediate intuition is that it should go something like this:
Stream_promise<int> prom;
auto fut = prom.get_future();
int total = 0 ;
auto done = fut.for_each([&](int v) {
total += v;
throw std::runtime_error("bam!");
});
prom.push(1);
prom.push(1);
EXPECT_EQ(1, total);
EXPECT_THROW(done.get(), std::runtime_error);