This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: [offtopic] STL complex design question
Thomas Kunert wrote:
>
> Noel Yap wrote:
>
> > Have an array of pointers to complex instead of an array of complex
>
> Never do that!
> Now there is no implicit initialization.
Like I said before, implicit initialization is one of the things I hate
most about C++.
> You must initialize each member
> of the array explicitly, even with a function call.
But at least you control *where* the performance loss is.
> Beside that, you get a huge perfomance loss and ugly syntax.
That's your opinion.
>
> > automatic constructor calls are one of the things I hate most about > C++.
>
> What's bad with that? That's the soul of C++! And you can avoid it if
> you don't like it: Just use raw memory. Using c-style arrays is
> deprecated for user code anyway. You should invent your own class
> array_of_complex that doesn't initialize the memory.
And for other arrays, I suppose I should use templates? Classes *never*
completely act like built in arrays.
Noel