View Single Post
Old 24th May 2004, 20:29     #27
Adaptation
 
Those are some nice links
A good book in that area is 'Design Patterns' by Gamma, Erich, Helm, and Vlissides (which replicates http://www.dofactory.com/patterns/Patterns.aspx ). For a more C++ centric approach to generic programming there's 'Modern C++ Design' by Andrei Alexandrescu. These books are more for experienced programmers however, especially Alexandrescu's.

As for switch statements vs virtual functions; I concede that they are not the same thing. Conceptually they are very different, but the actual generated code is similar:
A switch statement (best case) will use a jump table to indirectly jump to the relevant section/function.
A virtual function will result in an indirect jump via a vtable to the relevant function.
  Reply With Quote