MCPcopy Create free account
hub / github.com/Apress/beginning-cpp20 / main

Function main

Examples/Modules/Chapter 13/Ex13_01/Ex13_01.cpp:6–20  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4import box;
5
6int main()
7{
8 std::vector boxes {Box {2.0, 2.0, 3.0}, Box {1.0, 3.0, 2.0},
9 Box {1.0, 2.0, 1.0}, Box {2.0, 3.0, 3.0}};
10 Box smallBox {boxes[0]};
11 for (const auto& box : boxes)
12 {
13 if (box < smallBox) smallBox = box;
14 }
15
16 std::cout << "The smallest box has dimensions "
17 << smallBox.getLength() << 'x'
18 << smallBox.getWidth() << 'x'
19 << smallBox.getHeight() << std::endl;
20}

Callers

nothing calls this directly

Calls 3

getLengthMethod · 0.45
getWidthMethod · 0.45
getHeightMethod · 0.45

Tested by

no test coverage detected