C++面向对象(三)模版 Posted on 2025-01-03 Views: Symbols count in article: 191 Reading time ≈ 1 mins. 模版函数(template function)为声明不是定义,在使用时根据输入类型定义 使用模版时,不会使用隐式类型转换 类模版里的每个函数都是函数模版,需要在声明前加上template 12345template <typename elemType>class BinaryTree{ private: BTnode<elemType> *_root;}