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