草庐IT

FindIntegralType2

全部标签

C++递归模板类型推导

我有兴趣学习一些关于模板元编程的知识。在下面的代码中,我尝试使用一些模板递归找到一个足够大以容纳N位的无符号整数类型,该类型在编译时指定。templatestructNextIntegralType{};templatestructNextIntegralType{typedefunsignedchartype;};templatestructNextIntegralType{typedefunsignedshorttype;};...Moretype'iteration'here...templatestructFindIntegralType2{typedefstd::condit