March 2025
Intermediate to advanced
442 pages
11h 16m
English
In the previous chapter, we wrote a working (if simple) implementation of a std::vector<T>-like type in Vector<T>, as well as a working (if, again, simple) implementation of a std::forward_list<T>-like type in ForwardList<T>. Not bad!
In the case of our Vector<T> type, after an initial effort that led to a working but sometimes inefficient implementation, we made the effort to separate allocation from construction, something that reduced the amount of redundant effort required at runtime but came at the cost of a more subtle implementation. In this more sophisticated implementation, we distinguished parts of the underlying storage that are initialized from those that are not and, ...
Read now
Unlock full access