Boost logo

Boost Users :

From: Steve Folly (boost_at_[hidden])
Date: 2004-05-06 12:55:04


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.

Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net