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

Function main

07.07-mapSortBooksByIsbn1/main.cpp:22–38  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

20using MapBookSortedByIsbn = std::map<Book, VALUE, decltype(cmp)>;
21
22int main()
23{
24 const Book effectiveCpp{"Effective C++", "978-3-16-148410-0"};
25 const Book fpCpp{"Functional Programming in C++", "978-3-20-148410-0"};
26
27 const Price normal{34.95};
28 const Price reduced{24.95};
29
30 MapBookSortedByIsbn<Price> book2Price{
31 {effectiveCpp, reduced}, {fpCpp, normal}
32 // #A cmp is gone
33 };
34
35 for(const auto& [k, v] : book2Price) {
36 printf("%s %s %f\n", k.title.c_str(), k.isbn.c_str(), v.amount);
37 }
38}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected