against enforce

Walter Bright newshound2 at digitalmars.com
Mon Mar 28 02:36:15 PDT 2011


On 3/28/2011 12:53 AM, Don wrote:
> If you only have standalone functions, at the moment there's not really any
> benefit to in and out contracts. You can equally well put the asserts at the
> start and end of the function.

In and out contracts come into their own when you're using inheritance. The in 
contract is an OR of all the overridden function in's, and the out is the AND of 
all the overridden out's. It's pretty clunky to do this manually.

They also have a possible future use as input to a static program analyzer.


More information about the Digitalmars-d mailing list