On Monday, 19 May 2014 at 23:02:01 UTC, bearophile wrote:
I think "enum preconditions" are exactly that :-) But I don't know if they are good enough, if they are a good idea, of if there are better ways to do similar things. But I think something like that is an useful improvement for D, able to remove another limitation of user defined types compared to built-ins.

Bye,
bearophile

What's the difference between your proposed "enum precondition" and:

void fun(int n)
in
{
    static assert(...);
}
out
{
    static assert(...);
}
body
{
    //...
}

Reply via email to