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

FC++ map

C++

リストの全要素に対する操作を行う #include <iostream> #include <iterator> #include <algorithm> #include <boost/fcpp/prelude.hpp> using namespace std; using namespace boost::fcpp; int main() { list<int> ls = list_with<>()(3, 1, 4); ls = map(inc, ls); // 全要素を+1 copy(ls.begin(), ls.end(), ostream_i</int></boost/fcpp/prelude.hpp></algorithm></iterator></iostream>…