Deduce type of struct in function arguments

Andrey saasecondbox at yandex.ru
Mon Aug 20 09:23:27 UTC 2018


Hello,

I have a function and a struct:
> void foo(ref Data data) { ... }

> struct Data
>{
>    int a;
>    string text;
>}

How to pass struct into function without naming its type?

This doesn't work:

> foo({1234, "Hello!"});


More information about the Digitalmars-d-learn mailing list