Could anyone tell me how, if at all, templates and generics affect code speed. I know that it depends on the kind of code, but my main question is whether using templates instead of actually having an implementation for each type, slows down the code at all. Or is all the work done at compile time, with the compiler covertly creating a separate declaration for every type used with a template or generic? Are templates and generics the same in terms of performance?