www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1993/07/22/16:57:25

Subject: Anachronous delete.
From: Stefan Kremer <stefan AT cs DOT ualberta DOT ca>
To: djgpp AT sun DOT soe DOT clarkson DOT edu (djgpp Mailing List)
Date: Thu, 22 Jul 1993 14:34:07 -0600

I have a book on C++.  It tells me that there are two forms of delete:

1.	delete [_size_] _p-var_;
2.	delete _p-var_;

It says that the first form causes the compiler to call the destructor
function for each element in the array, while the second form just
frees the memory of the array.

I am using the first form in a program and gcc says:

"warning:  use of array size with vector delete is anachronistic"

I understand that this must mean that my book describes an earlier
version of C++ but what does it mean in terms of calling destructor
functions.  Can they no-longer be called using delete?  What if I
want them to be called?  What if I don't?  How do I distinguish between
these two desired options?

Thanks in advance,

	-Stefan

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019