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
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