Leigh Johnston wrote:
> On 14/03/2011 14:44, MikeP wrote:
>> If you investigate the tcmalloc code (by Google), you will find the
>> following warning:
>>
>> // NOTE: unsigned types are DANGEROUS in loops and other arithmetical
>> // places. Use the signed types unless your variable represents a bit
>> // pattern (eg a hash value) or you really need the extra bit. Do NOT
>> // use 'unsigned' to express "this value should always be positive";
>> // use assertions for this.
>>
>> Is it just their idiom? What's the problem with using unsigned ints
>> in loops (it seems natural to do so)? Are C++ unsigned ints "broken"
>> somehow?
>
> One religious war at a time please.
>
> /Leigh
Having newsgroup and reader problems... sorry for the duplicate(s).
|