Content deleted Content added
rm excess ellipses |
|||
Line 36:
This technique achieves a similar effect to the use of virtual functions, without the costs (and some flexibility) of dynamic polymorphism. This particular use of the CRTP has been called "simulated dynamic binding" by [http://www.pnotepad.org/devlog/archives/000083.html some]. This pattern is used extensively in the Windows [[Active Template Library|ATL]] and [[WTL]] libraries.
To
However, if base class member functions use the CRTP pattern for all member function calls, the overridden functions in the derived class will get selected at compile time. This effectively emulates the virtual function call system without the costs in size or function call overhead ([[VTBL]] structures, and method lookups, multiple-inheritance VTBL machinery).
|