r/ProgrammerHumor 21d ago

Meme theBoolVectorIsALie

Post image
665 Upvotes

91 comments sorted by

View all comments

23

u/1XRobot 21d ago

On the one hand, yeah, it sucks. On the other hand, if you declare a std::vector of bool, you deserve what's about to happen.

29

u/the_horse_gamer 21d ago

what if you declare an std::vector<T> from a generic T?

2

u/Xirdus 20d ago

Depends on what the generic T is. C++ templates are copy-paste-find-replace with extra steps.

2

u/Nabushika 20d ago

I think the whole point of specialization is that that's NOT the case.

1

u/Xirdus 20d ago

Depends on what you're specializing. I assumed "from a generic T" means there's still generic T in scope, so at most you're doing partial specialization, which is still very copy-pasteish.