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

Function main

03.19-rangesCustomAdaptor0/main.cpp:10–22  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

8#include <vector>
9
10int main()
11{
12 std::string suffix{"EUR"};
13 const std::vector prices{3.95, 6.0, 95.4, 10.95, 12.90, 5.50};
14
15 auto subView =
16 prices |
17 std::views::filter([](auto e) { return e < 10.00; }) |
18 std::views::transform(
19 [suffix](auto i) { return std::to_string(i) + suffix; });
20
21 for(const auto& e : subView) { std::cout << e << '\n'; }
22}

Callers

nothing calls this directly

Calls 1

to_stringFunction · 0.50

Tested by

no test coverage detected