{"version":"1.0","blog_url":"https://inamori.hateblo.jp/","published":"2010-09-25 00:00:00","title":"iterate","description":"iterate(x, f)\u3067x, f(x), f(f(x)), ...\u3068\u51fa\u3057\u307e\u3059\u3002unfold\u3067\u3082\u5b9f\u73fe\u53ef\u80fd\u3060\u3051\u3069\u3001\u3081\u3093\u3069\u3046\u306a\u306e\u3067\u3002 template<typename T, typename U> class cIterate : public cIterable<T> { T current; U func; bool first; public: cIterate(T x, U f) : current(x), func(f), first(true) { } bool exists_next() { if(first) first = false; else current = func\u2026","blog_title":"inamori\u2019s diary","provider_url":"https://hatena.blog","html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Finamori.hateblo.jp%2Fentry%2F20100925%2Fp1\" title=\"iterate - inamori\u2019s diary\" class=\"embed-card embed-blogcard\" scrolling=\"no\" frameborder=\"0\" style=\"display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;\"></iframe>","author_name":"inamori","image_url":null,"width":"100%","categories":["C++"],"provider_name":"Hatena Blog","height":"190","author_url":"https://blog.hatena.ne.jp/inamori/","type":"rich","url":"https://inamori.hateblo.jp/entry/20100925/p1"}