--- In Boost-Users@y..., "Peter Dimov"
for_each(widgetset_.begin(),widgetset_.end(),i->insert); }
I think that you need bind(&WidgetMap::insert, i, _1) here.
Thanks! I figured that one out this morning, [...]
maps_.erase(remove_if(maps_.begin(),maps_.end(),(boost::mem_fn (&WidgetMap::g etIndexedMember)).equals(d)));
This is getting harder.
bind(&DataMember::equals, bind(&WidgetMap::getIndexedMember, _1), d)
would be my guess. Easier would be to define a helper function
bool memberEquals(WidgetMap const & m, DataMemberPtr d) { return m.getIndexedMember().equals(d); }
and then use
bind(memberEquals, _1, d) in dropWidgetMember.
I actually ended up figuring out how to write a function object class to do something similar. This has been a good learning experience! Is there a down side to the function object approach over the helper function? From what I could tell, the helper function had to be a global function, which just didn't seem right. Thanks, Mark