14 Feb
2010
14 Feb
'10
3:59 p.m.
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()); } //... };