
Dean Michael Berris wrote:
Hi Emil!
Far from it. I'm thinking get_error_info(T const &) should not compile if the error_info being requested has not been passed to the exception. This would only be possible if the exception type itself is composed using expression templates and its type information is somehow reflected during runtime -- or it might be impossible given that the exception is referred to via an abstract base `boost::error`. Maybe an encapsulated tuple that "grows" along the exception propagation might work though I'm not entirely sure about that as well.
This is completely impossible. Full static type information would have to be available in order to compose a new data item into an existing exception, which means that a site which just wants to add information would have to catch the exception by its _full expression template type_. Given that a site might not even _know_ what exceptions might pass through it (if it's passed a Boost.Function object and calls it, for example), that's not even possible, not to mention that it would be completely unusuable if it _were_ possible. Sebastian Redl