Name: Anonymous 2010-07-30 14:59
My favorite is from the section on operator overloading, 13.15. The question is: which is more efficient,
FAQ: It's the same for built-in types. ++i may be faster for user-defined types, because there's no need to create a copy that the compiler may fail to optimize out. Most likely the overhead is small, but why not pick the habit of using ++i?
FQA: Oh, suddenly the all-mighty compiler can't optimize out a temporary!
[high-five /]
++i or i++?FAQ: It's the same for built-in types. ++i may be faster for user-defined types, because there's no need to create a copy that the compiler may fail to optimize out. Most likely the overhead is small, but why not pick the habit of using ++i?
FQA: Oh, suddenly the all-mighty compiler can't optimize out a temporary!
[high-five /]