From -8121733635845035886 X-Google-Thread: f78e5,1130da7a3640a78c X-Google-Attributes: gidf78e5,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news2.google.com!news3.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local01.nntp.dca.giganews.com!nntp.speakeasy.net!news.speakeasy.net.POSTED!not-for-mail NNTP-Posting-Date: Mon, 08 May 2006 10:40:04 -0500 Return-Path: X-Authentication-Warning: mulga.cs.mu.OZ.AU: fjh set sender to devnull@stump.algebra.com using -f X-Robomod: STUMP, ichudov@algebra.com (Igor Chudov) X-Original-To: std-c++@mailman.ucar.edu Delivered-To: std-c++@mailman.ucar.edu Delivered-To: std-c++@ucar.edu From: "Nicola Musatti" Newsgroups: comp.std.c++ Subject: Re: Deprecate the use of plain pointers as standard container iterators Organization: http://groups.google.com Message-ID: <1147096430.897225.169540@j33g2000cwa.googlegroups.com> References: <1146830242.416436.272780@g10g2000cwb.googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" X-Complaints-To: groups-abuse@google.com User-Agent: G2/0.2 X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.12) Gecko/20050915,gzip(gfe),gzip(gfe) X-HTTP-Via: 1.1 riprxbr00.rit:80 (squid/2.5.STABLE3) Complaints-To: groups-abuse@google.com Injection-Info: j33g2000cwa.googlegroups.com; posting-host=212.239.118.101; posting-account=9n3cLg0AAABXqZC3npS4wOhEJhS9Fp-a X-Virus-Scanned: amavisd-new at ucar.edu X-Virus-Scanned: amavisd-new at cs.mu.OZ.AU Approved: Fergus Henderson , moderator of comp.std.c++ X-Virus-Scanned: amavisd-new at cs.mu.OZ.AU Date: Mon, 8 May 2006 10:38:10 CST Lines: 45 NNTP-Posting-Host: 65.182.171.162 X-Trace: sv3-eHgQjpGLGSmCdNHI89Y6XBbrMkMvNVBRijjZOXnbGb0nGIfx/1ygMIqTodENqsy/ADiALRR9oiClNbY!9lVxdJkjXqFtmBZjLYWOdeeewC9NODdYh1/jJhM2Z+p08dESFwa8AiFLYW4yvBLXbEbU54uiXQTN!WHknCUgoCi9wvGJqAXTiLaWBgBVwE97jiB4Ab/IhiTM= X-Complaints-To: abuse@speakeasy.net X-DMCA-Complaints-To: abuse@speakeasy.net X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.32 Xref: g2news2.google.com comp.std.c++:1808 Pete Becker wrote: > Nicola Musatti wrote: > > > > > The following code is valid on some platforms and not on others: > > > > std::sort(++v.begin(), v.end()); > > This form is valid on all platforms: > > std::sort(v.begin() + 1, v.end()); But than the code is only valid for random access iterators i.e. is not as generic as it could be. > > std::vector::iterator i = find(v.begin(), v.end(), 2); > > > > If std::vector<>::iterator is a pointer the user defined find function > > is chosen. > > If you need to insist on the std version, you can say so: > > std::vector::iterator i = std::find(v.begin(), v.end(), 2); My point is not how to achieve the desired behaviour, but rather that as this concerns the standard library it should be consistent across platforms. > And note that the actual change would be to the container requirements, > not to vector. These minor problems are also present for user-defined > container types that return pointers as iterators. You are right, but I don't see these as counterarguments to my point of view. Cheers, Nicola Musatti --- [ 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://www.comeaucomputing.com/csc/faq.html ]