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

FC++ compose

C++

複数の関数を合成する高階多相型関数というらしい #include <iostream> #include <iterator> #include <algorithm> #include <boost/fcpp/prelude.hpp> using namespace fcpp; int main() { list<int> ls = list_with<>()(3, 1, 4); ls = map(compose(inc, inc), ls); // 全要素に+2 std::copy(ls.begin(), ls.end(), std:</int></boost/fcpp/prelude.hpp></algorithm></iterator></iostream>…