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_11/Box.h:20–25 ·
view source on GitHub ↗
Source
from the content-addressed store, hash-verified
18
}
19
20
int compare(const Box& box) const
21
{
22
if (volume() < box.volume()) return -1;
23
if (volume() == box.volume()) return 0;
24
return +1;
25
}
26
27
friend std::ostream& operator<<(std::ostream& out, const Box& box)
28
{
Callers
nothing calls this directly
Calls
1
volume
Method · 0.45
Tested by
no test coverage detected