new new[] delete delete[] operators

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
Skirox
Posts: 11
Joined: Sat Aug 20, 2011 4:05 am

new new[] delete delete[] operators

Post by Skirox »

Is is required to implements these operators even if i'm not going to use them?
User avatar
Combuster
Member
Member
Posts: 9301
Joined: Wed Oct 18, 2006 3:45 am
Libera.chat IRC: [com]buster
Location: On the balcony, where I can actually keep 1½m distance
Contact:

Re: new new[] delete delete[] operators

Post by Combuster »

I you truly don't use array new/delete then there's no need for them.

Your linker will let you know if you screwed up your assumption :wink:
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
OSwhatever
Member
Member
Posts: 595
Joined: Mon Jul 05, 2010 4:15 pm

Re: new new[] delete delete[] operators

Post by OSwhatever »

Skirox wrote:Is is required to implements these operators even if i'm not going to use them?
No, you can skip implementing those if you want to. You might want to implement placement new so that you can run the constructors of the objects but that's just a few lines of code.
Post Reply