Ghost fields for Contract Programming

Tomek Sowiński just at ask.me
Sat Oct 9 12:51:44 PDT 2010


bearophile napisał:

> The ghost fields may be used to store partial computations useful to reduce the work done 
by the class invariant.

You can do:

class C {
  version(unittest) int temp;
  invariant() {
    // use temp
  }
}

Or am I missing something?

-- 
Tomek


More information about the Digitalmars-d mailing list