Closed kirillgrachoff closed 1 year ago
It is rude to write
template <typename T> auto& get_at(std::vector<T>& container, size_t index) { // write to log return container[index]; }
std::vector::operator[] returns _Bit_Reference which cannot be cast to bool& or const bool&
It is also rude to write
T& value = container[index]
because of _Bit_Reference.
My suggestion is: Rename std::vector<bool> to std::dynamic_bitset (or similar) to prevent compile-errors because of std::vector<bool> specialization.
std::vector<bool>
std::dynamic_bitset
Это поломает очень много кода, такая идея не пройдёт голосование
It is rude to write
std::vector::operator[] returns _Bit_Reference which cannot be cast to bool& or const bool&
It is also rude to write
because of _Bit_Reference.
My suggestion is: Rename
std::vector<bool>
tostd::dynamic_bitset
(or similar) to prevent compile-errors because ofstd::vector<bool>
specialization.