3 ms·
OK. ok. "full" was an overstatement. You got me. The point is that you can write large programs without ever calling delete or free() and still not leak memo
by corysama 8y ago
OK. ok. "full" was an overstatement. You got me.
The point is that you can write large programs without ever calling delete or free() and still not leak memory. True, it's not completely general nor impossible to screw up. You still need to be aware of issues like circular references. And, using shared_ptr would make lifetime as ambiguous as a Java reference. But, if you keep everything a DAG of containers and unique_ptrs, not only will your memory thank you, your coworkers will too.