Pretty please: Named arguments

bearophile bearophileHUGS at lycos.com
Sun Mar 6 17:47:24 PST 2011


Joel C. Salomon:

> Does D have the equivalent of C99's "designated initializers"?

D2 currently allows code like this (but I don't know if this will be deprecated, for me sometimes is not easy to remember all things that will be deprecated):

struct Foo { int x, y, z; }
Foo f1 = { x:1, y:2 };
Foo f2 = { x:1, z:2 };
void main() {}

Bye,
bearophile


More information about the Digitalmars-d mailing list