|
Boost Users : |
Subject: Re: [Boost-users] shared_ptr and signals
From: Peter Dimov (pdimov_at_[hidden])
Date: 2008-12-30 13:10:51
James C. Sutherland:
> I want something like
>
> struct A{
> ...
> void operator()(){ ... }
> ...
> };
> typedef boost::signal<void()> Signal;
> Signal mySignal;
>
> boost::shared_ptr<A> a( new A() );
> mySignal.connect(a);
You can use
mySignal.connect( boost::bind( &A::operator(), a ) );
Not pretty, but still a way to achieve what you want without a helper
function (object).
-- Peter Dimov http://www.pdplayer.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