🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

2 total messages Started by Troy Cauble Wed, 28 Oct 1992 22:17
delete [n] ptr warning
#7
Author: Troy Cauble
Date: Wed, 28 Oct 1992 22:17
19 lines
997 bytes
g++ (2.2.2) warns me that the form

	delete [n] ptr

is anachronistic.  Is this true?  Says who?  That
is, are the standards moving in that direction?

Will ::operator delete() know to call multiple
destructors in the array case?  Any pitfalls
I should be aware of?

Forgive me if these are documented questions.  I don't
have TeX, and have not figured out how to read any of
the TeX based gcc/gdb documentation...


-troy
Troy.Cauble@att.com
Re: delete [n] ptr warning
#8
Author: Joe Buck
Date: Wed, 28 Oct 1992 23:39
32 lines
1528 bytes
In article <1992Oct28.221705.4235@cbnewsj.cb.att.com> troy@cbnewsj.cb.att.com (Troy Cauble) writes:
>g++ (2.2.2) warns me that the form
>
>	delete [n] ptr
>
>is anachronistic.  Is this true?  Says who?  That
>is, are the standards moving in that direction?

The ARM (Ellis and Stroustrup's Annotated C++ Reference Manual) says so.
The ANSI C++ standardization committee has adopted this as the base
document for the standard.

>Will ::operator delete() know to call multiple
>destructors in the array case?  Any pitfalls
>I should be aware of?

You must use the syntax
	delete [] ptr

The implementation is responsible for knowing how many objects there are.

>Forgive me if these are documented questions.  I don't
>have TeX, and have not figured out how to read any of
>the TeX based gcc/gdb documentation...

It's documented, but not in the Gnu documentation.  This is explained
in any up-to-date C++ book.  If you have an old one, you'll need to get
a new one.


--
Joe Buck	jbuck@ohm.berkeley.edu
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads