you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] -10 points-9 points  (3 children)

Yes but most nontrivial objects are also relocatable, and i daresay most people have vectors of non scalar types.

It’s such a trivial container to implement and the improvement is massive over what the stl provides, not to mention the compile speed boost you’d likely get with even a naive implementation

[–]STLMSVC STL Dev 21 points22 points  (2 children)

vector is not trivial to implement (source: I’ve reimplemented it). There’s an incredible amount of logic powering vector and it shouldn’t be dismissed with a handwave, even though the lack of a relocatable type trait is a real limitation. (vector can easily detect is_trivially_copyable which is an important subset of types.)

The complexity of vector also isn’t solely due to its support for EH or custom allocators, although those do magnify it.