I need something to store some functions, and it only will be used once. There is my code now:

struct Funcs {
auto
        func1   = &fn1,
        func2   = &fn2,
...
        funcN   = &fnN;
}

__gshared immutable Funcs foo;

export extern(Windows) auto bar()
{
        return &foo;
}

============

Can I write something like this:

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

Or just

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

Reply via email to