G
glen stark
Hi Everyone
So, I want to use a std::for_each in the following situation:
class B{
//whatever
}
class A{
private:
void configure_A_from_B(const std::vector<B*>& bPtrVec);
void member_function(B*); //non const.
}
A::configure_A_from_B(const std::vector<B*>& bPtrVec){
std::for_each( bPtrVec.begin(), bPtrVec.end(), member_function() )
}
i.e. I want to use std::for_each to call a member (of A) function,
with a single parameter, the pointer pointed to by the iterator I am
for_eaching over.
Unfortunatley I'm tripped up by the whole binding thing... can someone help
me out? I'm also willing to use the boost lambda libraries, but I haven't
been
able to sort this out.
Thanks,
Glen
So, I want to use a std::for_each in the following situation:
class B{
//whatever
}
class A{
private:
void configure_A_from_B(const std::vector<B*>& bPtrVec);
void member_function(B*); //non const.
}
A::configure_A_from_B(const std::vector<B*>& bPtrVec){
std::for_each( bPtrVec.begin(), bPtrVec.end(), member_function() )
}
i.e. I want to use std::for_each to call a member (of A) function,
with a single parameter, the pointer pointed to by the iterator I am
for_eaching over.
Unfortunatley I'm tripped up by the whole binding thing... can someone help
me out? I'm also willing to use the boost lambda libraries, but I haven't
been
able to sort this out.
Thanks,
Glen