MCPcopy Create free account
hub / github.com/Apress/beginning-cpp20 / operator<=>

Method operator<=>

Examples/NoModules/Chapter 20/Ex20_12A/Box.h:20–23  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

18 double getHeight() const { return m_height; }
19
20 std::partial_ordering operator<=>(const Box& otherBox) const
21 {
22 return volume() <=> otherBox.volume();
23 }
24 std::partial_ordering operator<=>(double otherVolume) const
25 {
26 return volume() <=> otherVolume;

Callers

nothing calls this directly

Calls 1

volumeMethod · 0.45

Tested by

no test coverage detected