以下の内容はhttps://amachang.hatenablog.com/entry/20090416/1239854222より取得しました。


Boost.Integer で signed な変数を unsigned に変換する

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;
}




以上の内容はhttps://amachang.hatenablog.com/entry/20090416/1239854222より取得しました。
このページはhttp://font.textar.tv/のウェブフォントを使用してます

不具合報告/要望等はこちらへお願いします。
モバイルやる夫Viewer Ver0.14