P
Philip Mueller
Hi,
I am using multiple stl::list s of different types.
Now I want to write a function
list<type>::iterator s_erase(list<type> l, list<type>::iterator 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<cShip> Ships;
list<cProjectile> Projectiles;
list<cAsteroid> Asteroids;
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>::iterator s_erase(list<type> l, list<type>::iterator 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<cShip> Ships;
list<cProjectile> Projectiles;
list<cAsteroid> Asteroids;
And I want my function to work on all of these lists. Is that possible?
Regards
Philip