Boost logo

Boost Users :

From: David Abrahams (dave_at_[hidden])
Date: 2004-05-07 12:49:44


"Mark Storer" <MStorer_at_[hidden]> writes:

>> > 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?
>>
>> Yes; bind and mem_fn handle this problem (and quite a few
>> others) automatically.
>
> Why is this a problem? I thought std::mem_fn called the function
> through the -> operator, which 'should' work (but obviously
> doesn't). I would think this would only crop up through
> mem_fun_ref, but then you wouldn't have a container of
> shared_ptr<Attr>, but Attr.

boost::mem_fn erases the need for a separate mem_fn_ref. If
http://www.boost.org/libs/bind/mem_fn.html fails to explain it to you,
please ask more specific questions.
  
HTH,

-- 
Dave Abrahams
Boost Consulting
http://www.boost-consulting.com

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