C++ Standard Library vector<bool> Sample

Description

vector<bool> is a specialization of vector, that represents boolean values (bits) efficiently. The usual vector operations are available, such as push_back(), iterators, and subscripting with [].

Declaration

	template <class A>
	    class vector<bool, A>;

Concept

The sample program defines a vector<bool> object, and pushes some boolean values onto it. The first value is changed using [], and then the values are printed twice, once using [], and once with iterators.

Special Notes:

bitset is an alternative way of representing bit sequences.

Supported
Supported
Supported