Boolean vectors – HP Integrity NonStop H-Series User Manual
Page 63
Click on the banner to return to the user guide home page.
©Copyright 1996 Rogue Wave Software
Boolean Vectors
Vectors of bit values (boolean 1/0 values) are handled as a special case by the standard library,
so that the values can be efficiently packed (several elements to a word). The operations for a
boolean vector , vector
implementation is more efficient.
One new member function added to the boolean vector data type 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.
vector
bvec.flip(); // flip all values
bvec[17].flip(); // flip bit 17
vector
values indicated by a pair of references.
bvec.swap(bvec [17], bvec [16]);