Article View: comp.std.c++
Article #2239Re: Need an operator ->[]
From: David Vandevoorde
Date: Wed, 18 Oct 1995 13:39
Date: Wed, 18 Oct 1995 13:39
25 lines
1363 bytes
1363 bytes
>>>>> "S" == Shashaanka <shashank@sashimi.wwa.com> writes: [...] S> X x; S> X * x1=x; Are you sure this is correct? Did you intend to write `X* x1 = &x;' instead? [...] S> (*x1)[10] to access 10th element. S> However, a more natural way could be to use it like x1-> [10]. S> Would like your comments on this, or if there are alternatives. [...] Are you aware of ``references''? E.g., for the code above: X& x1 = x; // ... x1[10] ... This syntax now available. Daveed --- [ comp.std.c++ is moderated. Submission address: std-c++@ncar.ucar.edu. Contact address: std-c++-request@ncar.ucar.edu. The moderation policy is summarized in http://dogbert.lbl.gov/~matt/std-c++/policy.html. ]
Technical Details
Message-ID:
<VANDEVOD.95Oct18090022@avs.cs.rpi.edu>Path:
arc1-ca.pugleaf.net!in1.uu.net!bounce-backReferences:
<45tv4c$opc@news.csus.edu> <45uf98$dqt@jabba.lehman.com> <461ref$hfr@sake.wwa.com>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!in1.uu.net!bounce-back Date: 18 Oct 95 13:39:57 GMT Approved: fjh@cs.mu.oz.au From: vandevod@cs.rpi.edu (David Vandevoorde) Newsgroups: comp.std.c++ Subject: Re: Need an operator ->[] X-Original-Date: 18 Oct 1995 13:00:22 GMT Organization: RPI Computer Science Message-ID: <VANDEVOD.95Oct18090022@avs.cs.rpi.edu> References: <45tv4c$opc@news.csus.edu> <45uf98$dqt@jabba.lehman.com> <461ref$hfr@sake.wwa.com> In-Reply-To: Shashaanka's message of 18 Oct 1995 04:24:16 GMT X-Auth: PGPMoose V1.1 PGP comp.std.c++ iQBFAgUBMIUDwOEDnX0m9pzZAQFzEgF6AsSUpREoSqlr4nGAVm53hPjBwa6tctUr MDuYD3QWFd80Kfx8ZitknK+sjwZQzZ1m =ucJa