diff options
| author | FourteenBrush <74827262+FourteenBrush@users.noreply.github.com> | 2025-07-13 00:28:02 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-07-13 00:28:02 +0200 |
| commit | 4c1c288d2d81c4ae87b39ff5bde9eacf5917b30a (patch) | |
| tree | 930b77a3bf4e859e8cf86043eed7f138c9ee3c9b /builtin | |
| parent | 3499fc72369763f6b20e39844a274c32e05f9d80 (diff) | |
Backport `intrinsics.type_enum_is_contiguous` (https://github.com/odin-lang/Odin/pull/5455)
Diffstat (limited to 'builtin')
| -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, ) -> ( |