C++ bounded::integer library

bearophile via Digitalmars-d digitalmars-d at puremagic.com
Mon May 19 13:18:10 PDT 2014


Nordlöw:

> because saturated is an instantiator function. Shouldn't it?

I still don't understand how you can design a good enough ranged 
integer without something like "enum preconditions". Functions 
run at run-time, so currently in D you can't enforce the 
correctness of literals for not-enum values at compile time. So 
in general the mutable ranged integer can only give the error at 
run-time, and this is not acceptable. I am missing something?

Bye,
bearophile


More information about the Digitalmars-d mailing list