MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/ProgrammerHumor/comments/1xxfw9i/cppanditsvectorbooleans/19sqf87uqa010/?context=3
r/ProgrammerHumor • u/Recent-Analysis-6880 • 11d ago
214 comments sorted by
View all comments
Show parent comment
9
and if you want byte-aligned behaviour why not just use a vector<uint8_t> and bitshift/mask
Because we have a type system, and I don't want to have to abuse it just to get under some quirky behavior.
also it’s the dynamically allocated version of a std::bitset
Having a std::dynamic_bitset would be great. See e.g. the boost implementation.
Calling it a std::vector is the problem. It's too different from other std:: vectors, which is evident in that it has this huge exception status.
so I think this actually makes sense as long as you know the quirks before making assumption…
This is true for nearly every bad design in programming languages.
1 u/SirPriseTheEigth 10d ago Well knowing the quirks is what keeps us in a job…
1
Well knowing the quirks is what keeps us in a job…
View all comments
Show parent comment
9
u/Drugbird 10d ago
Because we have a type system, and I don't want to have to abuse it just to get under some quirky behavior.
Having a std::dynamic_bitset would be great. See e.g. the boost implementation.
Calling it a std::vector is the problem. It's too different from other std:: vectors, which is evident in that it has this huge exception status.
This is true for nearly every bad design in programming languages.