6 May
2004
6 May
'04
5:55 p.m.
Hi, I've converted a container to use shared_ptrs instead of regular pointers, now my for_each algorithm doesn't work: Before: class Attr; std::vector< Attr* > mAttributes; . . . std::for_each( mAttributes.begin(), mAttributes.end(), std::bind2nd( std::mem_fn( &Attr::Write ), output ) ); After: std::vector< shared_ptr<Attr> > mAttributes; Now it doesn't compile because (of course) Attr::Write is not a method of shared_ptr<Attr>. Do I have to use boost's bind and mem_fn objects instead of std? Thanks for any help. -- Regards, Steve.