On Mon, 04 Mar 2013 21:15:27 -0500, anonymous <[email protected]> wrote:

On Tuesday, 5 March 2013 at 02:01:47 UTC, eGust wrote:
Can I write something like this:

__gshared immutable foo = {
auto
        func1   = &fn1,
        func2   = &fn2,
...
}

Or just

... = {
  &fn1, &fn2, ...
}

import std.typecons: tuple;
__gshared immutable foo = tuple(&fn1, &fn2, ...);

That doesn't name them. I think you have to be more verbose when naming the members:

__gshared immutable foo = Tuple!(typeof(&fn1), "func1", typeof(&fn2), "func2")(&fn1, &fn2);

Wow, that really sucks. Is there a better way? I bet a mixin could help here...

-Steve

Reply via email to