int[] results; auto fn = chainFunctor!(n => results ~= cast(int)n); fn(1); fn(long(2)); fn(ubyte(3)); assert(results == [1, 2, 3]);
See Implementation