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
- Host: GitHub
- URL: https://github.com/maxbrundev/vector_class
- Owner: maxbrundev
- License: mit
- Created: 2017-11-05T20:10:52.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-11-05T21:50:58.000Z (over 8 years ago)
- Last Synced: 2025-01-21T18:14:39.646Z (over 1 year ago)
- Language: C++
- Size: 3.91 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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