From -1730191838058535863 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f78e5,7eaa8faac8da5016 X-Google-Attributes: gidf78e5,public From: Valentin Bonnard Subject: Re: Defect Report: member == in container iterators considered harmful Date: 1999/08/18 Message-ID: <37BABF02.3EBE@wanadoo.fr>#1/1 X-Deja-AN: 514257054 X-NNTP-Posting-Host: fuste.ens.fr Content-Transfer-Encoding: 7bit Approved: stephen.clamage@sun.com (comp.std.c++) References: <7p4nj8$n3u@enews4.newsguy.com> <37B95B96.7F37@wanadoo.fr> <7pcoa8$2kf0@enews2.newsguy.com> X-UID: 0000000001 X-Status: $$$T Content-Type: text/plain; charset=us-ascii Organization: Ecole normale superieure Mime-Version: 1.0 Newsgroups: comp.std.c++ Originator: clamage@taumet Darin Adler wrote: > Valentin Bonnard wrote: > > It's the contrary: as a non member function, deduction > > won't ever work. With member functions, it will work > > sometimes (i == ci is an error, ci == i is ok). > > > > So mandating non member functions certainly: > > - isn't a solution > > I tried this solution on my compiler before posting the defect report. I > changed the following function definition within the deque template in the > definition of deque::const_iterator: > > bool operator ==(const const_iterator& rhs) const > {return cur_ == rhs.cur_;} > > to this: > > friend bool operator ==(const const_iterator& lhs, > const const_iterator& rhs) > {return lhs.cur_ == rhs.cur_;} You didn't proposed a friend function in your DR. You proposed a non member function. -- Valentin Bonnard [ 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 ]