28 Mar
2007
28 Mar
'07
12:11 a.m.
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::vectorstd::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