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

Method operator<=>

Examples/NoModules/Chapter 13/Ex13_04/Box.h:22–25  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 1

volumeMethod · 0.45

Tested by

no test coverage detected