Explorar o código

Update common.h

blueloveTH hai 1 ano
pai
achega
7bfe8d4bbf
Modificáronse 1 ficheiros con 1 adicións e 0 borrados
  1. 1 0
      include/pocketpy/common.h

+ 1 - 0
include/pocketpy/common.h

@@ -103,6 +103,7 @@ struct Type {
 	bool operator==(Type other) const { return this->index == other.index; }
 	bool operator!=(Type other) const { return this->index != other.index; }
     constexpr operator int() const { return index; }
+    constexpr operator bool() const { return index != 0; }
 };
 
 #define PK_LAMBDA(x) ([](VM* vm, ArgsView args) { return x; })