0
Fork 0
mirror of https://codeberg.org/ziglang/zig synced 2026-11-18 07:05:05 +00:00
zig/lib
Ryan Liptak 7e07df06a4 ComptimeStringMap: expose kvs array in returned struct
Allows for iterating over the kvs when constructing with a list literal instead of having to create a separate array to pass into ComptimeStringMap in order to maintain access to the values.

For example when making a set, before in order to loop over the kvs you'd have to do something like:

    const MyKV = struct { @"0": []const u8 };
    const kvs: []const MyKV = &[_]MyKV{ .{ @"0" = "foo"}, .{ @"0" = "bar" } };
    const map = ComptimeStringMap(void, kvs);
    for (kvs) |kv| {}

whereas now it's possible to do:

    const map = ComptimeStringMap(void, .{ .{"foo"}, .{"bar"} });
    for (map.kvs) |kv| {}
History 2021-08-13 16:22:56 -07:00
..
include llvm12: sync with llvmorg-12.0.0-rc2 2021-02-26 13:44:33 -08:00
libc Update x86_64-macos headers 2021-08-05 00:56:32 +02:00
libcxx llvm12: sync with llvmorg-12.0.0-rc2 2021-02-26 13:44:33 -08:00
libcxxabi llvm12: sync with llvmorg-12.0.0-rc2 2021-02-26 13:44:33 -08:00
libunwind llvm12: sync with llvmorg-12.0.0-rc2 2021-02-26 13:44:33 -08:00
std ComptimeStringMap: expose kvs array in returned struct 2021-08-13 16:22:56 -07:00
tsan stage2: fix Cache deadlock and build more of TSAN 2020-12-24 01:18:48 -07:00