// // Created by dongl on 22-9-29. // #include #ifndef MSTL_SPECIALIZATION_H #define MSTL_SPECIALIZATION_H #endif //MSTL_SPECIALIZATION_H /// 模板特化 specialization template struct hash{ }; template<> struct hash{ size_t operator() (char x) const { return x; } }; template<> struct hash{ size_t operator() (int x) const { return x; } }; template<> struct hash{ size_t operator() (long x) const { return x; } }; /// partial specialization 模板偏特化 局部特化 个数上的偏 template class m_vector{ }; template class m_vector{ }; /// partial specialization 模板偏特化 局部特化 范围上的偏 template class C{ }; template class C{ };