Boost logo

Boost :

From: Emil Dotchevski (emildotchevski_at_[hidden])
Date: 2006-11-14 21:06:03

David Abrahams wrote:
> Matthew Herrmann <matthew.herrmann_at_[hidden]> writes:
>> I think Mr Abrahams is referring to an idea similar to this: (please
>> ignore the class name, it is a placeholder only)
>> void read_file()
>> {
>> boost::exception_info e(..., filename, current_pos, is_connected);
>> ...
>> e.success();
>> return;
>> }
>> e.success() sets a flag to true, which prevents the generation of
>> error information when the object is destroyed.
> No, that's not quite what I meant.
> void tag_exception(boost::exception& x)
> {
> // do something to x
> }
> void read_file()
> {
> boost::adorn_exception e( boost::bind( tag_exception, _1 ) );
> ...
> }

Could you provide more detail on the "do something to x" part? It seems to
me that it would require something similar to the boost::exception::pimpl
class, in that it must be able to store arbitrary values, but unlike
boost::exception::pimpl it would have to keep some kind of proxy for each
stored object, to be evaluated later if something throws.

Wouldn't that amount to executing a lot of code and using a lot of storage,
even if nothing throws?

Boost list run by bdawes at, gregod at, cpdaniel at, john at