From discussions on stack overflow we have:
++idoes not expect to return a value whilei++might need to return a value.- A modern compiler, for simple data types (i.e. integer) will treat the two
the same if the context is right e.g. in a
forloop - For an object (e.g. an interator), however,
++iwill be faster thani++because a compiler cannot optimize away the creation of a temporary object fori++
Comments
Post a Comment