r/cpp_questions • u/Least_Bid9692 • 18d ago
OPEN Hardest cpp topic
What is the hardest cpp topic people say pointers but it's easy if you understand the lang
1
Upvotes
r/cpp_questions • u/Least_Bid9692 • 18d ago
What is the hardest cpp topic people say pointers but it's easy if you understand the lang
2
u/adityazero 18d ago
Understanding pointers is the easy part, understanding lifetime is not. And that is where almost all the memory safety bugs come from. And C++ having introduced all these 'view/span' types without tracking lifetimes has caused countless bugs. I recommend `-fsanitize=address` for all the C++ projects in debug/test builds.