From 48ee567f81916277be97d486d58bce7ddffc2d30 Mon Sep 17 00:00:00 2001 From: Christoffer Lerno Date: Tue, 20 Sep 2022 18:45:43 +0200 Subject: [PATCH] Add types::is_indexable. --- lib/std/core/types.c3 | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/std/core/types.c3 b/lib/std/core/types.c3 index 1426afe7b..8788e460f 100644 --- a/lib/std/core/types.c3 +++ b/lib/std/core/types.c3 @@ -97,6 +97,11 @@ fn bool TypeKind.is_int(TypeKind kind) @inline return kind == TypeKind.SIGNED_INT || kind == TypeKind.UNSIGNED_INT; } +macro bool is_indexable($Type) +{ + return $checks($Type t, int i, t[i]); +} + macro bool is_comparable($Type) { var $kind = $Type.kind;