@@ -46,18 +46,22 @@ static_assert(ex::sender<just_sender<std::pmr::string>>);
4646static_assert (ex::sender_in<just_sender<std::pmr::string>>);
4747
4848int main () {
49- auto j = just_sender{std::pmr::string (" value" )};
50- auto t = std::move (j) | ex::then ([](const std::pmr::string& v) { return v + " then" ; });
51- auto w = ex::when_all (std::move (t));
52- auto e = ex::detail::write_env (std::move (w),
53- ex::detail::make_env (ex::get_allocator, std::pmr::polymorphic_allocator<>()));
54-
55- std::cout << " before start\n " ;
56- auto r = ex::sync_wait (std::move (e));
57- if (r) {
58- auto [v] = *r;
59- std::cout << " produced='" << v << " '\n " ;
60- } else
61- std::cout << " operation was cancelled\n " ;
62- std::cout << " after start\n " ;
49+ try {
50+ auto j = just_sender{std::pmr::string (" value" )};
51+ auto t = std::move (j) | ex::then ([](const std::pmr::string& v) { return v + " then" ; });
52+ auto w = ex::when_all (std::move (t));
53+ auto e = ex::detail::write_env (std::move (w),
54+ ex::detail::make_env (ex::get_allocator, std::pmr::polymorphic_allocator<>()));
55+
56+ std::cout << " before start\n " ;
57+ auto r = ex::sync_wait (std::move (e));
58+ if (r) {
59+ auto [v] = *r;
60+ std::cout << " produced='" << v << " '\n " ;
61+ } else
62+ std::cout << " operation was cancelled\n " ;
63+ std::cout << " after start\n " ;
64+ } catch (const std::exception& ex) {
65+ std::cout << " ERROR: " << ex.what () << " \n " ;
66+ }
6367}
0 commit comments