UInt.bt

struct UInt(size_t size)
const @safe pure nothrow @nogc
bool
bt
()
(
size_t position
)
if (
size % (size_t.sizeof * 8) == 0 &&
size >= (size_t.sizeof * 8)
)

Examples

auto a = UInt!128.fromHexString("afbbfae3cd0aff2714a1de7022b0029d");
assert(a.bt(127) == 1);
assert(a.bt(126) == 0);
assert(a.bt(125) == 1);
assert(a.bt(124) == 0);
assert(a.bt(0) == 1);
assert(a.bt(1) == 0);
assert(a.bt(2) == 1);
assert(a.bt(3) == 1);

Meta