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: [offtopic] STL complex design question


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. You must initialize each member
of the array explicitly, even with a function call.
Beside that, you get a huge perfomance loss and ugly syntax. 

> 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. 
 
Regards,
Thomas Kunert


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