[phobos] phobos commit, revision 1740

Jonathan M Davis jmdavisprog at gmail.com
Thu Jul 8 22:25:48 PDT 2010


> Also added specialization of Array for bool that stores
> one bit per element.

_Please_ tell me that's optional in some manner. I don't know _anyone_ who uses 
vector<bool> in C++ _precisely_ because of this optimization. I don't think that 
I've ever talked to anyone who thought that vector<bool> being special in that 
manner was a good thing. And because no one uses vector<bool> makes vector 
useless for bools. I have no problem whatsoever with a special version of Array 
which you can decide to use if you _want_ Array!bool to use only one bit per 
element, but I'd _hate_ to see that be the general case or for it happen to the 
programmer without requesting it. So, a separate BoolArray (or even better, 
BitArray) or some sort of version of Array that somehow allowed you to choose 
whether you wanted bools to be normal-sized or bit-sized would be fine with me, 
but _please_ don't make Array!bool contain anything other than normal bools by 
default.

- Jonathan M Davis


More information about the phobos mailing list