正在加载图片...
Define of class template(cont u Defining an inline function in the class template is the same like in a normal class (empty) But how to define it outside the class template template typename elemtype inline Binary Treeselemtype> Binary TreeO: m root(0)i a template and template parameter list should be added a The reason why the second Binarytree need not a template parameter list is that, after the class scope operator, everything could be regarded as in the scope of the class templateDefine of class template (cont.) ◼ Defining an inline function in the class template is the same like in a normal class (empty()) ◼ But how to define it outside the class template? template < typename elemtype > inline BinaryTree<elemtype>::BinaryTree() : m_root( 0 ) {}; ◼ template and template parameter list should be added ◼ The reason why the second BinaryTree need not a template parameter list is that, after the class scope operator, everything could be regarded as in the scope of the class template
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有