[Insight-developers] Postfix versus Prefix operators

Williams, Norman K norman-k-williams at uiowa.edu
Fri May 27 10:48:35 EDT 2011


An interesting discussion, and it just goes to show I can use C++ for 20
years and still be ignorant on some points of the language.

I get bit by it with ITK iterators which are prefix-iterator-only, because
I've been writing

for(i=0; i<limit; i++)
{
}

since 1982.

Maybe as a style matter, we should avoid code that depends on order of
increment altogether?  Aside from argc/argv idioms that go back to the
Kernighan & Ritchie 'White Book', is there ever a good reason to embed
post-increment (or pre-increment) in expressions?



________________________________
Notice: This UI Health Care e-mail (including attachments) is covered by the Electronic Communications Privacy Act, 18 U.S.C. 2510-2521, is confidential and may be legally privileged.  If you are not the intended recipient, you are hereby notified that any retention, dissemination, distribution, or copying of this communication is strictly prohibited.  Please reply to the sender that you have received the message in error, then delete it.  Thank you.
________________________________


More information about the Insight-developers mailing list