On Dec 14, 2009, at 12:55 PM, Ken Dyck wrote: > As discussed earlier [1] (apologies for the delay), the attached patch > introduces CharUnits, an opaque value class for quantities with > character units. > > It uses an int64_t to represent the quantity, has a named constructor, a > single explicit conversion to a int64_t, and basic arithmetic, > comparison, and relational operators. It is intended as a return type > for ASTContext::getTypeSizeInBytes() and other methods that return > sizes, offsets and alignments in character units. > > Comments welcome.
Looks great, thanks! It'd be nice if you could completely eliminate the abstraction overhead, which should be straightforward: just (1) use CharUnits() instead of Zero and (2) define that lonesome operator* in the header (with 'inline' to satisfy the linker). John. _______________________________________________ cfe-commits mailing list [email protected] http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
