| ... | @@ -42,6 +42,11 @@ pub fn HashMap(comptime K: type, comptime V: type, comptime hash: fn (key: K) u3 | ... | @@ -42,6 +42,11 @@ pub fn HashMap(comptime K: type, comptime V: type, comptime hash: fn (key: K) u3 |
| 42 | | 42 | |
| 43 | const Self = @This(); | 43 | const Self = @This(); |
| 44 | | 44 | |
| | 45 | /// A *KV is a mutable pointer into this HashMap's internal storage. |
| | 46 | /// Modifying the key is undefined behavior. |
| | 47 | /// Modifying the value is harmless. |
| | 48 | /// *KV pointers become invalid whenever this HashMap is modified, |
| | 49 | /// and then any access to the *KV is undefined behavior. |
| 45 | pub const KV = struct { | 50 | pub const KV = struct { |
| 46 | key: K, | 51 | key: K, |
| 47 | value: V, | 52 | value: V, |