[cfe-commits] r91683 - /cfe/trunk/include/clang/AST/CharUnits.h

John McCall rjmccall at apple.com
Fri Dec 18 09:46:32 PST 2009


On Dec 18, 2009, at 8:34 AM, Ken Dyck wrote:
> On Friday, December 18, 2009 11:12 AM, Daniel Dunbar wrote:
>> 
>> I haven't really been following this work, but is there a 
>> strong motivation for implementing 
>> is{Zero,One,Positive,Negative} instead of just implementing 
>> comparison against an integer type?
> 
> Mainly, it protects against accidentally comparing quantities in
> character units with those in bit units. But it also leads to more
> succinct tests than, for example, "size == CharUnits::fromRaw(0)".
> 
> I'd be fine with removing those predicates, if there's a general feeling
> that they are superfluous. But I think to add a comparison against a raw
> integer would weaken the main purpose of the type.

Agreed.

Apologies for not reviewing this;  I just missed it in the backlog.  It looks fine to me.

John.



More information about the cfe-commits mailing list