Click here to Skip to main content
15,921,548 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: How to change Menu caption dynamically? Pin
uus992-Jul-04 4:32
uus992-Jul-04 4:32 
GeneralSubclassing Buttons on CPropertySheet Pin
Monty21-Jul-04 19:46
Monty21-Jul-04 19:46 
GeneralRe: Subclassing Buttons on CPropertySheet Pin
PJ Arends2-Jul-04 17:56
professionalPJ Arends2-Jul-04 17:56 
GeneralCompilation problem after installing XP SP2 PSDK on Win2k machine Pin
Vaibhav Sanghavi1-Jul-04 19:17
Vaibhav Sanghavi1-Jul-04 19:17 
GeneralC++ optimization problem Pin
Indrawati1-Jul-04 13:46
Indrawati1-Jul-04 13:46 
GeneralRe: C++ optimization problem Pin
Ravi Bhavnani1-Jul-04 14:10
professionalRavi Bhavnani1-Jul-04 14:10 
GeneralRe: C++ optimization problem Pin
PJ Arends1-Jul-04 14:12
professionalPJ Arends1-Jul-04 14:12 
GeneralRe: C++ optimization problem Pin
Ryan Binns1-Jul-04 14:17
Ryan Binns1-Jul-04 14:17 
Possibly, but probably not. The size() method is an inline method that simply returns the value of a member variable, so if your compiler optimises correctly it should boil down to a simple comparison with a indirect-indexed value, just the same as if it was a local variable you were comparing against. However, it's probably a good idea to store the size locally anyway, just in case the compiler doesn't optimise it for some reason, and to make it more obvious to humans that you want the code to run as fast as possible.

Obviously, if the size of the vector changes inside the loop, then you'll have to either call size() each time or update your local variable every time you do something that changes the size of the vector (add, delete etc...)

Ryan
"Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"

GeneralRe: C++ optimization problem Pin
Johan Rosengren1-Jul-04 19:44
Johan Rosengren1-Jul-04 19:44 
GeneralRe: C++ optimization problem Pin
Antony M Kancidrowski2-Jul-04 2:11
Antony M Kancidrowski2-Jul-04 2:11 
GeneralRe: C++ optimization problem Pin
Johan Rosengren2-Jul-04 2:20
Johan Rosengren2-Jul-04 2:20 
GeneralRe: C++ optimization problem Pin
Antony M Kancidrowski2-Jul-04 2:35
Antony M Kancidrowski2-Jul-04 2:35 
GeneralRe: C++ optimization problem Pin
Paul Ranson2-Jul-04 3:01
Paul Ranson2-Jul-04 3:01 
QuestionC++ in "Hardware structures" stand point question: Does the ALU handle any floading points operations? or will the processor let the FPU handles them? Pin
Link26001-Jul-04 13:29
Link26001-Jul-04 13:29 
AnswerRe: C++ in "Hardware structures" stand point question: Does the ALU handle any floading points operations? or will the processor let the FPU handles them? Pin
Ryan Binns1-Jul-04 14:21
Ryan Binns1-Jul-04 14:21 
GeneralDynamic controls Pin
richiebabes1-Jul-04 11:47
richiebabes1-Jul-04 11:47 
GeneralRe: Dynamic controls Pin
Yawar Maajed1-Jul-04 12:22
Yawar Maajed1-Jul-04 12:22 
GeneralRe: Dynamic controls Pin
richiebabes1-Jul-04 12:30
richiebabes1-Jul-04 12:30 
GeneralRe: Dynamic controls Pin
Yawar Maajed1-Jul-04 13:11
Yawar Maajed1-Jul-04 13:11 
GeneralWindow title bar - detecting drag end Pin
Anonymous1-Jul-04 11:39
Anonymous1-Jul-04 11:39 
GeneralRe: Window title bar - detecting drag end Pin
Anonymous1-Jul-04 11:41
Anonymous1-Jul-04 11:41 
GeneralRe: Window title bar - detecting drag end Pin
Yawar Maajed1-Jul-04 12:19
Yawar Maajed1-Jul-04 12:19 
GeneralRe: Window title bar - detecting drag end Pin
Yawar Maajed1-Jul-04 12:21
Yawar Maajed1-Jul-04 12:21 
GeneralRe: Window title bar - detecting drag end Pin
Ravi Bhavnani1-Jul-04 13:42
professionalRavi Bhavnani1-Jul-04 13:42 
QuestionHow do you get the path to the WIndows desktop? Pin
Terry O'Nolley1-Jul-04 11:02
Terry O'Nolley1-Jul-04 11:02 

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.