Click here to Skip to main content
16,011,374 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Arrays! Pin
Tim Smith4-Aug-04 3:57
Tim Smith4-Aug-04 3:57 
GeneralRe: Arrays! Pin
digwizfox4-Aug-04 6:16
digwizfox4-Aug-04 6:16 
GeneralSTL iterators and post/pre incrementing Pin
Jim Crafton4-Aug-04 2:49
Jim Crafton4-Aug-04 2:49 
GeneralRe: STL iterators and post/pre incrementing Pin
Antony M Kancidrowski4-Aug-04 2:57
Antony M Kancidrowski4-Aug-04 2:57 
GeneralRe: STL iterators and post/pre incrementing Pin
RChin4-Aug-04 3:45
RChin4-Aug-04 3:45 
GeneralRe: STL iterators and post/pre incrementing Pin
Nitron4-Aug-04 3:58
Nitron4-Aug-04 3:58 
GeneralRe: STL iterators and post/pre incrementing Pin
digwizfox4-Aug-04 6:25
digwizfox4-Aug-04 6:25 
GeneralRe: STL iterators and post/pre incrementing Pin
Tim Smith4-Aug-04 4:05
Tim Smith4-Aug-04 4:05 
In general it doesn't matter. But the problem is that you would have to know the implementation to be 100% sure.

Here is the p-code for a pre and post increment

post:

value v = ix;
ix = ix + 1;
return v;

pre:

ix = ix + 1;
return ix;

In 99.99% of the cases, the compiler isn't stupid and realizes it doesn't even need the return type and thus never even saves it. However, if your iterator is complex (something more than just a pointer), then the compiler might not be able to optimize away the extra constructor.

Get use to pre-increment. However, as someone pointed out, it isn't always the best thing either.


Tim Smith

I'm going to patent thought. I have yet to see any prior art.
GeneralRe: STL iterators and post/pre incrementing Pin
Anonymous4-Aug-04 17:58
Anonymous4-Aug-04 17:58 
Generalsorry Pin
yingkou4-Aug-04 2:33
yingkou4-Aug-04 2:33 
GeneralRe: sorry Pin
Antony M Kancidrowski4-Aug-04 2:59
Antony M Kancidrowski4-Aug-04 2:59 
GeneralRe: sorry Pin
palbano4-Aug-04 4:59
palbano4-Aug-04 4:59 
GeneralRe: sorry Pin
yingkou4-Aug-04 15:19
yingkou4-Aug-04 15:19 
GeneralRe: sorry Pin
bikram singh5-Aug-04 7:19
bikram singh5-Aug-04 7:19 
QuestionHow to use a external Vfp DLL with VC++ Pin
paulotharso4-Aug-04 1:42
paulotharso4-Aug-04 1:42 
Generalhandling message on log-on Pin
Anonymous4-Aug-04 1:10
Anonymous4-Aug-04 1:10 
GeneralRe: handling message on log-on Pin
David Crow4-Aug-04 3:04
David Crow4-Aug-04 3:04 
GeneralRe: handling message on log-on Pin
bikram singh5-Aug-04 7:27
bikram singh5-Aug-04 7:27 
GeneralDoc/View based app without menu bar Pin
Suresh Chandra M4-Aug-04 0:34
Suresh Chandra M4-Aug-04 0:34 
GeneralRe: Doc/View based app without menu bar Pin
Michael P Butler4-Aug-04 0:48
Michael P Butler4-Aug-04 0:48 
GeneralRe: Doc/View based app without menu bar Pin
Suresh Chandra M4-Aug-04 0:52
Suresh Chandra M4-Aug-04 0:52 
QuestionTansfer a string formula from Excel to C++ ?? Pin
GAR.J4-Aug-04 0:23
GAR.J4-Aug-04 0:23 
AnswerRe: Tansfer a string formula from Excel to C++ ?? Pin
palbano4-Aug-04 5:11
palbano4-Aug-04 5:11 
GeneralNo Question, Solution Pin
V.3-Aug-04 23:42
professionalV.3-Aug-04 23:42 
GeneralWindows Socket problem Pin
bouli3-Aug-04 23:19
bouli3-Aug-04 23:19 

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.