![Amazon.co.jp: Boost C++ Librariesプログラミング第2版: 稲葉一浩: 本](https://cdn-ak-scissors.b.st-hatena.com/image/square/f827d91493b475aeb71ea0a4faf9173a7d402677/height=288;version=1;width=512/https%3A%2F%2Fm.media-amazon.com%2Fimages%2FI%2F51CJG52BCdL._SL500_.jpg)
sample サンプルの動作確認バージョン [GCC4.4/1.41.0] [VC9/1.41.0] #include <string> #include <boost/lexical_cast.hpp> using namespace std; int main() { using boost::lexical_cast; string str_thousand = "1000"; int int_ninety = 90; int a = lexical_cast<int>( str_thousand ); string s = lexical_cast<string>( int_ninety ); // aには1000、sには"90"が入ります。 return 0; } なお、変換出来ない場合は bad_lexical_cast 例外が投げられますので、 ホントはちゃんと try~ca
#include <iostream> #include <vector> #include <shand/foreach.hpp> #include <boost/assign/std/vector.hpp> using namespace std; using namespace boost::assign; int main() { vector<int> v; v += 3, 1, 4; // !!! foreach (int value, v) cout << value << endl; return 0; } +=の中ではpush_backやってて、戻り値にlist_inserterとかいうのを使ってるのでカンマ区切りできるんだってさ 念のためboost::assign使わないコード #include <iostream> #include <vector> #include
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く