Skip to content

Support for most/all contract programming features - February 21, 2010

Pre-release
Pre-release
Compare
Choose a tag to compare
@lcaminiti lcaminiti released this 05 Sep 00:06
· 121 commits to master since this release
  1. Removed use of self, variable.now, and variable.old in writing contracts. Object this and variables are now accessed as usual in member functions. CONTRACT_OLDOF(variable) is used to access old values in postconditions.
  2. Added (precondition), (postcondition), and (body) to specify contracts within the function signature sequence. If no preconditions then (precondition) ({...}) is simply omitted from the sequence (same for postconditions, body is mandatory instead). For non-void functions, users can name the result argument with (postcondition) (result-name) ({...}).
  3. Changed contract class template to use same syntax as Boost.Function (i.e., F function type).
  4. Added support for free functions and static member functions.
  5. Added support for subcontracting with multiple inheritance.
  6. Added static class invariants which are always checked (also at constructors entry, destructor exit, and by static member functions).
  7. Added block invariants and Eiffel-like loop variants.
  8. Added handlers to customize action on contract failure (default to std::terminate()).
  9. Removed feature for automatic contract documentation using Doxygen (this is not compatible with added (precondition), (postcondition), and (body) because Doxygen preprocessor is not capable to handle Boost.Preprocessor sequences).
  10. Rewritten entire documentation (now using Boost.QuickBook instead of Doxygen).