On 11/12/2012 01:42 PM, Joseph Rushton Wakeling wrote:
I tried the following:
Full example code attached, just for clarity.
import std.stdio;
class Foo(_T1, _T2)
{
alias _T1 T1;
alias _T2 T2;
T1 a;
T2 b;
this(T1 a, T2 b)
{
this.a = a;
this.b = b;
}
}
T func(FooT, T : FooT.T1)(FooT foo, T x)
{
return x * foo.a;
}
void main()
{
auto foo = new Foo!(size_t, real)(3, 2.5);
writeln(foo.func(4));
}
