MCPcopy Create free account
hub / github.com/andreasfertig/programming-with-cpp20 / main

Function main

03.23-rangesCustomTakeView0/main.cpp:93–101  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

91}
92
93int main()
94{
95 auto is_even = [](int const n) { return n % 2 == 0; };
96
97 const std::vector<int> n{2, 3, 5, 6, 7, 8, 9};
98 auto v = n | rv::filter(is_even) | views::custom_take(2);
99 std::ranges::copy(v,
100 std::ostream_iterator<int>(std::cout, " "));
101}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected