Thread overview | |||||
---|---|---|---|---|---|
|
December 20, 2002 documentation bug?: i++ | ||||
---|---|---|---|---|
| ||||
hello, in various documentation texts there is "for (int i = 0; i < _something_; i++)". why i++? I think it should be ++i, no metter how good optimizer we have. regards, Georg |
December 21, 2002 Re: documentation bug?: i++ | ||||
---|---|---|---|---|
| ||||
Posted in reply to Georg D. | Georg D. wrote:
> hello,
>
> in various documentation texts there is "for (int i = 0; i < _something_;
> i++)".
> why i++? I think it should be ++i, no metter how good optimizer we have.
>
> regards,
> Georg
++i and i++ both have valid and different semantic meanings. Both are allowed in D. I don't see what difference it makes which one you use in a loop.
Evan
|
December 28, 2002 Re: documentation bug?: i++ | ||||
---|---|---|---|---|
| ||||
Posted in reply to Evan McClanahan | "Evan McClanahan" <evan@dontSPAMaltarinteractive.com> wrote in message news:au25pi$2nsb$1@digitaldaemon.com... > > in various documentation texts there is "for (int i = 0; i < _something_; > > i++)". > > why i++? I think it should be ++i, no metter how good optimizer we have. > ++i and i++ both have valid and different semantic meanings. Both are allowed in D. I don't see what difference it makes which one you use in a loop. Since for that use, the same code will be generated for either, which you use is purely a matter of personal taste. |
Copyright © 1999-2021 by the D Language Foundation