AMDG
Surya Kiran Gullapalli wrote:
If you can use compile time constants instead of runtime values,
you can use indices into a fusion::vector.
The SignalId I'm talking about is a compile time constant (an enum)
I'm trying this, but could not get anywhere for the past few days. Any
pointers on this ?
#include
#include
class A {
private:
typedef boost::fusion::vector<
boost::signal,
boost::signal
> signals_type;
signals_type m_signals;
public:
static const int VoidSignal = 0;
static const int StringSignal = 1;
template<int ID>
typename boost::fusion::result_of::at_c::type
getSignal() { return boost::fusion::at_c<ID>(m_signals); }
};
void f() {
A a;
a.getSignal()
}
In Christ,
Steven Watanabe