Boost logo

Boost :

From: Scott Woods (scottw_at_[hidden])
Date: 2003-09-23 16:53:02


Cant remember hearing about anything in this vein. Maybe someone
who knows smart_ptr better, has a funky way of applying it?

Below is a hack of the idea. Actually coded something similar and
then realised it was a repeat of smart_ptr. But couldnt neatly apply
it.

set<string> identifier;
string token;
{
    smart_iterator<set<string> > f;

    f = identifier.find( token );
    if(f != identifier.end())
    {
        // Do stuff
    }
} // Automatic set<>.erase() in dtor of "f"

Cheers,
SW


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk