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

Method compare

Exercises/Modules/Chapter 12/Soln12_03/Integer.cpp:34–42  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

32}
33
34int Integer::compare(const Integer& obj) const
35{
36 if (m_value < obj.m_value)
37 return -1;
38 else if (m_value == obj.m_value)
39 return 0;
40 else
41 return 1;
42}
43
44void Integer::show() const
45{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected