xxxxxxxxxx
module thismodule;
class OneClass
{
this() { }
this( T )( int a, float b )
{
anInt = a;
aFloat = b;
ogType = T.stringof;
}
int anInt;
float aFloat;
string ogType;
}
class TwoClass : OneClass
{
this( double someDouble )
{
super.__ctor!double( cast(int)someDouble, cast(float)someDouble );
}
}
int main( string[] argv )
{
import std.stdio : writeln;
import std.conv : to;
TwoClass twoclass = new TwoClass( 123.456 );
writeln( twoclass.anInt.to!string, " <= " ~ twoclass.aFloat.to!string, " (was " ~ twoclass.ogType ~ ")" );
return 0;
}