Holes in structs and opEquals

Walter Bright newshound1 at digitalmars.com
Mon Mar 8 12:38:45 PST 2010


yigal chripun wrote:
>> Trying to disable == for such structs is a losing battle, anyway,
>> as the compiler could only detect the most obvious cases. Pass a
>> reference to it to a function, store it in a data structure, etc.,
>> and all that goes away.
> 
> Ok, that sound's reasonable if you want to keep the compiler simple
> and fast.

The non-trivial cases are not detectable (halting problem), so it is a 
pointless feature to add.


> another question I have: How would a user initialize the holes and
> doesn't it negate the bebefits of void as optimisation?

The point of =void is to allow the user to determine those tradeoffs 
rather than the compiler.




More information about the Digitalmars-d mailing list