Author image

C++ Vector Implementation


Difficulty:
3/5


A C++14/17 ready allocator_traits aware Vector similar to std::vector . I made it to familiarize myself with the internals of containers in the C++ standard library.

TODO:

  • fix some obscure Iterator problems (perhaps add begin() and end() to it) - we'll see
  • shrinkToFit(#) : if current storage is larger than # Bytes, it shrinks it to # bytes
  • halfSize() shrink

I won't attempt to create a full tutorial on this, because LokiAstari has covered this in excruciating detail already - in a level I can't hope to match (check out acknowledgements section below). If you're overwhelmed with templated code check out this tutorial: link.

I used Windows 8.1 x86_64, Visual Studio 2017 & C++17 to build the project.

Github

Github repository link.

Acknowledgements

Special thanks to LokiAstari (blog post) for his in-depth tutorials!


0 likes