#Thoughts on switching on strings?
1 messages · Page 1 of 1 (latest)
StaticStringMap doesn't need an allocator - use initComptime
example:
test "list literal of list literals" {
const map = TestMap.initComptime(&.{
.{ "these", .D },
.{ "have", .A },
.{ "nothing", .B },
.{ "incommon", .C },
.{ "samelen", .E },
});
try testing.expect(null == map.get("NOTHING"));
}