template< class Base, int TYPE_ID > class GetClassEx: public Base { public: GetClassEx(const long _ID):ID(_ID){} //获取效果类型 virtual long GetType(){ return TYPE_ID; } //获取效果ID virtual long GetEffectID(){ return ID; } private: const long ID; };
template< int v > class Test{}; template<> class Test< enEFFECT_PROPERTY >: public GetClassEx<CTmpEffect, enEFFECT_PROPERTY> { public: Test(const long ID):GetClassEx<CTmpEffect, enEFFECT_PROPERTY>(ID){} };