I have a std::string of bits like 01001110. How to make it std::vector<bool>?
std::string bits("10101011110");
std::vector<bool> myVec;
myVec.reserve(bits.size());
for(auto a : bits)
myVec.push_back(a == '1');
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With