gnzlbg / static_vector

A dynamically-resizable vector with fixed capacity and embedded storage

Home Page:https://gnzlbg.github.io/static_vector

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Consider third template parameter to configure error semantics on precondition violation

gnzlbg opened this issue · comments

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

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