From -7194968859768163601
X-Google-Thread: f78e5,1130da7a3640a78c
X-Google-Attributes: gidf78e5,public
X-Google-Language: ENGLISH,ASCII-7-bit
Path: g2news2.google.com!news1.google.com!news4.google.com!border1.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!pd7cy1no!shaw.ca!news.alt.net!comp-std-cpp-robomod!not-for-mail
From: "4zumanga@gmail.com" <4zumanga@gmail.com>
Newsgroups: comp.std.c++
Subject: Re: Deprecate the use of plain pointers as standard container iterators
Date: 9 May 2006 21:30:05 GMT
Organization: http://groups.google.com
Lines: 33
Approved: Fergus Henderson <fjh@cs.mu.oz.au>, moderator of comp.std.c++
Message-ID: <1147205479.297583.272140@e56g2000cwe.googlegroups.com>
References: <1146830242.416436.272780@g10g2000cwb.googlegroups.com>
   <1147008352.734687.154540@e56g2000cwe.googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain; charset="iso-8859-1"
Return-Path: <devnull@stump.algebra.com>
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
X-Trace: posting.google.com 1147205486 12474 127.0.0.1 (9 May 2006 20:11:26 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: Tue, 9 May 2006 20:11:26 +0000 (UTC)
User-Agent: G2/0.2
X-HTTP-UserAgent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en) AppleWebKit/418 (KHTML, like Gecko) Safari/417.9.2,gzip(gfe),gzip(gfe)
Complaints-To: groups-abuse@google.com
Injection-Info: e56g2000cwe.googlegroups.com; posting-host=84.92.249.118;
   posting-account=rhm8zg0AAAAB_CTpLQ2qYqQZWFJGu29h
X-Greylisting: NO DELAY (Relay+Sender autoqualified);
	processed by UCSD_GL-v2.1 on mailbox7.ucsd.edu;
	Tue, 09 May 2006 13:11:29 -0700 (PDT)
X-Spamscanner: mailbox7.ucsd.edu  (v1.6 Aug  4 2005 15:27:38, -2.8/5.0 3.0.4)
X-MailScanner: PASSED (v1.2.8 73096 k49KBTHc001574 mailbox7.ucsd.edu)
X-Virus-Scanned: amavisd-new at ucar.edu
X-Virus-Scanned: amavisd-new at cs.mu.OZ.AU
X-Virus-Scanned: amavisd-new at cs.mu.OZ.AU
Xref: g2news2.google.com comp.std.c++:1862

Peter Dimov wrote:
>Nicola Musatti wrote:
>> Hallo,
>> I belive that the use of plain pointers as iterator types for standard
>> library containers should be deprecated, because it limits genericity
>> and portability.
>
>It also increases performance and presents more opportunities for
>optimization.

Can you provide an example of this on a modern optimising compiler, ie
where the optimiser does better with

int* i;

than it does with:

struct iterator { int* i };

About a year ago I spent quite a lot of time investigating if g++ 4 has
any problems when vector iterators are wrapped in a class, and couldn't
produce an example where the resulting assembler wasn't the same.

Of course here I'm not talking about those compilers where the vector
iterator has extra safety over what a plain pointer woudl provide. Most
compilers provide a way to switch this off.

---
[ 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                      ]



