r/ProgrammerHumor • • 16d ago

Meme cppAndItsVectorBooleans

Post image
3.4k Upvotes

214 comments sorted by

View all comments

Show parent comment

1

u/4xe1 11d ago

Isn't that the other way around? I'd expect std::vector<uint8_t> to play a lot nicer with templates than std::vector<bool>

1

u/dedservice 11d ago

Yes exactly. But if you're writing template code and don't know who's going to call it, you have to create specific carve-outs or overloads for vector<bool>, where if the designers had just let that be normal, you wouldn't need that special-case handling.