Implementation of <vector> class
Hey all,
I have one more question. This might seem like an intellectual stretch but I was wondering if ya'll knew how to implement some of the more important methods of the Generic class <vector>:
int PushFront(const T& t);
//Inserts t at front of the vector
int PopFront();
//Removes the front element of the vector
Some links might also be helpful. Thanks guys.
Implementation of more functions
Hey all,
I need to ask for one more big favor. I have to implement three additional functions for the <vector> class also but I have to build them with an std::vector. I should have asked this first instead of the PushFront() and PopFront() methods but can you give me a simple implementation for these functions:
unsigned int Remove(const T& t);
// Remove all copies of t, return the number of items removed.
int Remove(size_t index);
// Remove the item at index.
int Insert (size_t index, const T& t);
// Insert t at position index.