An open API service indexing awesome lists of open source software.

https://github.com/maxbrundev/vector_class

Implementation of a Vector class
https://github.com/maxbrundev/vector_class

Last synced: over 1 year ago
JSON representation

Implementation of a Vector class

Awesome Lists containing this project

README

          

# Vector class
During my learning of C ++, I implemented the Vector class to understand how it works and how to manipulate it.
I implemented the methods:
- push_back (Adds a new element at the end of the vector, after its current last element)
- reserve (Requests that the vector capacity be at least enough to contain n elements)
- resize (Resizes the container so that it contains n elements)
- clear (Removes all elements from the vector)

With these methods I can manipulate the size (the number of elements in the vector) and the capacity (space currently allocated for the vector) of my Vector.

# Future Updates
Add attributes:
- max_size (maximum number of elements that the vector can hold)

Add methods:
- pop_back (Removes the last element in the vector)
- swap (Exchanges the content of the container by the content of x, which is another vector object of the same type)

License
----

MIT