mirror of
https://github.com/odin-lang/Odin.git
synced 2026-02-12 22:33:36 +00:00
Add reflect.default_map_hash_by_ptr
This commit is contained in:
@@ -2003,4 +2003,14 @@ equal :: proc(a, b: any, including_indirect_array_recursion := false, recursion_
|
||||
runtime.print_typeid(a.id)
|
||||
runtime.print_string("\n")
|
||||
return true
|
||||
}
|
||||
|
||||
|
||||
@(require_results)
|
||||
default_map_hash_by_ptr :: proc(ptr: ^$T, seed: uintptr = runtime.INITIAL_HASH_SEED) -> uintptr where intrinsics.type_is_comparable(T) {
|
||||
assert(ptr != nil)
|
||||
|
||||
info := intrinsics.type_map_info(map[T]struct{})
|
||||
|
||||
return info.key_hasher(ptr, seed)
|
||||
}
|
||||
Reference in New Issue
Block a user