From -2432242366336535468 X-Google-Thread: f78e5,1130da7a3640a78c X-Google-Attributes: gidf78e5,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news4.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!t-online.de!news.karotte.org!news2.arglkargh.de!noris.net!news.osn.de!diablo2.news.osn.de!news.tele.dk!news.tele.dk!small.news.tele.dk!lnewsinpeer00.lnd.ops.eu.uu.net!emea.uu.net!peer-uk.news.demon.net!kibo.news.demon.net!news.demon.co.uk!demon!stump.algebra.com!devnull From: none@none.com ("Marek Vondrak") Newsgroups: comp.std.c++ Subject: Re: Deprecate the use of plain pointers as standard container iterators Date: Thu, 11 May 2006 14:41:55 GMT Organization: Czech Technical University Lines: 27 Sender: mail2news@demon.net Approved: fjh@cs.mu.oz.au (Fergus Henderson , moderator of comp.std.c++) Message-ID: References: <1146830242.416436.272780@g10g2000cwb.googlegroups.com> <1147008352.734687.154540@e56g2000cwe.googlegroups.com> <1147205479.297583.272140@e56g2000cwe.googlegroups.com> <1147220407.442425.18060@i39g2000cwa.googlegroups.com> <44621a7f$0$60780$157c6196@dreader1.cybercity.dk> NNTP-Posting-Host: news.news.demon.net X-Trace: news.demon.co.uk 1147358534 19054 158.152.254.254 (11 May 2006 14:42:14 GMT) X-Complaints-To: abuse@demon.net NNTP-Posting-Date: Thu, 11 May 2006 14:42:14 +0000 (UTC) X-Original-To: std-c++@mailman.ucar.edu X-Robomod: STUMP, ichudov@algebra.com (Igor Chudov) X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180 X-Priority: 3 X-RFC2646: Format=Flowed; Response X-Virus-Scanned: amavisd-new at cs.mu.OZ.AU X-Antivirus: avast! (VPS 0619-1, 10.05.2006), Outbound message X-MSMail-Priority: Normal X-Received: (from fjh@localhost) by mulga.cs.mu.OZ.AU (8.12.10+Sun/8.12.9/Submit) id k4BEftZU002543; Fri, 12 May 2006 00:41:55 +1000 (EST) X-Path: comp-std-cpp-robomod!not-for-mail X-Antivirus-Status: Clean X-NNTP-Posting-Date: Thu, 11 May 2006 10:21:02 +0000 (UTC) X-Delivered-To: std-c++@ucar.edu X-Authentication-Warning: mulga.cs.mu.OZ.AU: fjh set sender to devnull@stump.algebra.com using -f X-Newsreader: Microsoft Outlook Express 6.00.2900.2180 X-Newsgroups: comp.std.c++ Xref: g2news2.google.com comp.std.c++:1895 > FWIW, I think > > v2.insert( v2.begin(), v1.begin(), v1.end() ); > > would result in memcpy in a good library. But this has nothing to do with the library implementation. We are talking about abstraction penalty of using objects instead of pointers here. The point is that most compilers are able to transform special for-loops to memcpy() when the induction variables are native pointers but they fail to do so when the variables are burried inside objects. > int main() > { > copy2( w1, w1 + 1024, w2 ); // Optimized to instrinsic memcpy() > copy2( v1.begin(), v1.end(), v2.begin() ); // Transforms to loop > } -- Marek --- [ 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 ]