29 Nov
2019
29 Nov
'19
7:57 a.m.
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.