[EMAIL PROTECTED] wrote:

> Peng,
> 
> The space between the ++ and i is fine. Some find ++i more readable,
> that is all.
> 
> It is difficult to optimize away the repeated f(n) calls because f()
> could have side effects and there is no guarantee it will always return
> a constant. If f() always returns a constant, this could potentially be
> optimized by interprocedural constant propagation(IPCP)

GCC also offers the __attribute__((pure)) for such functions.

_______________________________________________
help-gplusplus mailing list
help-gplusplus@gnu.org
http://lists.gnu.org/mailman/listinfo/help-gplusplus

Reply via email to