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

FC++ head と tail

C++

head で先頭要素を取得し tail で先頭以外のリストを取得する #include <boost/fcpp/prelude.hpp> using namespace boost::fcpp; int main() { list<int> ls = enum_from_to(1, 5); int hd = head(ls); // 1 list<int> tl = tail(ls); // 2, 3, 4, 5 return 0; } 以下のようにすれば、無限リス</int></int></boost/fcpp/prelude.hpp>…