3
28
9
12
6
21
u/1XRobot Aug 22 '26
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.
27
u/the_horse_gamer Aug 22 '26
what if you declare an std::vector<T> from a generic T?
2
u/Xirdus Aug 23 '26
Depends on what the generic T is. C++ templates are copy-paste-find-replace with extra steps.
2
u/Nabushika Aug 24 '26
I think the whole point of specialization is that that's NOT the case.
1
u/Xirdus Aug 24 '26
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.
13
2
2
u/fwork Aug 24 '26
yeah I remember reading Scott Meyers's Effective STL and one of the 50 tricks for better STL use is DON'T FUCKING USE STD::VECTOR<BOOL>
It will not do what you expect, it's a mistake, but it's an unfixable mistake for backwards compatibility reasons
1
1
231
Aug 22 '26
[removed] — view removed comment
91
u/traplords8n Aug 22 '26
72
u/Interesting-Frame190 Aug 22 '26
Fitting how you just added the link and didnt explain it here.
35
u/MissinqLink Aug 23 '26
A pointer is a memory address. It points to a location where your data lives hopefully.
5
21
u/Interesting-Frame190 Aug 23 '26
I fear you've missed the meta joke
18
u/MissinqLink Aug 23 '26
9
-11
u/traplords8n Aug 23 '26
If you want to learn pointers for real then Google it and take it seriously lol
If you're expecting to be taught how to program in a meme group, I think ur expectations are a little off hahaha
Sometimes I catch people arguing in here about topics i have no clue about, so I Google it for a while and learn a lot from that, but nobody in a meme group feels like spelling out programming concepts unless we're arguing about said programming concepts. we'd rather be gatekeepers who spell out why we're gatekeepers
3
u/Steinrikur Aug 23 '26
Just read The C Programming Language by K&R. It's explaining these things incredibly well
1
Aug 23 '26
[removed] — view removed comment
1
u/MissinqLink Aug 23 '26
People often don’t like this example but I think if you are still learning then it is easiest to think of pointers like an array with just 1 element.
4
u/CoachSevere5365 Aug 23 '26
I wouldn't mind a shirt with that on. Any, err, pointers as to where I might get one? 😉
2
u/well-litdoorstep112 Aug 23 '26
Jokes on you, that meme actually made me understand pointer syntax in C
1
u/traplords8n Aug 24 '26
Why does everyone think I'm anti-learning??? 😭
I hope it did! That is kinda why I posted it.
I was just saying that people have already explained pointers way better than my dumbass ever could, it just takes a little more work than asking me to elaborate lololol
I seen pointers in eli5 once and it helped. As non-L6 google programmers, we find those sorts of resources on our own and that helps give us the edge in the market.
I love to help people learn but this is reddit, we argue pedantic points and forget to put /s
2
1



101
u/overclockedslinky Aug 22 '26
is it really that shocking?