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

Ken Dyck Ken.Dyck at onsemi.com
Fri Dec 18 08:34:37 PST 2009


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.

-Ken




More information about the cfe-commits mailing list