3 ms·
Are you actually using new and delete outside your own data structures? I have barely used new or delete for years, I don't even use them when building data st
by CyberDildonics 6y ago
Are you actually using new and delete outside your own data structures? I have barely used new or delete for years, I don't even use them when building data structures - the vast majority of the time I make compound data structures out of what is in the standard library. It is only when memory layout needs to be very specific that I use new and even then it is placement new.
- usrnm 6y agoYou don't need to use delete explicitly to control the lifetime of objects in C++. A properly placed "}" or a call to something like .release() can be just as effective. The problem is, there is simply no way to do it in a GC language.
- CyberDildonics 6y agoI think you completely misunderstood what I wrote. I was asking the person I replied to why they needed to use new and delete.