奇特的递归模板模式不是一种新技术,而是一种模板编程时使用的编程手法–把派生类作为基类的模板参数。 1.在基类中使用派生类对象 template<typename T> class Base { public: void asDerived() { T &derived = static_cast<T &>(*this); derived.