2008-04-15から1日間の記事一覧

cast

便利なもの発見. #include <iostream> #include <string> #include <boost/lexical_cast.hpp> int main(){ std::string str = "3.14"; double pi = 0.0; try { pi = boost::lexical_cast<double>(str); } catch(const boost::bad_lexical_cast&){ std::cerr << "cast failed" << std::endl; return 1; } std::c</double></boost/lexical_cast.hpp></string></iostream>…

ゲームクラス設計

C++

GUI型ゲームのクラス設計ってどうやればいいんだろう.ってよく考えるけど,いいのが思いつかない…. #include <map> #include <boost/shared_ptr.hpp> #include <boost/weak_ptr.hpp> const unsigned SCREEN_TITLE = 0x0000; const unsigned SCREEN_MENU = 0x0001; enum message { msg_null, msg_change_scr</boost/weak_ptr.hpp></boost/shared_ptr.hpp></map>…

const

etc

「最近言及したキーワード」にconstがついててワラタw