From 7bfe8d4bbfac524a3f3844f0dfbc19b736e3d208 Mon Sep 17 00:00:00 2001 From: blueloveTH Date: Mon, 13 May 2024 16:50:56 +0800 Subject: [PATCH] Update common.h --- include/pocketpy/common.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/pocketpy/common.h b/include/pocketpy/common.h index e065cf63..82a775f4 100644 --- a/include/pocketpy/common.h +++ b/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; })