Hmm, I think I found the issue. My signal object is const for some reason.
I'm doing a lot of tricks to map enums to signal objects, I'll post all the
code at the bottom of this message. My fusion::vector either must be
containing the signal objects as const, or fusion::at_c must be returning
const. I'm not really sure.
namespace detail
{
template< InputSubscription t_sub >
struct sub
{
const static InputSubscription value = t_sub;
};
using boost::mpl::map;
using boost::mpl::pair;
typedef map<
pair< sub, boost::signal >,
pair< sub, boost::signal >,
pair< sub, boost::signal >,
pair< sub, boost::signal >
> SubMap;
}
/// Obtains a boost::signal from a matching InputSubscription identifier.
template< InputSubscription t_sub >
struct GetSignal
{
typedef typename boost::mpl::at
::type signal;
};
struct SignalBank
{
boost::fusion::vector<
GetSignal::signal,
GetSignal::signal,
GetSignal::signal,
GetSignal::signal
> signals;
};
template< InputSubscription t_sub >
static void subscribe( SignalBank const& bank, typename
GetSignal::signal::slot_type const& slot )
{
using boost::fusion::at_c;
const_cast::signal>( at_c( bank.signals )
).connect( slot );
}
void mouseCB( int, int )
{
}
void footest()
{
SignalBank bank;
//boost::fusion::at_c<1>( bank.signals )( 3, 4 );
subscribe( bank, &mouseCB );
};