Boost logo

Boost :

From: Brunen, Johannes (jbrunen_at_[hidden])
Date: 2002-08-07 11:07:37


Hi,

I have tried to connect a slot function to a signal as follows:

class X
{
public:
        void Connect(boost::signal0<XVOID>::slot_function_type f);
private:
        boost::signal0<XVOID> _signal;
};

void X::Connect(boost::signal0<XVOID>::slot_function_type f)
{
        _signal.connect(f);
}

class A
{
        void somefun(X& x);
public:
        void f ();
};

A::somefun(X& x)
{
        x.Connect(boost::mem_fn(&A::f));
}

This does not compile. Isn't it possible to use a simple member function as
a slot?
A slot functor works just fine but is a little bit overkill in my
application.

With kind regards

Johannes


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