C++でFCのドラクエっぽいRPGを作るat GAMEDEV
C++でFCのドラクエっぽいRPGを作る - 暇つぶし2ch5:1/2
07/11/02 10:31:38 vzRmdmZ8
とりあえずそれなりにC++っぽく作ってみた(要boost)
効率はそんなに良くないと思う

#define NOMINMAX
#include <windows.h>
#include <string>
#include <limits>
#include <iostream>
#include <algorithm>
#include <functional>
#include <boost/mpl/plus.hpp>
#include <boost/mpl/int.hpp>
#include <boost/array.hpp>

namespace mpl = boost::mpl;

struct IntToFullSizeWSTR : std::unary_function<int,std::wstring>
{
  result_type operator()(argument_type i);
private:
  typedef mpl::plus<mpl::int_<std::numeric_limits<int>::digits10>, mpl::int_<3> > buffer_size;
  boost::array< wchar_t, buffer_size::value > i2w_buf, half2full_buf;
} conv;

int main() {
  std::wcout.imbue( std::locale("japanese") );
  std::wcout << ::conv(std::numeric_limits<int>::min() ) << L"?" << ::conv(std::numeric_limits<int>::max()) << std::endl;
}



次ページ
続きを表示
1を表示
最新レス表示
レスジャンプ
類似スレ一覧
スレッドの検索
話題のニュース
おまかせリスト
オプション
しおりを挟む
スレッドに書込
スレッドの一覧
暇つぶし2ch