MCPcopy Create free account
hub / github.com/andreasfertig/cppinsights / operator<=>

Method operator<=>

tests/p0515Test.cpp:8–17  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6 int x;
7
8 constexpr auto operator<=>(const int& value) const
9 {
10 if(x == value) {
11 return std::strong_ordering::equal;
12 } else if(value > x) {
13 return std::strong_ordering::less;
14 } else {
15 return std::strong_ordering::greater;
16 }
17 }
18
19 constexpr bool operator==(const int& value) const
20 {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected