|
Boost : |
From: Andrzej Krzemienski (akrzemi1_at_[hidden])
Date: 2019-11-29 08:39:03
I suspect (I am not programming in an embedded system) that rather than
relying on __builtin_trap() or std::abort(), what you do is start treating
a `resize()` over `capacity()` as a precondition violation (a bug). And
this causes a different programming model and the organization of your code.
Regards,
&rzej;
pt., 29 lis 2019 o 09:06 Peter Dimov via Boost <boost_at_[hidden]>
napisaÅ(a):
> Andrzej Krzemienski wrote:
>
> > On the other hand, if the goal is to provide a container suitable for
> > embedded operations, where you cannot afford throwing exceptions the
> same
> > way as you cannot afford heap allocation, one would expect the other
> > model.
>
> On embedded, you compile with -fno-exceptions and add
>
> namespace boost
> {
> void throw_exception( std::exception const& ) { __builtin_trap(); }
> }
>
> There's no need to afford exceptions, you just need to be able to afford
> the
> potential loss in performance, basically one branch per append if not
> heroically optimized away.
>
>
> _______________________________________________
> Unsubscribe & other changes:
> http://lists.boost.org/mailman/listinfo.cgi/boost
>
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk