Skip to content

Releases: boostorg/contract

Contracts without the macros - September 2, 2017

05 Sep 01:12
Compare
Choose a tag to compare
  1. Using plain C++ code instead of macros to program contracts.
    The removed macros very hard to use because they required programmers to learn a domain-specific embedded language that replaced the usual C++ syntax for declaring functions and classes.
    The removed macros also made the code less readable, increased compilation time (because of extensive preprocessor meta-programming), and gave cryptic compiler errors.
    However, the removed macros more correctly specified contracts in code declarations instead of definitions, and they completely removed extra code when contracts were disabled (both of those can be done by the current version of this library but at the cost of manually writing some boiler-plate code which was previous automatically handled by the macros instead, see Separate Body Implementation and Disable Contract Compilation).
  2. Simplified the library by removing some extra features that were not directly related to contract programming, specifically:
    Removed loop variants (because these are rarely if ever used).
    Removed named and deduced parameters (because these can be programmed directly using Boost.Parameter).
    Removed concepts (because these can be programmed directly using Boost.ConceptCheck).
    Removed emulation of virtual specifiers override, final, and new (because override can be programmed directly using C++11, while final and new are rarely if ever used).
    Removed static_assert emulation (because this can be programmed directly using C++11, or using Boost.StaticAssert).
  3. Ensuring that old values and return values are copied only once even when subcontracting is used with multiple inheritance.
  4. Improved template meta-programming algorithm that searches the inheritance tree for subcontracting when multiple inheritance is used.
  5. Exception specifications and function-try blocks apply also to exceptions thrown by the contracts, and not just to exceptions thrown by the body.
  6. Added contracts for exception guarantees (using .except(...), etc.).
  7. Added predefined assertion levels for "audit" and "axiom".
  8. Added call_if and condition_if (assertions requirements were supported also by previous revisions of this library but they were handled by internal code generated by the contract macros).

Accepted into Boost - August 20, 2012

05 Sep 00:33
Compare
Choose a tag to compare
Pre-release

NOTE: This revision of the library passed Boost formal review and it was accepted into the Boost libraries (see https://groups.google.com/forum/?fromgroups=#!topic/boost-list/jQ7OjAmos_Y).

  1. Using non-fix-spaced font in Full Table of Contents section.
  2. Added a couple of notes to the documentation.
  3. Changed CONTRACT_MEMBER_BODY(class_type, function_name) to class_type::CONTRACT_MEMBER_BODY(function_name) so the macro can also be used to declare derived classes avoiding using the library syntax even when the base class has contracts.

Simplified syntax, added named parameters and concepts - June 4, 2012

05 Sep 00:18
Compare
Choose a tag to compare
  1. Simplified syntax by reducing extra parenthesis to the bare necessary minimum (using some of the preprocessor parsing techniques originally introduced by Boost.LocalFunction).
  2. Postcondition old values only copy the old-of expression (e.g., copy just vector size instead of entire vector). This improves performance and introduces the ConstantCopyConstructible requirement just for the old value expression type (e.g., a vector might not be copyable while its size always is because it is an integral type). Removed the copyable tag.
  3. Body defined outside the macros (so compiler-errors for definitions retain their usual meaning).
  4. Added CONTRACT_CLASS macro and removed the need to duplicate declaration elements (do not repeat function declaration, do not repeat class name in function declaration, etc).
  5. Using _TPL macros so to reduce compile-time (instead of internally making all templates contract functions so to use typename freely).
  6. Overloading no longer requires unique parameter names.
  7. Added C++11-like virtual specifiers.
  8. Added constant assertions plus constant-expressions for select assertion if-conditions and for loop variants.
  9. Added named and deduced parameters.
  10. Added concept checking.
  11. Removed the interface to use the library without the macro (programmers were required to write too much boiler-plate code for the non-macro interface to be actually usable, plus supporting both the macro and non-macro interfaces limited what the macros could do).

Support for most/all C++ constructs - March 7, 2010

05 Sep 00:13
Compare
Choose a tag to compare
  1. Added support and examples for volatile, auto, explicit, export, extern, friend, inline, struct, and throw (for exception specifications).
  2. Documented that union cannot be contracted.

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

05 Sep 00:06
Compare
Choose a tag to compare
  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).

Compiled on both GCC and MSVC - November 21, 2009

05 Sep 00:01
Compare
Choose a tag to compare
  1. Compiled using both GCC (Linux and Cygwin) and MSVC (Windows XP).
  2. Required to use void to specify empty function argument list. This is to comply with C++03 standard that does not allow to pass empty macro parameters so it does not support empty preprocessor sequences ().

Added documentation - June 17, 2009

04 Sep 23:56
Compare
Choose a tag to compare
Pre-release
  1. Completed first documentation draft.

Cleaned-up first release - April 19, 2009

04 Sep 23:49
Compare
Choose a tag to compare
  1. Reorganized files to cleanup root directory.
  2. Added installation program.

First release - April 19, 2009

04 Sep 23:41
Compare
Choose a tag to compare
Pre-release
  1. First public release.