contract programming without a function

BCS ao at pathlink.com
Sun May 20 13:20:52 PDT 2007


Reply to Jan,

> Actually I know all this, and I've been using it this way. Maybe the
> example I gave was a bit misleading but what I actualy want to know is
> if it's possible to use these pre- and postconditions somewhere else
> then with a function body. Because in the manual they state that with
> a funtion is "the most typical use", so I'm asking myself what the
> other uses could be.
> 
> Jan
> 

other uses would be logging

void foo(int i)
in{writef(">foo(%d)\n", i);}
out{writef("<foo()\n");}




More information about the Digitalmars-d-learn mailing list