Click here to Skip to main content
15,914,500 members
Home / Discussions / ATL / WTL / STL
   

ATL / WTL / STL

 
GeneralRe: STL stupid question Pin
Joaquín M López Muñoz4-Oct-04 2:33
Joaquín M López Muñoz4-Oct-04 2:33 
GeneralATL / STL : Dumb question maybe... Pin
Malcolm Smart30-Sep-04 10:40
Malcolm Smart30-Sep-04 10:40 
GeneralRe: ATL / STL : Dumb question maybe... Pin
Joaquín M López Muñoz30-Sep-04 11:15
Joaquín M López Muñoz30-Sep-04 11:15 
GeneralRe: ATL / STL : Dumb question maybe... Pin
Kevin McFarlane1-Oct-04 12:24
Kevin McFarlane1-Oct-04 12:24 
GeneralRe: ATL / STL : Dumb question maybe... Pin
Michael Dunn1-Oct-04 9:48
sitebuilderMichael Dunn1-Oct-04 9:48 
GeneralRe: ATL / STL : Dumb question maybe... Pin
Anna-Jayne Metcalfe19-Oct-04 5:14
Anna-Jayne Metcalfe19-Oct-04 5:14 
GeneralCopying Lists and Vectors Pin
mcsherry30-Sep-04 0:26
mcsherry30-Sep-04 0:26 
GeneralRe: Copying Lists and Vectors Pin
Andrew Walker30-Sep-04 19:39
Andrew Walker30-Sep-04 19:39 
std::copy is probably your best bet. Using it is going to ensure that your compiler has the best chance of optimising (no post increments or missing consts on iterators) and is easy to read for code maintainers.

If you're worried about this operation, and it's a possible bottleneck it is worth profiling the various options. Because seemingly obvious optimisations (like calling reserve() on the vector) might not do as much to help as you think. See the article by Andrew Koenig and Barbara E. Moo "Are Vectors Really Fastest?" published in the August 2004 issue of the C/C++ Users Journal.

memcpy is only an option if your data elements are POD (Plain Old Data), but even then in some (most?) situations the code that std::copy will generate is exactly the same as the memcpy code.

Custom STL allocators might help if your objects are reasonably small (a few bytes) - although it would be rare that this would be a preformance issue.


If you can keep you head when all about you
Are losing theirs and blaming it on you;
If you can dream - and not make dreams your master;
If you can think - and not make thoughts your aim;
Yours is the Earth and everything that's in it.

Rudyard Kipling

GeneralRe: Copying Lists and Vectors Pin
valikac4-Oct-04 6:34
valikac4-Oct-04 6:34 
GeneralRe: Copying Lists and Vectors Pin
toxcct5-Oct-04 23:28
toxcct5-Oct-04 23:28 
GeneralWTL Menu in MFC container Pin
peterchen29-Sep-04 8:29
peterchen29-Sep-04 8:29 
GeneralToo much connections and ATL Server Pin
Federico Milano29-Sep-04 8:20
Federico Milano29-Sep-04 8:20 
QuestionFriend Properties-Methods VB .Can I do it in ATL?? Pin
Tholkiem28-Sep-04 9:26
Tholkiem28-Sep-04 9:26 
AnswerRe: Friend Properties-Methods VB .Can I do it in ATL?? Pin
Tholkiem29-Sep-04 13:11
Tholkiem29-Sep-04 13:11 
GeneralPLS HELP : CreateInstance (__uuidof(SHDocVw::ShellWindows) failed Pin
SenPy28-Sep-04 7:19
SenPy28-Sep-04 7:19 
GeneralRe: PLS HELP : CreateInstance (__uuidof(SHDocVw::ShellWindows) failed Pin
User 21559730-Sep-04 0:52
User 21559730-Sep-04 0:52 
Generalcatching events Pin
dudic28-Sep-04 5:49
dudic28-Sep-04 5:49 
GeneralRe: catching events Pin
Lim Bio Liong16-Oct-04 23:15
Lim Bio Liong16-Oct-04 23:15 
GeneralRe: catching events Pin
ThatsAlok29-Oct-04 21:06
ThatsAlok29-Oct-04 21:06 
QuestionActiveX Controls MFC or ATL? Pin
Andy H28-Sep-04 3:51
Andy H28-Sep-04 3:51 
AnswerRe: ActiveX Controls MFC or ATL? Pin
Kevin McFarlane29-Sep-04 2:13
Kevin McFarlane29-Sep-04 2:13 
GeneralPLS HELP : CoCreateInstance on IE object failed on XP/SP2 Pin
SenPy27-Sep-04 13:43
SenPy27-Sep-04 13:43 
GeneralRe: PLS HELP : CoCreateInstance on IE object failed on XP/SP2 Pin
Michael Dunn27-Sep-04 19:28
sitebuilderMichael Dunn27-Sep-04 19:28 
GeneralRe: PLS HELP : CoCreateInstance on IE object failed on XP/SP2 Pin
SenPy28-Sep-04 7:21
SenPy28-Sep-04 7:21 
GeneralGet Object corresponding interface Pin
Tholkiem27-Sep-04 12:10
Tholkiem27-Sep-04 12:10 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.