This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: signal 11 generating problem, was: Further observations regarding alloca on i586-pc-linux-gnu


> > 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?

No, there is no standard template by that name.  It has been proposed
by many people to be analogous to auto_ptr, except that it would contain a
pointer to an array on the heap (e.g. "new MyClass[5]") and would do
"delete []" rather than "delete" in the destructor.

The committee's response to such proposals has been to try to get people
to just use vector, which is OK as long as you aren't trying to interface
to C code that wants a genuine C array.




Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]