On Friday, 2 February 2024 at 08:22:42 UTC, Carl Sturtivant wrote:
It seems I cannot pass e.g. an int argument to a Variant function parameter. What's the simplest way to work around this restriction?

Just tell the compiler clearly what you want.

```d
import std;

void f(Variant x) {
    writeln(x);
}

void main() {
    f( Variant(42)    );
    f( Variant(2.5)   );
    f( Variant("Hi!") );
}
```

Reply via email to