Sujet : Re: size_t best practice
De : andreytarasevich (at) *nospam* hotmail.com (Andrey Tarasevich)
Groupes : comp.lang.cDate : 20. Aug 2024, 14:56:59
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <va27bc$3d6tp$2@dont-email.me>
References : 1 2 3
User-Agent : Mozilla Thunderbird
On 08/20/24 6:55 AM, Andrey Tarasevich wrote:
On 08/20/24 6:53 AM, Andrey Tarasevich wrote:
>
For example, iteration all the way to 0 can be idiomatically implemented as
>
for (some_unsigned_type i = size; (some_unsigned_type) i != -1; --i)
...
>
Sorry, a typo. Was meant to be
for (some_unsigned_type i = size; i != (some_unsigned_type) -1; --i)
...
Of, crap. One more time
for (some_unsigned_type i = size - 1;
i != (some_unsigned_type) -1;
--i)
...
Should be good now :)
-- Best regards,Andrey