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

Function main

03.15-rangesProjection0/main.cpp:9–26  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 2

beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected