Lecture 6 - Slide 15 : 40 |
vector<bool> is a specialization of vector<T> that provides for compact representation of boolean vectors
vector<bool> complements the fixed-typed container bitset<N>
#include <iostream> #include <vector> int main(){ using namespace std; vector<bool> vb; vb.push_back(true); vb.push_back(true); vb.push_back(false); vb.push_back(false); vb.push_back(false); vb.push_back(true); for(auto be: vb) cout << be; // 110001 }