| 16 | } |
| 17 | |
| 18 | int main() |
| 19 | { |
| 20 | const std::vector boxes {Box {2.0, 1.5, 3.0}, Box {1.0, 3.0, 5.0}, |
| 21 | Box {1.0, 2.0, 1.0}, Box {2.0, 3.0, 2.0}}; |
| 22 | const Box theBox {3.0, 1.0, 4.0}; |
| 23 | |
| 24 | for (const auto& box : boxes) |
| 25 | if (theBox > box) show(theBox, " is greater than ", box); // > works |
| 26 | |
| 27 | std::cout << std::endl; |
| 28 | |
| 29 | for (const auto& box : boxes) |
| 30 | if (theBox != box) show(theBox, " is not equal to ", box); // != works |
| 31 | |
| 32 | std::cout << std::endl; |
| 33 | |
| 34 | for (const auto& box : boxes) |
| 35 | if (6.0 <= box) // Yes, even double <= Box works!! |
| 36 | { std::cout << "6 is less than or equal to "; show(box); std::cout << std::endl; } |
| 37 | } |