diff options
| author | FourteenBrush <74827262+FourteenBrush@users.noreply.github.com> | 2025-07-11 17:03:49 +0200 |
|---|---|---|
| committer | FourteenBrush <74827262+FourteenBrush@users.noreply.github.com> | 2025-07-11 17:03:49 +0200 |
| commit | 8cbf75c928e91a93fbd0ab48877c5f32afa3a9f4 (patch) | |
| tree | ca0225b76d0ec0e58fe22eba6a604fb0d96f2257 /base | |
| parent | 5ce8d1ede834134ec7fd71c62738791c2d36e171 (diff) | |
Add type_enum_is_contiguous intrinsic
Diffstat (limited to 'base')
| -rw-r--r-- | base/intrinsics/intrinsics.odin | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/base/intrinsics/intrinsics.odin b/base/intrinsics/intrinsics.odin index c1d16c5e4..20a7f4a84 100644 --- a/base/intrinsics/intrinsics.odin +++ b/base/intrinsics/intrinsics.odin @@ -213,6 +213,9 @@ 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 values is only 0 or 1 +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) --- type_hasher_proc :: proc($T: typeid) -> (hasher: proc "contextless" (data: rawptr, seed: uintptr) -> uintptr) where type_is_comparable(T) --- |