Boost logo

Boost Users :

From: Steven Watanabe (watanabesj_at_[hidden])
Date: 2008-01-15 15:08:45


AMDG

Boris wrote:
> On Tue, 15 Jan 2008 19:30:00 +0200, raimar wagner
> <raimar.wagner_at_[hidden]> wrote:
>
>
>> Hello!
>> I'm trying to use the boost signals library to implement a callback
>> system, but my first test-application (see boost_test_app.cpp in
>> attachment) won't compile. The connect method works as expected, but
>> if I'm trying to disconnect my slot (in line 28: "
>> mySignal.disconnect(slot);") a compiler error message appears.
>>
>
> This reminds me of bug #1076 - see
> http://svn.boost.org/trac/boost/ticket/1076 (although that bug was
> reported for Visual Studio).
>

It's somewhat different though in that there is no way to make this work
correctly.
Try making
Button::unregisterCallback a template

    template<class T>
    void unregisterCallback(const T& slot)
    {
        mySignal.disconnect(slot);
    }

In Christ,
Steven Watanabe


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