|
Boost : |
From: Emil Dotchevski (emil_at_[hidden])
Date: 2007-10-01 00:30:13
> > > I'm actually trying to avoid the possibility of bad_alloc being throw
> > > by not allocating anything.
> >
> > How?
>
> If all allocations from boost.exception could be made from a custom
> allocator, it should be possible. Or am I missing something?
Ah, I got confused by your previous points which seemed to indicate
that you wanted to somehow avoid dynamic polymorphism -- and thus the
need for memory allocation -- altogether (which is not possible.)
Other boost components, such as boost::function and boost::shared_ptr,
have an allocator parameter, so I'm assuming you're proposing
something similar. We can add a template constructor to
boost::exception that can be used to supply a custom allocator.
I'd rather not do this, but (I think) it can be implemented in a way
that wouldn't have any negative effects on users who don't want to use
the custom allocator support, so if there's demand -- why not.
Emil Dotchevski
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk