2007-11-27から1日間の記事一覧

boost::assign使ってみた

C++

#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やってて、戻り値にlis</int></boost/assign/std/vector.hpp></shand/foreach.hpp></vector></iostream>…