From 3801402066320564012 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!newscon06.news.prodigy.com!prodigy.net!newsfeed-00.mathworks.com!peer-uk.news.demon.net!kibo.news.demon.net!mutlu.news.demon.net!news.demon.co.uk!demon!stump.algebra.com!devnull From: thorsten.ottosen@dezide.com (Thorsten Ottosen) Newsgroups: comp.std.c++ Subject: Re: Deprecate the use of plain pointers as standard container iterators Date: Wed, 10 May 2006 18:36:51 GMT Lines: 41 Sender: mail2news@demon.net Approved: fjh@cs.mu.oz.au (Fergus Henderson , moderator of comp.std.c++) Message-ID: <44621a7f$0$60780$157c6196@dreader1.cybercity.dk> 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> NNTP-Posting-Host: news.news.demon.net Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: news.demon.co.uk 1147286217 26034 158.152.254.254 (10 May 2006 18:36:57 GMT) X-Complaints-To: abuse@demon.net NNTP-Posting-Date: Wed, 10 May 2006 18:36:57 +0000 (UTC) X-Original-To: std-c++@mailman.ucar.edu X-Robomod: STUMP, ichudov@algebra.com (Igor Chudov) X-User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923) X-Accept-Language: en-us, en X-Virus-Scanned: amavisd-new at cs.mu.OZ.AU X-Received: (from fjh@localhost) by mulga.cs.mu.OZ.AU (8.12.10+Sun/8.12.9/Submit) id k4AIapTf016821; Thu, 11 May 2006 04:36:51 +1000 (EST) X-Path: comp-std-cpp-robomod!not-for-mail 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-Newsgroups: comp.std.c++ Xref: g2news2.google.com comp.std.c++:1886 Peter Dimov wrote: > 4zumanga@gmail.com wrote: > If you consider MSVC 7.1 a modern compiler: > > #include > > unsigned char w1[ 1024 ]; > unsigned char w2[ 1024 ]; > > std::vector v1( 1024 ); > std::vector v2( 1024 ); > > template void copy2( It first, It last, It2 out ) > { > for( ; first != last; ++first, ++out ) > { > *out = *first; > } > } > > int main() > { > copy2( w1, w1 + 1024, w2 ); > copy2( v1.begin(), v1.end(), v2.begin() ); > } FWIW, I think v2.insert( v2.begin(), v1.begin(), v1.end() ); would result in memcpy in a good library. -Thorsten --- [ 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 ]