
Pavol Droba wrote:
What you have shown is just a simple example of currying and there are at least two facilities in Boost that provide such a functionality. Namely Boost.Bind and Boost.Lambda.
You can write something like this:
std::find_if( vec.begin(), vec.end(), boost::bind<bool>(boost::istarts_with<std::string, std::string>, _1, "bc", std::locale()));
It is not as nice as your example, but it works.
I'm little bit reluctant to add something like this directly to the library. There are already quite a lot of variants of algorithms. Adding some more could be quite confusing. I would prefere to add some realy new functionality.
Isn't this a good example of why we actually need the functionality in the library? I can't imagine very many people that would get the above right in the first 5-10 tries. -Thorsten