D-Programming-Language/phobos — pull request #1045 by rtcvb32 (2013-01-01 10:04:49+00:00)
Title: Bit array updates

issues dealt with:
4935 - std.bitmanip: bitfields!() template with trailing unnamed field does not work
8474 - bitfields doesn't work with 32 bit fields
6686 - bitmanip bitfields are broken at 64 bits
5942 - bitfields overwritten erroneously:
5520 - bitfieldsOn
4425 - More bells & whistles for bitfields
8876 - bitfields template generate wrong code

Added static check to revert a bitfield to normal type if it is the only
one (and at full size). 32bit as first field no longer errors. Bitfields
should be separated and the no longer overwrite the whole thing (masking
fixed).

bitfields are now pure, safe and nothrow.

bitfieldsOn added (not pure).

bitfields now allow const as part of it's signature for a bitfield;
Namely the setter will be absent.

for bitfieldsOn template, it should (when referencing a variable)
determine if it's a acceptible data type, and if it's big enough for the
fields. Since stringof doesn't reference it's whole path, a text 'raw'
version is supplied as well for bitfieldsOn (but doesn't do the checks).

Constraints added to bitfieldsOn to only accept built in types, non
float.

Changed to one calling convention regarding the variable (as a string),
type checking improved, unittests for valid types fixed.