Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

You have 10 seconds to implement std::vector in plain C

Name: Anonymous 2016-07-20 3:56

Must support:

* Adding elements
* Regrowing

Name: Anonymous 2017-01-06 13:50

>>61
Technically, it's not an anti-pattern, it is standard practice. It is idiomatic C++.

The man himself in the "The C++ Programming Language" book says that std::vector is optimized for sequential push_back()s and that you should always prefer vectors (and others) over arrays, and you should always use push_back() on a vector over using realloc() on an array.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List