Neat project: add pointer capability to std.bitmanip.bitfields
deadalnix via Digitalmars-d
digitalmars-d at puremagic.com
Fri Dec 4 15:38:08 PST 2015
On Friday, 4 December 2015 at 10:31:19 UTC, Vladimir Panteleev
wrote:
> I realized this was off after posting but I don't understand
> your reasoning either. The size and alignment just put a bound
> on the number of bits, but without verification in the setter
> you can't be sure, right?
If one of the bit within the alignment is not 0, that mean you
did something unsafe previously to create that pointer. There
should be no safe way (and I know of no safe way) to create such
a pointer.
In fact, some hardware will outright fault if you try to
manipulate unaligned data.
More information about the Digitalmars-d
mailing list