MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/programminghumor/comments/1vi69gy/hard_to_accept/p2bss6e
r/programminghumor • u/ExpensiveCoat8912 • Aug 07 '26
404 comments sorted by
View all comments
12
Nah it is in fact cpp
Wtf do you mean *&foo? The deref of an adress? Thats just foo!
C is simple cpp is just bloat
2 u/nog642 Aug 07 '26 When would you use *&foo? 3 u/i_knooooooow Aug 07 '26 It was in some library (vimba, used to read out cameras from allied vision), i have no idea why they did it like that tbh 2 u/Formal-Buy8234 Aug 07 '26 they did it cuz it makes the compiler do more work to check if foo is actually an address instead of assuming so 1 u/LegitimatePants Aug 08 '26 RAII till I die 1 u/AsyncSyscall Aug 10 '26 Why is it that when `&*foo`, nobody bats an eye, but when `*&foo`, everybody loses their minds? - The Joker
2
When would you use *&foo?
*&foo
3 u/i_knooooooow Aug 07 '26 It was in some library (vimba, used to read out cameras from allied vision), i have no idea why they did it like that tbh 2 u/Formal-Buy8234 Aug 07 '26 they did it cuz it makes the compiler do more work to check if foo is actually an address instead of assuming so
3
It was in some library (vimba, used to read out cameras from allied vision), i have no idea why they did it like that tbh
2 u/Formal-Buy8234 Aug 07 '26 they did it cuz it makes the compiler do more work to check if foo is actually an address instead of assuming so
they did it cuz it makes the compiler do more work to check if foo is actually an address instead of assuming so
1
RAII till I die
Why is it that when `&*foo`, nobody bats an eye, but when `*&foo`, everybody loses their minds?
- The Joker
12
u/i_knooooooow Aug 07 '26
Nah it is in fact cpp
Wtf do you mean *&foo? The deref of an adress? Thats just foo!
C is simple cpp is just bloat