Why do I get the error: invalid initialization of non-const reference of type ‘bool&’ from an rvalue of type ‘std::vector::reference {aka std::_Bit_reference}’?
<
Normally, what you've assumed is the case, for literally any vector except vector. The original C++98 standard specified that as a bit-packed vector, and so references to the individual elements are impossible.
This has since been recognized as an inconvenient mistake, but backward compatibility means that it can't be changed now.