| author | |
| committer | |
| log | fde7165927efa40fb5ab392c171dcfb06396e5cb |
| tree | cad37090371d3d343fb1e360569c685babeeeaec |
| parent | e609abac9f01ff0f54ca928feb0bec165cd6eebf |
1 files changed, 9 insertions(+), 0 deletions(-)
src/lib.zig+9| ... | ... | @@ -680,3 +680,12 @@ pub fn ReverseFields(comptime T: type) type { |
| 680 | 680 | pub fn stringToEnum(comptime E: type, str: ?string) ?E { |
| 681 | 681 | return std.meta.stringToEnum(E, str orelse return null); |
| 682 | 682 | } |
| 683 | ||
| 684 | pub fn containsAggregate(comptime T: type, haystack: []const T, needle: T) bool { | |
| 685 | for (haystack) |item| { | |
| 686 | if (T.eql(item, needle)) { | |
| 687 | return true; | |
| 688 | } | |
| 689 | } | |
| 690 | return false; | |
| 691 | } |