bitflags: several changes
bitflags: several changes

* byte is an odd choice for the units of a bit vector: we care that it's a bag of bits, there's no reason to use the "fundamental unit of addressable storage" type. Use the symbolic type "unit", currently a typedef for unsigned int so set(from, to, value) can process bigger chunks, instead of byte.

* sizeof(byte) is not the number of bits in a unit; it is a complicated spelling of 1. bitflags is therefore CHAR_BIT times as large as it needs to be. Replace uses of sizeof(byte) with bits_per_unit which is sizeof(unit) * CHAR_BIT.

* Factor the complex "bit addressing" expressions into separate functions to simplify.

* Use std::unique_ptr<unit[]> for bit storage instead of std::vector<unit>; some guy said in a talk at CPPCon that we're supposed to use std::unique_ptr<T[]> to "express a fixed-but-dynamic-size member array" ;)

* Improve codegen for set(from, to, value) by implementing the head and tail loops in O(1) with bit shift/mask operations.

hsutter/gcpp,hsutter/gcpp