LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 11-15-2005, 09:26 AM   #1
gecoool
Member
 
Registered: Feb 2005
Location: Romania
Distribution: Fedora 2
Posts: 38

Rep: Reputation: 15
vector copying speed comparison


Which sequence is faster to copy one vector to another:
using for ..., or using iterators ?

1. copy (v_src.begin(), v_src.end(), back_inserter(v_dest));

OR

2.
v_dest.resize(v_src.size());
for(unsigned i=0;i<v_src.size();i++)
v_dest[i] = v_src[i];
 
Old 11-15-2005, 10:34 AM   #2
dmail
Member
 
Registered: Oct 2005
Posts: 970

Rep: Reputation: Disabled
Hmmm ;(
why don't you time the operations?

on second thoughts i'm not familar with the func copy() and i can't find it in stroustrup's book??

Last edited by dmail; 11-15-2005 at 10:52 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
speed comparison alvi2 Linux - Networking 3 04-02-2005 11:50 AM
speed comparison alvi2 Fedora 1 04-02-2005 11:42 AM
Execution Speed Comparison Spritegeezer Linux - Newbie 1 12-22-2004 10:18 PM
SLack 9.1 Vs. Vector 4 Speed sethgeekx86 VectorLinux 2 05-15-2004 12:50 AM
OS Speed Comparison Tarential Linux - General 4 01-20-2004 09:02 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 03:03 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration