2020-02-26 10:24:27 +08:00
|
|
|
const std = @import("std");
|
|
|
|
|
|
|
|
test "fixed" {
|
|
|
|
var s: S = .{
|
|
|
|
.a = 1,
|
|
|
|
.b = .{
|
|
|
|
.size = 123,
|
|
|
|
.max_distance_from_start_index = 456,
|
|
|
|
},
|
|
|
|
};
|
2021-05-05 02:23:22 +08:00
|
|
|
try std.testing.expect(s.a == 1);
|
|
|
|
try std.testing.expect(s.b.size == 123);
|
|
|
|
try std.testing.expect(s.b.max_distance_from_start_index == 456);
|
2020-02-26 10:24:27 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
const S = struct {
|
|
|
|
a: u32,
|
|
|
|
b: Map,
|
|
|
|
|
2020-02-26 10:32:03 +08:00
|
|
|
const Map = StringHashMap(*S);
|
2020-02-26 10:24:27 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
pub fn StringHashMap(comptime V: type) type {
|
|
|
|
return HashMap([]const u8, V);
|
|
|
|
}
|
|
|
|
|
|
|
|
pub fn HashMap(comptime K: type, comptime V: type) type {
|
2021-06-20 09:10:22 +08:00
|
|
|
if (false) {
|
|
|
|
K;
|
|
|
|
V;
|
|
|
|
}
|
2020-02-26 10:24:27 +08:00
|
|
|
return struct {
|
|
|
|
size: usize,
|
|
|
|
max_distance_from_start_index: usize,
|
|
|
|
};
|
|
|
|
}
|