variadic_future icon indicating copy to clipboard operation
variadic_future copied to clipboard

Determine what should happen if a stream handler throws an exception

Open FrancoisChabot opened this issue 6 years ago • 0 comments

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);

FrancoisChabot avatar Jul 09 '19 19:07 FrancoisChabot