Boost logo

Boost :

Subject: Re: [boost] Weak functor: Interested? (How to boost::bind to a weak_ptr)
From: Roman Perepelitsa (roman.perepelitsa_at_[hidden])
Date: 2012-01-10 16:34:39


2012/1/10 Vladimír Třebický <vladimir.trebicky_at_[hidden]>

>
> boost::function<void(int)> f = boost::bind(boost::weak_fn(&Foo::bar,
> some_weak_ptr), _1);
> f(1);
>

It's it better to bind &Foo::bar directly?

  boost::function<void(int)> f = boost::bind(&Foo::bar, some_weak_ptr, _1);

Much simpler in my opinion.

Roman Perepelitsa.


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk