title: Unintrusive way to enforce size constraint on std::vector?
body: <p>I want to have a certain kind of <code>std::vector</code> that cannot have more than <code>const int MAX_LENGTH</code> elements. I understand that I cannot override <code>std::vector</code> non-virtual functions, which I'd need to do to put a size check in all the relevant member functions (e.g., <code>assign</code>, <code>push_back</code>...there are so many). The most obvious way to do this is to wrap <code>std::vector</code> in a <code>class</code> that ensures no operation adds beyond the maximum length. But this seems clunky. <strong>Is there a more elegant solution than a wrapper class to limit std::vector size?</strong></p>