FC++ compose + tail

こんなのもできるみたい

#include <iostream>
#include <boost/fcpp/prelude.hpp>

using namespace boost::fcpp;

int main()
{
    list<int> ls = enum_from_to(1, 5);

    ls = compose(tail, tail)(ls); // 3, 4, 5

    while (ls) {
        std::cout << head(ls) << std::endl;
        ls = tail(ls);
    }

    return 0;
}


FC++ まとめ