16.12 — std::vector<bool>

In lesson , we discussed how std::bitset has the capability to compact 8 Boolean values into a byte. Those bits can then be modified via the member functions of std::bitset. std::vector has an interesting trick up its sleeves. There is a special implementation for std::vector<bool> that may be more space …

16.4 — Passing std::vector

An object of type std::vector can be passed to a function just like any other object. That means if we pass a std::vector by value, an expensive copy will be made. Therefore, we typically pass std::vector by (const) reference to avoid such copies. With a std::vector, the element type is …