signal 11 generating problem, was: Further observations regarding alloca on i586-pc-linux-gnu
Sol Foster
colomon@ralf.org
Wed Aug 26 05:20:00 GMT 1998
Martin von Loewis <martin@mira.isdn.cs.tu-berlin.de> wrote:
>
> > Yup, it's syntactically valid C++, but it is wrong because auto_ptr
> > will delete the pointer to the array as if it were a pointer to a
> > single object. You should write auto_ptr_array instead.
>
> Is auto_ptr_array a standard template? If so, where is it defined?
It is not in the standard, but it is widely recognized. It's easy to make
your own. Grab the auto_ptr source. Search and replace "auto_ptr" with
"auto_ptr_array". Then find the deletes and change each to delete [].
For bonus points, you can take an extra minute and add an operator [] to
make it look more like a C-style array.
--
Sol Foster: colomon@ralf.org
This may sting a little, just at first, but don't worry, that'll go away
once the searing pain kicks in.
-Ethan
More information about the Gcc
mailing list