@BitFlipper: Don't assume anything about performance, even if you can read the final assembly code generated! Profile it. That's the only way you'll know.
My example was meant just to show that the functionality is available. I have doubts about the performance impact on your specific scenario, but I'd have to profile it before claiming it wouldn't work. For many people, though, this sort of solution will be "good enough". And I don't consider it a hack at all. The STL does similar things with "traits".
C++ style templates cannot be done in a language like C# because we don't have headers. "Close enough" solutions already exist in many forms, but T4 is the most well known. If the solution I gave doesn't work, a template solution like T4 will. Hand coding two nearly identical sets of algorithms that vary only on the type used would be the wrong solution here.