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

Function main

03.29-rangesCustomTakeView1/main.cpp:85–93  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

83}
84
85int main()
86{
87 auto is_even = [](int const n) { return n % 2 == 0; };
88
89 std::vector<int> n{2, 3, 5, 6, 7, 8, 9};
90 auto v = n | rv::filter(is_even) | views::custom_take(2);
91 std::ranges::copy(v,
92 std::ostream_iterator<int>(std::cout, " "));
93}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected