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