This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: [offtopic] STL complex design question
- To: Noel Yap <nyap at garban dot com>
- Subject: Re: [offtopic] STL complex design question
- From: Thomas Kunert <kunert at physik dot tu-dresden dot de>
- Date: Fri, 21 Aug 1998 12:08:11 +0200
- CC: nbecker at fred dot net, egcs at cygnus dot com
- Organization: TU Dresden
- References: <E0z97Tr-00018I-00@hns.com> <35DC0B00.199A@garban.com>
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