Copy + pasted random code segment from one of my projects: static if( is( T_Type T_BaseType == typedef ) ) { toStream(stream, cast(T_BaseType)value); } Hope that helps. -- Daniel