D-Programming-Language/d-programming-language.org — pull request #174 by monarchdodra (2012-10-09 10:19:09+00:00)
Title: Invariant doc

Mostly:
1. Moved invariant documentation from "classes" to "dbc/contracts" (left a link behind)
2. Changed section title from "Class invariant" to simply "Invariant"
3. Added "or struct" when "class" was mentioned
4. Changed the section about passing to assert:

* Before:

```D
The invariant
can be checked when a class object is the argument to an
assert() expression, as:

------
Date mydate;
...
assert(mydate); // check that class Date invariant holds
------
```

* After:

```D
The invariant can be checked with an assert() expression:

$(OL
$(LI classes need to pass a class object)
$(LI structs need to pass the address of an instance)
)

------
auto mydate = new Date(); //class
auto s = S(); //struct
...
assert(mydate); // check that class Date invariant holds
assert(&s); // check that struct S invariant holds
------
```