Author image

C++ Vector Implementation


Difficulty:
3/5


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

TODO:

  • fix some Iterator problems (perhaps add begin() and end() to it)
  • 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 others have done it better (check out acknowledgements section below). But the code is very well commented so you can read for yourself. 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.

Contribute

Please submit any bugs you find through GitHub repository 'Issues' page with details describing how to replicate the problem.

Github

Github repository link.

Acknowledgements

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


0 likes