`

类的函数模班

阅读更多
 #include <iostream>

class UtilityTool{

public:

    template< typename alphabet_type>
    static void method1(){
        std::cout << __FUNCTION__ << ": sizeof(alphabet_type)=" << sizeof(alphabet_type) << std::endl;
    }

    template< typename offset_type>
    static void method2(){
        std::cout << __FUNCTION__ << ": sizeof(offset_type)=" << sizeof(offset_type) << std::endl;
    }


};


int main(){

    UtilityTool::method1<int>();

    UtilityTool::method2<unsigned char>();

return 0;
}

 

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics