Rogue Wave banner
Previous fileTop of DocumentContentsIndex pageNext file
Rogue Wave C++ Standard Library User's Guide
Rogue Wave web site:  Home Page  |  Main Documentation Page

5.3 Boolean Vectors

In the Standard C++ Library, vectors of bit values (boolean 1/0 values) are handled as a special case, so that the values can be efficiently packed with several elements to a word. The operations for a boolean vector, vector<bool>, are a superset of those for an ordinary vector, only the implementation is more efficient.

One new member function added to the boolean vector datatype is flip(). When invoked, this function inverts all the bits of the vector. Boolean vectors also return as reference an internal value that also supports the flip() member function:

The vector<bool> also supports an additional swap() member function that allows swapping the values indicated by a pair of references:



Previous fileTop of DocumentContentsIndex pageNext file

Copyright (c) 1994-2006 Rogue Wave Software, a Quovadx Division.
Licensed under the Apache License, Version 2.0.
Contact Rogue Wave about documentation or support issues. You can also seek help from other developers through the Apache stdcxx community (see below).

For more information on the Rogue Wave Standard C++ Library under open source, see Section 1.2.