Boost logo

Boost Users :

Subject: [Boost-users] [Signals2] Wrapper function for connecting slot won't compile
From: Marc DelaCruz (mdelacruz_at_[hidden])
Date: 2009-07-06 18:47:41


I have code similar to the following:
template<typename A>
class SomeClass
{
    void memFunc(FileDescBase&) { ... }
};

template<typename B>
class OtherClass
{

void setOpenCallBack(boost::signals2::signal<void (FileDescBase&)
>::slot_type const& rOpenSlot)
{
    mOpenSignal.connect(rOpenSlot);
}

void setCallBacks()
{
    SomeClass myClass;
    setOpenCallBack(boost::bind(&SomeClass<B>::memFunc, &myClass)); //does
not compile
    setOpenCallBack(boost::signals2::signal<void (FileDescBase&)
>::slot_type(&SomeClass<B>::memFunc, &myClass)); //does not compile either
}
boost::signals2::signal<void (FileDescBase&) > mOpenSignal;
};

Even a direct call to mOpenSignal.connect(boost::signals2::signal<void
(FileDescBase&) >::slot_type(&SomeClass<B>::memFunc, &myClass)) does not
comiple.

Thanks.


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