home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c++
- Path: sparky!uunet!cs.utexas.edu!torn!skule.ecf!drill.me!zougas
- From: zougas@me.utoronto.ca (Tom Zougas)
- Subject: Re: the 'standard' complex class
- Message-ID: <BtMGyz.52A@me.utoronto.ca>
- Sender: news@me.utoronto.ca (News Reader)
- Organisation: U of Toronto, Dept. of Mechanical Engineering
- Organization: UofT Mechanical Engineering
- References: <MCGRANT.92Aug26143400@rascals.stanford.edu>
- Date: Thu, 27 Aug 1992 03:13:46 GMT
- Lines: 23
-
- mcgrant@rascals.stanford.edu (Michael C. Grant) writes:
-
-
- >I am rather frustrated with the approach that AT&T took with its complex
- >class, specifically the decision to make the real and imaginary fields
- >private. (GNU's libg++ makes them protected, which is similarly frustrating
- >but not quite as much so).
-
- >Because the class does not need to be specially notified when the .re or
- >.im fields change, why not make them public? It certainly allows for
- >maximum flexibility; it won't break a single function already written
- >for complex numbers.
-
- Don't forget that complex numbers could also be represented in polar form.
- The point of abstraction is you don't want to know HOW the class is
- represented only WHAT is available. Inlining access functions might give
- the efficiency you need.
-
- --
- ===========================================================================
- Tom Zougas zougas@me.utoronto.ca
- Engineering Mechanics and Design Laboratory 416-978-1281
- Dept of Mechanical Engineering, University of Toronto, Toronto, CANADA
-