gnzlbg / static_vector

A dynamically-resizable vector with fixed capacity and embedded storage
https://gnzlbg.github.io/static_vector
167 stars 21 forks source link

Consider third template parameter to configure error semantics on precondition violation #33

Closed gnzlbg closed 5 years ago

gnzlbg commented 6 years ago

Nicolai Josuttis wrote (talking about how to error when e.g. push_back is executed on a fixed_capacity_vector that is already full):

How about adding a third optional template argument? With the default being to throw. (experts are good enough experts to be able to disable overflows). And the optional template argument should be an enum not a bool (where we can specify that implementations may add other modes).

gnzlbg commented 5 years ago

The container semantics are sufficiently different from vector (e.g. on swap), LWG suggested that a different container type is justified. See #37 .