cplusplus
.com
TUTORIALS
REFERENCE
ARTICLES
FORUM
C++
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs
Forum
Beginners
Use of Bool Containers
Use of Bool Containers
Dec 7, 2011 at 8:10am UTC
hentaiw
(273)
I know when we store data into containers like vector or deque.
But how about bool vector and such bool containers ?
Please cite some of its usage,thanks in advance.
Dec 7, 2011 at 9:21am UTC
Athar
(4466)
Well, they're containers you can store bools in, there's not much of a difference...
a vector<bool> can be used e.g. for an allocation bitmap of a virtual file system or for the Sieve of Eratosthenes.
Dec 7, 2011 at 9:43am UTC
Gaminic
(1621)
I sometimes use them to represent numbers in binary. I'm not sure whether that's extremely clever or extremely stupid, but it serves its purpose.
Topic archived. No new replies allowed.