From cb05271157a944c934dd8bf015570f25ebd2eccc Mon Sep 17 00:00:00 2001 From: FourteenBrush <74827262+FourteenBrush@users.noreply.github.com> Date: Fri, 11 Jul 2025 17:17:30 +0200 Subject: [PATCH] Add note on sparse vs contiguous --- base/intrinsics/intrinsics.odin | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/base/intrinsics/intrinsics.odin b/base/intrinsics/intrinsics.odin index dc1690ba8..c0685f4db 100644 --- a/base/intrinsics/intrinsics.odin +++ b/base/intrinsics/intrinsics.odin @@ -213,7 +213,8 @@ type_is_subtype_of :: proc($T, $U: typeid) -> bool --- type_field_index_of :: proc($T: typeid, $name: string) -> uintptr --- -// Contiguous as in having a set of constants, when sorted, the difference between consecutive constants is only 0 or 1 +// "Contiguous" means that the set of enum constants, when sorted, have a difference of either 0 or 1 between consecutive values. +// This is the exact opposite of "sparse". type_enum_is_contiguous :: proc($T: typeid) -> bool where type_is_enum(T) --- type_equal_proc :: proc($T: typeid) -> (equal: proc "contextless" (rawptr, rawptr) -> bool) where type_is_comparable(T) ---