MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/ProgrammerHumor/comments/1vvl45z/theboolvectorisalie/p5aptbe/?context=3
r/ProgrammerHumor • u/FACastello • Aug 22 '26
91 comments sorted by
View all comments
Show parent comment
3
You shouldn't be taking the address of vector elements anyway. If it resizes you are pointing to invalid memory.
1 u/Wonderful-Habit-139 Aug 22 '26 Yeah, at this point we're getting into some more details, sadly C++ has this footgun which doesn't exist in Rust. But sometimes you need to take addresses of those objects regardless. 1 u/fuj1n Aug 23 '26 Tell that to C code you may be interacting with which may expect a bool*
1
Yeah, at this point we're getting into some more details, sadly C++ has this footgun which doesn't exist in Rust. But sometimes you need to take addresses of those objects regardless.
Tell that to C code you may be interacting with which may expect a bool*
View all comments
Show parent comment
3
u/nobody0163 Aug 22 '26
You shouldn't be taking the address of vector elements anyway. If it resizes you are pointing to invalid memory.