12 points matt_d 1 month ago 6 comments
MiroslavPokorny 1 month ago | parent
EdSchouten 1 month ago | parent
I think it’s silly that we always need to jump through hoops to declare and interact with bitmaps. Why can’t I just write the following?
bool my_bitmap[1024];
In an ideal world C++ wouldn’t need template specialization to make vector<bool> efficient.
Sacrificing three extra bits in every pointer also wouldn’t really lead to exhaustion of the address space. Intel and ARM CPUs don’t offer a full 64-bit address space anyway.
JdeBP 1 month ago | parent
std::vector<bool> was its own special Hell, because it was invented as a way to try to expose what processors could do, instead of every compiler vendor having its own set of processor-specific intrinsics. Which meant, as Scott Meyers famously said, that it was not a standard container and it didn't contain any actual bools.
The world has long since come up with replacements. There are non-container bit vectors in C++, now, such as std::bitset and boost::dynamic_bitset.
rcxdude 1 month ago | parent
peterfirefly 1 month ago | parent
Neywiny 1 month ago | parent