aboutsummaryrefslogtreecommitdiff
path: root/code
diff options
context:
space:
mode:
authorGinger Bill <bill@gingerbill.org>2017-02-06 20:23:51 +0000
committerGinger Bill <bill@gingerbill.org>2017-02-06 20:23:51 +0000
commitc126339090a57ab29a2c75d3ee79333cf3c88278 (patch)
treedd20f3a4cfe045f36d000ac9f68a9c74f77d44bb /code
parent9f2d9b596dab3f1409a92f218c3fc07a4839b295 (diff)
dynamic `map` insertion and lookup
Diffstat (limited to 'code')
-rw-r--r--code/demo.odin7
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);
}