std.signal woes :/

cal callumenator at gmail.com
Sun Feb 24 11:20:05 PST 2013


On Sunday, 24 February 2013 at 17:30:14 UTC, Damian wrote:
> That solution is ok for 1 argument but for many arguments it 
> wont suffice.
>
> This is issue 5028.

What is the problem with many arguments? I'm probably 
misunderstanding, but e.g. this works:

struct MySignal(T...)
{
     mixin Signal!T _signal;
     alias _signal this;
}

class A
{
     MySignal!(float, int[]) sigA;
}

class B : A
{
     MySignal!(int, string, char) sigB;
}

void main()
{
     auto a = new A;
     auto b = new B;
     a.sigA.emit(1.4, [1,2,3]);
     b.sigA.emit(1, [4,5,6]);
     b.sigB.emit(1, "hello", 'x');
}


More information about the Digitalmars-d-learn mailing list