diff options
| author | Ginger Bill <bill@gingerbill.org> | 2017-02-06 20:23:51 +0000 |
|---|---|---|
| committer | Ginger Bill <bill@gingerbill.org> | 2017-02-06 20:23:51 +0000 |
| commit | c126339090a57ab29a2c75d3ee79333cf3c88278 (patch) | |
| tree | dd20f3a4cfe045f36d000ac9f68a9c74f77d44bb /code | |
| parent | 9f2d9b596dab3f1409a92f218c3fc07a4839b295 (diff) | |
dynamic `map` insertion and lookup
Diffstat (limited to 'code')
| -rw-r--r-- | code/demo.odin | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/code/demo.odin b/code/demo.odin index e3e85769c..d44f7dca3 100644 --- a/code/demo.odin +++ b/code/demo.odin @@ -11,11 +11,12 @@ main :: proc() { - Value :: type f32; - m: map[int]Value; + m: map[int]u32; reserve(^m, 16); defer free(m); - // m[123] = 345.0; + + m[123] = 345; + fmt.println(m[123]); if x, ok := m[123]; ok { fmt.println(x); } |