Custom Vector template: Want to create erase/clear function
Alright, so it's been about a hour since I have been dwelling on this problem and I still do not have a solid plan how to implement this.
Here's the entire Vec class, it's a light version of the vector class:
I can read the entire code fine, but having difficulties of understanding its behavior/reaction, the cause of this problem I believe.
Basically, I have to create the erase/clear function for this class, and every attempt I had gave me template related warnings.
My plan was to create another Vec<T> object and use the copy algorithm to copy the elements of the original from its beginning to the element before the element that needs to be erased. Then I would use the push_back function to copy the rest of the data after that excluded iterator into the new Vec<T> object. Apparently it doesn't work >_>
I don't need nor want a copy of the code, but more of a direction :)
Oh yes, the warning is:
warning C4996: 'std::_Uninit_copy' was declared deprecated
You have used a std:: construct that is not safe. See documentation on how to use the Safe Standard C++ Library'
This comes up everytime despite the fact that the code is directly from the book, Acclerated C++ except for the main().