🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

2 total messages Started by David Lovell Wed, 18 Nov 1992 07:38
ANSI C++ forbids array size in vector delete
#580
Author: David Lovell
Date: Wed, 18 Nov 1992 07:38
34 lines
1931 bytes
Hi there,
We've just put the latest releases of gcc and libg++ up and now I'm bashing
some old code into shape. I know this is only a warning message but I'd like
to know how to get rid of it (apart from turning all the warnings off!).

The message in question has the form:
matrix.C:63: warning: ANSI C++ forbids array size in vector delete

where matrix.C:63 is:
delete [storage] store;

where store is allocated by:
store = new double [storage];

Am I right to assume that C++ no longer needs "array size in vector delete"?
I just bought a "recent" (1991) C++ text, "C++: the Complete Reference" by
Herbert Schildt which says at the top of page 334

"When an array allocated by using new is released, delete must be told how
many elements there are in the array."

Which poses the question, which C++ reference should GNU users refer to?
Thanks in advance for all your helpful replies.

David
-------------------------------------------------------------------------------
David Lovell - dlovell@s1.elec.uq.oz.au  |
                                         |
Dept. Electrical Engineering             | "Oh bother! The pudding is ruined
University of Queensland                 | completely now!" said Marjory, as
BRISBANE 4072                            | Henry the daschund leapt up and
Australia                                | into the lemon surprise.
                                         |
tel: (07) 365 3564                       |
Re: ANSI C++ forbids array size in vector delete
#588
Author: Jason Merrill
Date: Fri, 20 Nov 1992 09:24
11 lines
967 bytes
In article <dlovell.722072326@s1.elec.uq.oz.au> dlovell@elec.uq.oz.au (David Lovell) writes:

>Which poses the question, which C++ reference should GNU users refer to?

The answer is, of course (until ANSI releases a reference document), the
Annotated C++ Reference Manual by Margaret A. Ellis and Bjarne Stroustrup.
This is the ANSI base document.

--
Jason Merrill					jason@jarthur.claremont.edu
This is a self-referential .sig which is not particularly interesting.
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