Subject: Re: [boost] [exception] current_exception mishandlingstandardexceptions
From: Adam Badura (abadura_at_[hidden])
Date: 2009-05-14 16:16:58
>> Note that this would also solved problem in enable_current_exception
>> virtual base classes that are not default constructible - mentioned in
>> earlier thread.
> It would, but I don't see a reason to use exception types without
> default constructors with Boost Exception. So, in my mind this problem
> is only theoretical.
What about integrating with existing exception hierarchies? (I know the
example I gave previously of my project is not such hierarchy... :)). But on
the other hand existing hierarchies likely do not use virtual inheritance as
you have already mentioned somewhere before if I am not mistaken.
Still there are reasons. In cases someone wants extra care he/she cannot
use Boost.Exception data injection because this always adds risk of double
failure - lack of memory and std::bad_alloc (or even something unpredictable
as if I am not mistaken Standard puts low requirements on implementations on
what, when and where can be thrown and only recommends standard
exceptions) - which would mask the original failure.
In case of my example of storing DWORD with GetLastError result in a
modern PC machine chances of lack of memory are extremely low. However when
talking about embedded systems or exceptions with more (maybe even lots) of
data this becomes important.
So to sum up IMHO if the implementation already uses this mechanism and
all the required work is to make it public and document it then I would do
it even if I didn't see practical use at the moment (I feel a bit
mathematician and I do recall theories which also seemed useless at the
moment of creation but then became important... :)). And in this case it
seems (at least IMO) there are justified and possible if not likely use
cases (the ones I mentioned earlier in the post).
But you are not me and I do not feel entitled to modify Boost.Exception
on my own so the final choice is yours. Since it seems I am the first and
only one requesting this then maybe after all it is not important enough.
(And yes. I know I can modify my own Boost to make this change and use
it but I don't think it is a good idea especially that I am not the only
person working on the project and we do constantly update Boost version
instead of sticking to one particular.)
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk