I'm sure this has been answered many times, but I don't know how to search for this. Is this polymorphism? Overloading?
Basically I want to take a vector, and modify its functions the way I want them or create new ones.
E.g: I want push_back() to insert an element and keep the vector in descending order. So the addition would be to swap() the element to its respective place. Or I would like to add a new function pop_front().
That being said, I need it as a member function, e.g:
vector<int> x;
x.pop_front();
not:
pop_front(x);
Is this ever done in practice? I know I can just use existing containers, like a priority queue for my example, but I'd rather make completely custom functions.