| 23 | } |
| 24 | |
| 25 | int main() |
| 26 | { |
| 27 | Box box1{2, 3, 4}; |
| 28 | std::cout << "box1 is " << box1 << std::endl; |
| 29 | testBox(box1); |
| 30 | |
| 31 | std::cout << std::endl;; |
| 32 | |
| 33 | Box box2{0, 0, 0}; |
| 34 | std::cout << "box2 is " << box2 << std::endl; |
| 35 | testBox(box2); |
| 36 | |
| 37 | // bool b1{ box1 }; /* Does not compile! */ |
| 38 | bool b2{ static_cast<bool>(box2) }; // Needs an explicit type conversion |
| 39 | } |