| 26 | >; |
| 27 | |
| 28 | int main() |
| 29 | { |
| 30 | const Book effectiveCpp{"Effective C++", "978-3-16-148410-0"}; |
| 31 | const Book fpCpp{"Functional Programming in C++", |
| 32 | "978-3-20-148410-0"}; |
| 33 | |
| 34 | const Price normal{34.95}; |
| 35 | const Price reduced{24.95}; |
| 36 | |
| 37 | // #A Use the map with Price as value |
| 38 | MapBookSortedByIsbn<Price> book2Price{ |
| 39 | {{effectiveCpp, reduced}, |
| 40 | {fpCpp, normal}}, // #B Add some items to it |
| 41 | cmp // #C Sadly we have to know and pass the cmp function |
| 42 | }; |
| 43 | |
| 44 | for(const auto& [k, v] : book2Price) { |
| 45 | printf("%s %s %f\n", k.title.c_str(), k.isbn.c_str(), v.amount); |
| 46 | } |
| 47 | } |
nothing calls this directly
no outgoing calls
no test coverage detected