| 31 | #endif |
| 32 | |
| 33 | int main() |
| 34 | { |
| 35 | #if(__cpp_generic_lambdas >= 201707) |
| 36 | const Book effectiveCpp{"Effective C++", "978-3-16-148410-0"}; |
| 37 | const Book fpCpp{"Functional Programming in C++", "978-3-20-148410-0"}; |
| 38 | |
| 39 | const Magazine ix{"iX", "978-3-16-148410-0"}; |
| 40 | const Magazine overload{"overload", "978-3-20-148410-0"}; |
| 41 | |
| 42 | const Price normal{34.95}; |
| 43 | const Price reduced{24.95}; |
| 44 | |
| 45 | MapSortedByIsbn<Book, Price> book2Price{{effectiveCpp, reduced}, {fpCpp, normal}}; |
| 46 | MapSortedByIsbn<Magazine, Price> magazine2Price{{ix, reduced}, {overload, normal}}; |
| 47 | |
| 48 | for(const auto& [k, v] : book2Price) { |
| 49 | printf("%s %s %f\n", k.title.c_str(), k.isbn.c_str(), v.amount); |
| 50 | } |
| 51 | |
| 52 | #else |
| 53 | # pragma message("not supported") |
| 54 | #endif |
| 55 | } |
nothing calls this directly
no outgoing calls
no test coverage detected