Hi,
I am using multiple stl::list s of different types.
Now I want to write a function
list<type>::ite rator s_erase(list<ty pel, list<type>::ite rator it)
that takes an iterator and deletes the element it is pointing add, and
returns the iterator pointing to the predecessor of the erased element.
like this:
return l.erase(it)--;
But I want this to work for any contained type. For clarification:
I have theses lists:
list<cShipShips ;
list<cProjectil eProjectiles;
list<cAsteroidA steroids;
And I want my function to work on all of these lists. Is that possible?
Regards
Philip
I am using multiple stl::list s of different types.
Now I want to write a function
list<type>::ite rator s_erase(list<ty pel, list<type>::ite rator it)
that takes an iterator and deletes the element it is pointing add, and
returns the iterator pointing to the predecessor of the erased element.
like this:
return l.erase(it)--;
But I want this to work for any contained type. For clarification:
I have theses lists:
list<cShipShips ;
list<cProjectil eProjectiles;
list<cAsteroidA steroids;
And I want my function to work on all of these lists. Is that possible?
Regards
Philip
Comment