4 ms·
> > Why can't I just compare these two regions using `A == B` to make sure they are equal? > Why is shallow equality useful? Of course deep equality checks ar
by codethief 4y ago
> > Why can't I just compare these two regions using `A == B` to make sure they are equal?
> Why is shallow equality useful?
Of course deep equality checks are useful, too, I'm not denying that. But in many cases you are not dealing with several layers of structs nested through pointers. You just want to compare simple structs and be done with it, without having to write an eql() function for every single case.
Besides, many other operations in Zig operate directly on the memory, so why should == be any different?