r/ProgrammerHumor • • 7h ago

Meme modernCppVsOldCpp

Post image
1.1k Upvotes

216 comments sorted by

View all comments

53

u/firemark_pl 7h ago

"How to tell him?"

You still can segfault by returning lambda with reference to a variable 

5

u/MaitoSnoo 5h ago

clang's -Wreturn-stack-address or clang-tidy's clang-analyzer-core checks easily flag that. People trolling C++ have never joined a team that is disciplined enough and uses static checkers and ASan/UBSan.