Monday, 26 August 2013

Why this boost::signals2 template class doesn't work?

Why this boost::signals2 template class doesn't work?

Here is the code:
#ifndef EVENTSYSTEM_HPP
#define EVENTSYSTEM_HPP
#include <boost/signals2.hpp>
#include <boost/bind.hpp>
using namespace boost;
using namespace boost::signals2;
template<class T>
class EventMain
{
public:
//typedef void (*_func)(T);
template <typename Slot>
void connect( Slot func, T interface ) { _signal.connect( bind( func,
interface ) ); }
void emitSignal( T data ) { _signal(data); }
private:
signal<void (T)> _signal;
};

No comments:

Post a Comment