Boost logo

Boost Users :

From: Robert Dailey (rcdailey_at_[hidden])
Date: 2008-02-06 14:31:50


Hi, below is my code:

template< InputSubscription t_sub >
static void subscribe( SignalBank const& bank, typename
GetSignal<t_sub>::signal::slot_type& slot )
{
    using boost::fusion::at_c;
    at_c<t_sub>( bank.signals ).connect( slot );
}

void mouseCB( int, int )
{
}

void footest()
{
    SignalBank bank;

    //boost::fusion::at_c<1>( bank.signals )( 3, 4 );

    subscribe<INPUTSUB_MOUSE_MOTION>( bank, &mouseCB );
};

Notice that I have a wrapper function, 'subscribe', which uses the slot_type
member of the signals class to pass the slot to the connect() function.
However, visual studio 9 reports the following error:

*error C2664: 'bob::input::subscribe' : cannot convert parameter 2 from
'void (__cdecl *)(int,int)' to 'boost::slot<SlotFunction> &'
        with
        [
            SlotFunction=boost::function<void (int,int)>
        ]

*Any solutions to fix the problem?*
*



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