Typesafe variadic argument taking struct

Nordlöw via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Thu Oct 20 09:04:00 PDT 2016


On Thursday, 20 October 2016 at 12:48:34 UTC, Satoshi wrote:
> Hello,
> why ... cannot be used with structs?
>
> struct Foo {
>     this(int a) { }
> }
>
> void bar(Foo foo...) {
>
> }
>
> bar(42);

Being explicit about these things makes complex code more clear.


More information about the Digitalmars-d-learn mailing list