module nxt.packed;

import nxt.dip_traits : hasPreviewBitfields;

static if (hasPreviewBitfields)			// when -preview=bitfields is passed
{
	struct S(T)
	{
		mixin("T x:2;");
		mixin("T y:2;");
		mixin("T z:2;");
		mixin("T w:2;");
	}
	static assert(S!(ubyte).sizeof == 1);
	static assert(S!(ushort).sizeof == 2);
	static assert(S!(uint).sizeof == 4);
	static assert(S!(ulong).sizeof == 8);
}