EP
Size: a a a
EP
EP
TU
OB
class Foo
{
int x;
string s;
this(int x, string s)
{
this.x = x;
this.s = s;
}
}
void test(int x, Foo f ...);
...
Foo g = new Foo(3, "abc");
test(1, g); // ok, since g is an instance of Foo
test(1, 4, "def"); // ok
test(1, 5); // error, no matching constructor for Foo
DH
g
class Foo
{
int x;
string s;
this(int x, string s)
{
this.x = x;
this.s = s;
}
}
void test(int x, Foo f ...);
...
Foo g = new Foo(3, "abc");
test(1, g); // ok, since g is an instance of Foo
test(1, 4, "def"); // ok
test(1, 5); // error, no matching constructor for Foo
test(1, g, 4, "def");?EP
auto id(T) = (T a) => a;, только надо будет везде передавать типDH
EP
DH