Boost logo

Boost Users :

Subject: Re: [Boost-users] Change return type automatically
From: Surya Kiran Gullapalli (suryakiran.gullapalli_at_[hidden])
Date: 2009-10-30 06:22:59


>
>
> The best that you can do with a runtime id is:
>
> template<class Args...>
> void A::connect(SignalIds id, const Args& args...) {
> switch(id) {
> case VoidSignal: m_voidSignal.connect(args...); break;
> case StringSignal: m_stringSignal.connect(args... ); break;
> }
> }
>
>
I've already thought of this.

> 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 ?

Thanks,
Surya

Surya



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