| 20 | using MapBookSortedByIsbn = std::map<Book, VALUE, decltype(cmp)>; |
| 21 | |
| 22 | int 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 | } |
nothing calls this directly
no outgoing calls
no test coverage detected