boost::uint_t を使うと出来るみたい
#include <boost/integer.hpp> template <class T> struct add_unsigned { typedef typename boost::uint_t<sizeof(T) * 8>::least type; }; /************/ #include <iostream> #include <typeinfo> int main() { std::cout << typeid(unsigned int).name() << std::endl; std::cout << typeid(add_unsigned<signed int>::type).name() << std::endl; }