diff options
| author | DanielGavin <danielgavin5@hotmail.com> | 2025-07-13 11:15:43 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-07-13 11:15:43 +0200 |
| commit | bbb3bc903e241e63e36552d6707b41eab926b419 (patch) | |
| tree | 54c89c3862ae6dfddcfdda9e8a6d7783de5d73eb | |
| parent | 40ac674137a6511f9cae3d4614f8f18bf6a446d9 (diff) | |
| parent | 4c1c288d2d81c4ae87b39ff5bde9eacf5917b30a (diff) | |
Merge pull request #739 from FourteenBrush/patch-1
Backport `intrinsics.type_enum_is_contiguous` (https://github.com/odiā¦
| -rw-r--r-- | builtin/intrinsics.odin | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/builtin/intrinsics.odin b/builtin/intrinsics.odin index f8c1fa7..ca39050 100644 --- a/builtin/intrinsics.odin +++ b/builtin/intrinsics.odin @@ -270,6 +270,10 @@ type_is_subtype_of :: proc($T, $U: typeid) -> bool --- type_field_index_of :: proc($T: typeid, $name: string) -> uintptr --- +// "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, ) -> ( |