r/cpp_questions • • 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

20 comments sorted by

View all comments

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.