r/cpp • u/ASA911Ninja • Jan 03 '26
Are memory leaks that hard to solve?
I have been coding in cpp for the last year (not regularly) and don’t have any professional experience. Why are memory leaks so hard to solve? If we use some basic rules and practices we can avoid them completely. 1) Use smart pointers instead of raw pointers 2) Use RAII, Rule of 5/3/0
I might be missing something but I believe that these rules shouldn’t cause memory related issues (not talking about concurrency issues and data races)
97
Upvotes
View all comments
Show parent comment
-3
u/ASA911Ninja Jan 03 '26
Ig my opinion stems from the fact that everyone is talking abt rust. There are some examples like why google made go(gc), why rust was made by Mozilla, microsoft shifting to rust etc