home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #20 / NN_1992_20.iso / spool / comp / lang / cplus / 13656 < prev    next >
Encoding:
Internet Message Format  |  1992-09-14  |  1.9 KB

  1. Path: sparky!uunet!olivea!spool.mu.edu!caen!uakari.primate.wisc.edu!usenet.coe.montana.edu!news.u.washington.edu!hardy.u.washington.edu!rons
  2. From: rons@hardy.u.washington.edu (Ronald Schoenberg)
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: Proposal: Subscripting with multiple arguments
  5. Message-ID: <1992Sep15.031111.15170@u.washington.edu>
  6. Date: 15 Sep 92 03:11:11 GMT
  7. References: <1992Sep14.182942.1986@athena.mit.edu> <MATT.92Sep14161955@physics.berkeley.edu>
  8. Sender: news@u.washington.edu (USENET News System)
  9. Organization: University of Washington, Seattle
  10. Lines: 24
  11.  
  12. In article <MATT.92Sep14161955@physics.berkeley.edu> matt@physics.berkeley.edu writes:
  13. [..elided material...]
  14. >
  15. >What I find to be a bigger problem, actually, is designing an array
  16. >class that works for arrays with an arbitrary number of dimensions.
  17. >There's no problem with defining the classes Array1, Array2,
  18. >Array3,..., and that's exactly what I've done, but it's annoying and
  19. >inelegant.  Has anyone out there come up with a good definition for
  20. >arrays with an arbitrary number of dimensions? ("Good," in this
  21. >context, means specifically that array reference is sufficiently well
  22. >optimized that an intelligent programmer wouldn't mind using this
  23. >class in an inner loop.)
  24. >--
  25. >Matthew Austern                   Just keep yelling until you attract a
  26. >(510) 644-2618                    crowd, then a constituency, a movement, a
  27. >austern@lbl.bitnet                faction, an army!  If you don't have any
  28. >matt@physics.berkeley.edu         solutions, become a part of the problem!
  29.  
  30. M++ has four dimensional arrays that can be generalized to any number
  31. of dimensions with minor changes in source code.  It, however, overloads
  32. operator() rather than operator[].  I am new to C/C++ and I am used to
  33. using parens so I'm happy - I find typing [1][2][3] a lot harder than
  34. (1,2,3).  I've been told by the designer of M++ that overloading
  35. operator[] creates too many problems.
  36.