Original Post
Unless I missed out on some sort of better design, I have a case (which I imagine is typical?) where there is a base abstract class IFile, and from it is derived classes such as FileIStream, FileMem, and FileDisk. With type safety in mind, I have this bright idea to implement a function like: // Wish this could be virtual and abstract :/ template void WriteArray(const std::vector &Buffer); Of course this does no good in the IFile interface, and although it is pretty useful in the concrete classes, when I actually need to depend on the interface alone, I'm stuck. What can I do so that I have the equivalent of a virtual template function? I read something on a curiously recurring template, but that would require that the base class interface knows about the derived... and if that were the case I wouldn't need to use the base class interface in the first place :/ The only thing I can think of is to implement the template function for the base class, and call a private function along the lines of: // Ewwww (but maybe good enough?) virtual void WriteArrayImpl(void *Mem, UInt64 Bytes) = 0; Any better ideas? Cheers -Scott