template PairTemplate (T,S){ class Pair { public T first; public S second; this (T first_val, S second_val){ first = first_val; second = second_val; } public void set_first (T val){ first = val; } public void set_second(S val){ second = val; } } } int main(){ alias instance PairTemplate(int,int).Pair IntPair; IntPair a_pair = new IntPair(1, 2); printf("pair.first = %d, pair.second = %d\n", a_pair.first, a_pair.second); return 0; }