template-constructor
Martin v. Loewis
martin@loewis.home.cs.tu-berlin.de
Thu Mar 23 13:39:00 GMT 2000
> please reply me (if bug) to yeolahim@mail.ru(or public it)
> if not, can too ;)
Thanks for your bug report. This is not a bug in the compiler, it is a
bug in your code.
> in run_time
> is : with <iostream> for check of break point at run time
I get a segmentation violation in this example, which is cause by a
double-delete for the same pointer. The reason is that your Array
template does not have a copy constructor. You may think the template
constructor could be used as a copy constructor; however, a template
constructor is *never* a copy constructor - you need an additional,
non-template copy constructor.
> in only_code
> only code
This produces a lot of error messages with the first one being
In file included from test.2.cc:1:
array.2.hh:5: syntax error before `;'
That is no surprise: size_t is not defined. You need to include
<stdlib.h> before that.
Regards,
Martin
More information about the Gcc-bugs
mailing list