From: Hans-Bernhard Broeker Newsgroups: comp.os.msdos.djgpp Subject: Re: C++, complex, etc Date: 16 May 2000 12:57:41 GMT Organization: Aachen University of Technology (RWTH) Lines: 53 Message-ID: <8frgk5$f19$1@nets3.rz.RWTH-Aachen.DE> References: NNTP-Posting-Host: acp3bf.physik.rwth-aachen.de X-Trace: nets3.rz.RWTH-Aachen.DE 958481861 15401 137.226.32.75 (16 May 2000 12:57:41 GMT) X-Complaints-To: abuse AT rwth-aachen DOT de NNTP-Posting-Date: 16 May 2000 12:57:41 GMT Originator: broeker@ To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com Eli Zaretskii wrote: > So what is the standard C++ complex type? There is no such thing as 'the' standard type. 'complex' is realized as a template, so you can have either of complex complex complex or probably even complex complex (haven't really checked that), after you included the right header finally named by the ANSI/ISO C++ committee. > How do I declare a complex variable in a way that any > standard-complying C++ compiler should support? The problem in that sentence is the term'standard-complying'. The C++ language has been standardized only relatively recently (end of 1998, if memory serves), and many compiler or library implementors haven't caught up with that development, yet. G++ is mostly there (partly depending on some tricky details of the binutils and platform you're using), but the library, libstdc++, still seems to be lacking in some areas. The *real* problem however is that C++ standardization was such a long, yet dynamic process. Several authors and publishers couldn't resist the temptation of producing 'teach yourself' and 'for dummies' style C++ books that describe non-standard dialects of the language. At some point in time they somewhat correctly claimed to be close to the developing standard, but have in the meantime been overtaken by reality. Sadly, lots of those books are still around, in libraries and bookshops, and people take their claim at face value. The fact that hardly any currently available compiler supports 100% of ANSI/ISO standard C++ yet adds to the problem significantly. Thus many of the books out there are very often even further behind the standardization process than the compilers and libraries are. That's how people come to disagree over things like vs. , or the libg++ complex class (?) vs. the Standard template in . C++ itself has stopped being the rapidly moving target it used to be, when the standard was accepted at last, but the aftermath of its sometimes jumpy evolution is not over, yet. Lots of people have yet to catch up to the standard, before C++ can be considered a 'stable' language. -- Hans-Bernhard Broeker (broeker AT physik DOT rwth-aachen DOT de) Even if all the snow were burnt, ashes would remain.