随笔1
template<typename T> class SquareMatriBase{ protected: void invert(std::size_t matrixSize); }; template<typename T, std::size_t n> class SquareMatrix : private SquareMatriBase<T>//private继承表示SquareMatrix由SquareMatriBase<T>继承而来 { private: using SquareMatriBase<T>::invert;//避免遮掩base版的invert public: void invert(){ this->invert(n); }//this->表示调用基类的 };