you are viewing a single comment's thread
view the rest of the comments
[–] 24 points 1 year ago (4 children)

Well there are containers that store booleans in single bits (e.g. std::vector<bool> - which was famously a big mistake).

But in the general case you don't want that because it would be slower.

  • source
  • parent
  • hideshow 4 child comments
  • [–] 7 points 1 year ago (3 children)

    Why is this a big mistake? I’m not a c++ person

  • source
  • parent
  • hideshow 3 child comments
  • [–] 5 points 1 year ago (2 children)

    The mistake was that they created a type that behaves like an array in every case except for bool, for which they created a special magical version that behaves just subtly different enough that it can break things in confusing ways.

  • source
  • parent
  • hideshow 2 child comments