There is a uncommon syntax that allows you to do it with a class, but I don't know why structs don't work here:class Foo { int data; this(int n) { data = n; } } void bar(Foo f ...) { assert(f.data == 3); } void main() { bar(3); }
Smells like a bug. But, even if that did work for structs, it is an invasive way to do it, which opImplicitCastTo/From would not be. For a typedef template, that's unacceptable. -- Simen