Typesafe variadic argument taking struct

rikki cattermole via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Thu Oct 20 05:52:42 PDT 2016


On 21/10/2016 1:48 AM, Satoshi wrote:
> Hello,
> why ... cannot be used with structs?
>
> struct Foo {
>     this(int a) { }
> }
>
> void bar(Foo foo...) {
>
> }
>
> bar(42);

Because an int is not a Foo.


More information about the Digitalmars-d-learn mailing list