Explorar el Código

IP4.h: add conditional implementation of operator <=>

If the compiler has it, we can create it very simply, so just do it
with an appropriate #ifdef.
H. Peter Anvin hace 1 año
padre
commit
b6d0beb2b7
Se han modificado 5 ficheros con 5 adiciones y 0 borrados
  1. 5 0
      esp32/max80/IP4.h
  2. BIN
      esp32/output/max80.ino.bin
  3. BIN
      fpga/output/max80.fw
  4. BIN
      fpga/output/v1.fw
  5. BIN
      fpga/output/v2.fw

+ 5 - 0
esp32/max80/IP4.h

@@ -80,6 +80,11 @@ public:
     constexpr bool operator > (const IP4 &b) const {
 	return netswap(l) > netswap(b.l);
     }
+#ifdef __cpp_impl_three_way_comparison
+    constexpr auto operator <=> (const IP4 &b) const {
+	return netswap(l) <=> netswap(b.l);
+    }
+#endif
 
     constexpr IP4 operator & (const IP4 &b) const { return IP4(l & b.l); }
     constexpr IP4 operator | (const IP4 &b) const { return IP4(l | b.l); }

BIN
esp32/output/max80.ino.bin


BIN
fpga/output/max80.fw


BIN
fpga/output/v1.fw


BIN
fpga/output/v2.fw