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

Method operator<=>

Examples/NoModules/Chapter 13/Ex13_09/Box.h:27–30  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

25 double getHeight() const { return m_height; }
26
27 std::partial_ordering operator<=>(const Box& otherBox) const
28 {
29 return volume() <=> otherBox.volume();
30 }
31 std::partial_ordering operator<=>(double otherVolume) const
32 {
33 return volume() <=> otherVolume;

Callers

nothing calls this directly

Calls 1

volumeMethod · 0.45

Tested by

no test coverage detected