vector<bool> [Was Re: std::bitset woes]
I was going to start a new thread on use of vector<bool> versus other methods but since it was brought up here and is related I will continue.
Is vector<bool> still not deprecated?
I know there are articles warning against it's use (Meyers/Sutter) and that it breaks container & iterator rules but while I am aware of these facts I can see a solid use for the type.
As mentioned I am writing a huffman encoder. I can see several possible routes for storing of the bitstream while it is being constructed:
1) Store the bitstream as vector<bool> or
2) as vector<unsigned char> or
3) Create a class called bitstream that will allow me to pop and push bits and handle everything in the background. Because random access isn't necessary this could be based on a queue rather than a vector.
Because I will need eventual access to the stream as-is I am leaning towards 2 & 3.
Thanks, Graham Reeds.