Boost logo

Boost Users :

From: Jason Ivey (jasonivey_at_[hidden])
Date: 2007-03-27 20:11:04


Is there any way to use the string algorithm predicates and other facilities
in conjunction with the standard algorithms (IE. for_each, find_if, etc.)?
For example I am trying to make the following example work in MSVC8:

typedef std::vector<std::string> Strs;
Strs strs;
strs.push_back("bob");
strs.push_back("lisa");
strs.push_back("eric");

Strs::const_iterator iter = find_if( strs.begin(),
                                                  strs.end(),
                                                  boost::bind(
&istarts_with, _1, "B", std::locale() ) );
std::cout << "Found: " << std::boolalpha << ( iter == strs.end() ) <<
std::endl;

I would be grateful for any comments or suggestions.

Thanks, Jason


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