CppIterators 阶乘示例 int64_t factorial ( int64_t x) { return Iter::Range ( int64_t ( 1 ), x). Product (); } int main () { for ( auto [i, x] : Iter::Range ( 2 ). Map (factorial). Take ( 10 ). Enumerate ( 1 )) std::cout << i << " ! = \t " << x << " \n " ; } 代码显示: 1! = 1 2