home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #26 / NN_1992_26.iso / spool / comp / lang / cplus / 16110 < prev    next >
Encoding:
Text File  |  1992-11-11  |  1.7 KB  |  42 lines

  1. Newsgroups: comp.lang.c++
  2. Path: sparky!uunet!charon.amdahl.com!pacbell.com!network.ucsd.edu!munnari.oz.au!metro!extro.ucc.su.OZ.AU!maxtal
  3. From: maxtal@extro.ucc.su.OZ.AU (John MAX Skaller)
  4. Subject: Re: operator [][]
  5. Message-ID: <1992Nov11.182016.13511@ucc.su.OZ.AU>
  6. Sender: news@ucc.su.OZ.AU
  7. Nntp-Posting-Host: extro.ucc.su.oz.au
  8. Organization: MAXTAL P/L C/- University Computing Centre, Sydney
  9. References: <BxFt8r.2Kt@cs.columbia.edu> <1992Nov9.095352.19114@fmrco.uucp> <1992Nov9.114516.29846@alf.uib.no>
  10. Date: Wed, 11 Nov 1992 18:20:16 GMT
  11. Lines: 29
  12.  
  13. In article <1992Nov9.114516.29846@alf.uib.no> s026@brems.ii.uib.no (Paal K Holmberg) writes:
  14. >In article <1992Nov9.095352.19114@fmrco.uucp>, pandrews@lovat.fmrco.com (Paul Andrews) writes:
  15. >|> 
  16. >since it os a trouble to get around mutiple []'s , you can always cheat and use a 
  17. >normal function element(int x,int y...) to get a certain element in the matrix or whatever.
  18. >I agree it is not as elgant as the [] approach, but it is easy.
  19. >
  20.  
  21.     It would be nice if [] could work like (), that is one could
  22. declar
  23.  
  24.     operator[](int,int,int){ ...}
  25.  
  26. for example, that is, allow multiple arguments for [] just like ().
  27. This would allow multiple dimensioned matrices as well as providing
  28. a wealth of extra overloadable notations.
  29.  
  30. It would of course break those programs for which
  31.  
  32.     a[2,3];
  33.  
  34. actually meant a[3] using the comma operator, but there surely are not
  35. so many of them ..??
  36.  
  37. -- 
  38. ;----------------------------------------------------------------------
  39.         JOHN (MAX) SKALLER,         maxtal@extro.ucc.su.oz.au
  40.     Maxtal Pty Ltd, 6 MacKay St ASHFIELD, NSW 2131, AUSTRALIA
  41. ;--------------- SCIENTIFIC AND ENGINEERING SOFTWARE ------------------
  42.