How is the correct way of mix  Pre and Post contracts and signature constraints 
?

I try this that looks logic way and not compile : 

T foo (T) (T a) 
if ( is(T : real)) {
 in {
        assert (a > 0); 
 }
 body {
        return a*2;
 }
}

I get this errors : 
Declaration expected, not 'if'
unrecognized declaration

And this with same result :

T foo (T) (T a) 
in {
        assert (a > 0); 
}
if ( is(T : real)) {
 body {
        return a*2;
 }
}

I'm using dmd 2.053.

-- 
Yep, I'm afraid that I have a blog : zardoz.es

Reply via email to