From 3887353371090506793
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f78e5,b83a4267f4ac775
X-Google-Attributes: gidf78e5,public
From: Matt Austern <austern@sgi.com>
Subject: Re: string/cow/algorithm
Date: 1998/08/11
Message-ID: <fxtsoj3kxty.fsf@isolde.engr.sgi.com>#1/1
X-Deja-AN: 380207553
X-NNTP-Posting-Host: isolde.engr.sgi.com
Approved: stephen.clamage@sun.com (comp.std.c++)
Sender: austern@isolde.engr.sgi.com
References: <6qfr41$oue$1@pigpen.csrlink.net> <6qg3ld$r7o$1@shell7.ba.best.com> <6qgs0r$92e$1@pigpen.csrlink.net> <35ccc2b4.832003@news3.ibm.net> <6qn19u$sb0$1@pigpen.csrlink.net> <6qnj99$h2l$1@nnrp1.dejanews.com> <6qo3fq$dum$1@pigpen.csrlink.net> <6qq9ai$59e$1@nnrp1.dejanews.com>
X-UID: 0000000001
X-Status: $$$T
Organization: SGI
Newsgroups: comp.std.c++
Originator: clamage@taumet


AllanW@my-dejanews.com writes:

> > Sorry.  Unless this has also changed from the CD2, it is required that
> > string::operator[] return a T& and that string::iterator::operator*
> > return a T&.  Proxies are expressly forbidden by these requirements.
> 
> That's a pity. It would be invisible to most code.

It's more visible than you might think: It's very hard to get proxy
references to work correctly with template functions whose arguments
are passed by reference.  You wind up with a reference to a proxy, and
that sometimes has unexpected consequences.


[ comp.std.c++ is moderated.  To submit articles, try just posting with ]
[ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu    ]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://reality.sgi.com/austern_mti/std-c++/faq.html              ]




