Boost logo

Boost Users :

From: Surya Kiran Gullapalli (suryakiran.gullapalli_at_[hidden])
Date: 2006-07-06 00:17:44


Hi,
    I've a std::map with the following structure.

std::map < int, tuple<std::string, std::string> > mapTuple ;
typedef map < int, tuple<string, string> > mapTuple ;

Now i've say 10 elements in this container. Now i'd like to iterate thru
this
    container and find a specific element which matches a certain criteria.

    Right now I'm doing this.

    MapIntTuple::iterator iter ;
    for (iter = mymap.begin(); iter != mymap.end(); ++iter)
    {
        if (iter->second.get<0>() == current_field)
            break ;
    }

I'd like to iterate thru the container and find the element whose first
string
in the tuple matches with my search string.

How can i do this using boost::lamdba::bind and std::find_if. May be that
will
help me in understanding boost::bind better.

iter = find_if (mymap.begin(), mymap.end(), ???) ;

Thanks in advance,
       Surya



Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net