@bitstorm: well in case of simple types like int64, int32, float, ... the compiler is clever enough to get the correct type. For example (tested code): import typetraits template myadd[L,R](lhs: L, rhs: R): auto = lhs + rhs var intAndFloat = myadd(5, 5.0) # echos "10.0 is float" echo $intAndFloat & " is " & intAndFloat.type.name var a: int64 = 5 var b: int32 = 5 var int64Andint32 = myadd(a, b) # echos "10 is int64" echo $int64Andint32 & " is " & int64Andint32.type.name
Would you mind to give a more concrete example with your "generic container types"?