# std.mem.eql: make comparisons for zero-sized and non-sized types work · gitcafe/zig

[View on GitCafe](https://git.cafe/gitcafe/zig/commit/a3342cea188e1c006b20dd2e4712398f9e8c7fdd)

Repository: [gitcafe/zig](https://git.cafe/gitcafe/zig)

Visibility: public

Requested revision: a3342cea188e1c006b20dd2e4712398f9e8c7fdd

Requested commit: a3342cea188e1c006b20dd2e4712398f9e8c7fdd

Commit: a3342cea188e1c006b20dd2e4712398f9e8c7fdd

Tree: 49450a37ecbe9df4bbe0da4ba471425358e31dc2

Author: Andrew Kelley

Committer: Andrew Kelley

## Message

```
std.mem.eql: make comparisons for zero-sized and non-sized types work

The `if (@sizeOf(T) == 0) return true;` check simply doesn't work for a number
of cases so that is removed and changed into `@sizeOf(T) != 0` and then
used in the `eqlBytes` check chain to make comparing `enum{}`s possible.

The rest special-cases for comptime-only types and undefined to make
those comparisons possible as well.

Fixes #19929

```

## Parents

- [73dcd1914071984c5a2e7c195212404824dbfb9e](https://git.cafe/gitcafe/zig/commit/73dcd1914071984c5a2e7c195212404824dbfb9e?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zig/tree/a3342cea188e1c006b20dd2e4712398f9e8c7fdd?format=markdown)
