[offtopic] STL complex design question

Noel Yap nyap@garban.com
Mon Aug 24 07:29:00 GMT 1998


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



More information about the Gcc mailing list