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

Function main

03.17-rangesProjection1/main.cpp:10–24  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

8#include <vector>
9
10int main()
11{
12 struct Book {
13 std::string title;
14 std::string isbn;
15 };
16
17 std::vector<Book> books{
18 {"Functional Programming in C++", "978-3-20-148410-0"},
19 {"Effective C++", "978-3-16-148410-0"}};
20
21 std::ranges::sort(books, {}, &Book::title);
22
23 for(const auto& book : books) { std::cout << book.title << '\n'; }
24}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected