M
mikets
Hi there,
I found out that very often I use the following construct:
for (it = myvec.begin(); it != myvec.end(); ++it) {
if (it->name() == "myname")
break;
}
Certainly, the container the method and the constant can be of
any type.
The purpose is to have a template functor and use the
std::find_if instead of above loop.
I tried to mix something with std::mem_func and std::equal.
It looks that this is above my powers.
Thanks,
Mike.
I found out that very often I use the following construct:
for (it = myvec.begin(); it != myvec.end(); ++it) {
if (it->name() == "myname")
break;
}
Certainly, the container the method and the constant can be of
any type.
The purpose is to have a template functor and use the
std::find_if instead of above loop.
I tried to mix something with std::mem_func and std::equal.
It looks that this is above my powers.
Thanks,
Mike.