Is there something like anonymous struct?

eGust egustc at gmail.com
Mon Mar 4 18:58:57 PST 2013


On Tuesday, 5 March 2013 at 02:15:33 UTC, anonymous 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, ...);

Yes, it looks better. Can tuple guarantee the order and alignment 
of the elements? I need an interface with other languages.


More information about the Digitalmars-d mailing list