S
SpreadTooThin
I want to replace an object in a list with a new object....
std::list<myObj>::iterator it;
for (it=mylist.begin(); it != mylist.end(); ++it)
{
if (it->compair(myval) == 0)
{
*it = newval;
}
}
will *it = newval replace the contents of the list with the new
data... and hopefully delete the old object?
How do I insert and object just before the last element in the list?
std::list<myObj>::iterator it;
for (it=mylist.begin(); it != mylist.end(); ++it)
{
if (it->compair(myval) == 0)
{
*it = newval;
}
}
will *it = newval replace the contents of the list with the new
data... and hopefully delete the old object?
How do I insert and object just before the last element in the list?