2

これはコンパイルされません:

auto out = view::closed_iota(1,100)
                | view::filter([](auto item){ return item % 10; })
                | view::chunk(10);

for (auto&& rng : out) {
    std::cout << rng << "\n";
}

エラー:

In file included from <source>:4:
/opt/compiler-explorer/libs/rangesv3/trunk/include/range/v3/view/chunk.hpp:144:36: error: no matching function for call to object of type 'const _end_::fn'
                return adaptor{n_, ranges::end(this->base())};
                                   ^~~~~~~~~~~

godbolt.org/g/PhcdGc


この動作の背後にある概念は何ですか?

これがこのような概念を満たさない場合、アラートが表示されないのはなぜですか?

4

1 に答える 1