[phobos] phobos commit, revision 1740

Jonathan M Davis jmdavisprog at gmail.com
Fri Jul 9 00:02:07 PDT 2010


On Thursday 08 July 2010 23:17:22 Andrei Alexandrescu wrote:
> On 07/09/2010 12:25 AM, Jonathan M Davis wrote:
> >> 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.
> 
> I am well aware of vector<bool>'s problems and designed Array!bool very
> carefully to avoid each and all of them.
> 
> Andrei
> _______________________________________________
> phobos mailing list
> phobos at puremagic.com
> http://lists.puremagic.com/mailman/listinfo/phobos

Well, I would have thought that you'd have been aware of the issue, but since 
I've never heard of anyone thinking that doing anything other than just making 
vector<bool> function like it would with vector<int> or vector<string> or 
whatever, I was very surprised to see that you would consider doing something 
similar with Array!bool. Now, if you're sure that you've managed to avoid the 
issues that exist with vector<bool>, then that's fine, but I'd hate for D to have 
the same problems with Array!bool that C++ has with vector<bool>.

- Jonathan M Davis


More information about the phobos mailing list