|
Boost Users : |
Subject: Re: [Boost-users] Asio exception handling
From: Igor R (boost.lists_at_[hidden])
Date: 2010-02-14 10:59:32
> Consider the example where an io_service objects is used as scheduler,
> with tasks handed to io_service::post(). According to the manual [1],
> exceptions should propagate to the caller of io_service::run. However, this does not seem to be the case with the attached example.
ASIO has nothing to do with it. You wrap your function with
packaged_task, and it doesn't propagate exceptions.
Modify your example as follows to see what happens:
struct task
{
//....
void operator()()
{
(*pt_)();
boost::unique_future<void> fi=pt_->get_future();
assert(fi.has_exception());
}
//...
};
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net