Is there something like anonymous struct?

eGust egustc at gmail.com
Mon Mar 4 18:01:45 PST 2013


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, ...
}


More information about the Digitalmars-d mailing list