auto in function signature for defaulted arguments?

bearophile bearophileHUGS at lycos.com
Thu Jun 27 05:20:37 PDT 2013


Sometimes I have code like this:

struct VeryLongNamedStruct {}
void foo(in VeryLongNamedStruct x = VeryLongNamedStruct(1)) {}
void main() {}

Or even:

void bar(in TupleFoo x = TupleFoo(TupleBar(2), TupleSpam(3))) {}

So is it a good idea to allow "auto" in the function signature 
for the arguments that have a default value?

void foo(in auto x = VeryLongNamedStruct(1)) {}

Bye,
bearophile


More information about the Digitalmars-d-learn mailing list