Created attachment 1802
example implementation
Such a trait could be used by core.internal.convert.toUbyte() to determine whether it is safe to return all bits of a struct to compute the hash, or does it need to selectively copy all fields.
Rationale: structs that are passed around in registers typically discard any memset() operation done to zero all alignment holes, so comparing all bits for equality may not work.
Attached example implementation.
Comment #1 by ibuclaw — 2020-08-23T22:14:39Z
Created attachment 1803
example implementation - no pragma(msg)
Comment #2 by ibuclaw — 2020-08-24T07:02:11Z
(In reply to Iain Buclaw from comment #1)
> Created attachment 1803 [details]
> example implementation - no pragma(msg)
Example implementation is missing creal and ireal support - should be added to the same condition as is(T == real).
Comment #3 by robert.schadek — 2024-12-01T16:37:32Z