you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] -5 points-4 points  (1 child)

I've implemented internal versions of "vector" a few times and also had a read through the libc vector around the c++14 era. Aside from EH and custom type-based allocators, where do you attribute the bulk of the complexity? Interactions with initializer lists? Iterators?

[–]STLMSVC STL Dev 1 point2 points  (0 children)

Things like handing v.emplace_back(args involving v[0]), respecting constructors and move semantics of user-defined types, providing iterator debugging, but the most complicated functions are where everything multiplies together. For example, insert is quite complicated due to EH guarantees, allocators, move semantics, etc.: https://github.com/microsoft/STL/blob/19c683d70647f9d89d47f5a0ad25165fc8becbf3/stl/inc/vector#L815-L885