Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/Apress/beginning-cpp20
/ compare
Method
compare
Examples/NoModules/Chapter 13/Ex13_10/Box.h:19–24 ·
view source on GitHub ↗
Source
from the content-addressed store, hash-verified
17
}
18
19
int compare(const Box& box) const
20
{
21
if (volume() < box.volume()) return -1;
22
if (volume() == box.volume()) return 0;
23
return +1;
24
}
25
26
friend std::ostream& operator<<(std::ostream& out, const Box& box)
27
{
Callers
2
main
Function · 0.45
main
Function · 0.45
Calls
1
volume
Method · 0.45
Tested by
no test coverage detected