[GSoC Proposal] Statically Checked Measurement Units

spir denis.spir at gmail.com
Mon Mar 28 16:09:39 PDT 2011


On 03/28/2011 10:13 PM, Cristi Cobzarenco wrote:
>   - The Categorical type sounds like a great idea. I think they could be
> passed on as a ValueType to a quantity:
> typedef Quantity!(City, BoundedInt!(0,100)) CityID;
>
> And BoundedInt is just a type implicitly-convertible to and from int, that
> supports assignment and equality and throws on an out-of-bounds assignment.

I would implement something like Categorical in a language that has no enum. 
But I do not see the point in D. What advantage does it bring?

Denis
-- 
_________________
vita es estrany
spir.wikidot.com



More information about the Digitalmars-d mailing list