C++ -- a valid idea?

Florian Weimer fw@deneb.enyo.de
Sun Jun 13 08:02:00 GMT 2004


* Alexis Wilke:

> Code which use an int will go very fast:
>
>    for(int i = 0; i < max; i++) ...
>
> If you transform the variable i with an iterator from the standard 
> library:
>
>    for(interator it = v.begin(); it < max; it++) ...
>
> The it++ expression is in many cases slow.

In such cases, you should specify attribute warn_unused_result for the
postfix operator.

-- 
Current mail filters: many dial-up/DSL/cable modem hosts, and the
following domains: bigpond.com, di-ve.com, fuorissimo.com, hotmail.com,
jumpy.it, libero.it, netscape.net, postino.it, simplesnet.pt, spymac.com,
tiscali.co.uk, tiscali.cz, tiscali.it, voila.fr, yahoo.com.



More information about the Gcc mailing list