xcode4.4

    1热度

    2回答

    我经常使用CRTP从基类调用派生类函数。它具有不招致虚拟函数调用的成本,例如奖金: template< class Derived > class Base { public: void foo() { static_cast<Derived*>(this)->foo_impl(); // Non virtual derived class call