Pretty please: Named arguments

Adam Ruppe destructionator at gmail.com
Mon Feb 28 11:56:15 PST 2011


> But then you're back to square one

Obviously, you'd do:

Size size;
size.width = 10;
size.height = 20;

Instead of Size(10, 20).


Another alternative is to give each element their own struct...

struct Width { int width; alias width this; }

foo(Width(10), Height(20));


More information about the Digitalmars-d mailing list