Contracts enable specifying conditions that must hold true when the flow of runtime execution reaches the contract. If a contract is not true, then the program is assumed to have entered an undefined state.
Rationale:Building contract support into the language provides:
See AssertExpression.
See contracts.
See Struct Invariants and Class Invariants.
© 1999–2021 The D Language Foundation
Licensed under the Boost License 1.0.
https://dlang.org/spec/contracts.html