Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r72789 - in sandbox/contract/libs/contract/doc/html: . contract contract__ doc doc/html doc/html/images doc/src doc/src/images doc/src/images/callouts
From: lorcaminiti_at_[hidden]
Date: 2011-06-28 20:54:49


Author: lcaminiti
Date: 2011-06-28 20:54:41 EDT (Tue, 28 Jun 2011)
New Revision: 72789
URL: http://svn.boost.org/trac/boost/changeset/72789

Log:
Updating docs.
Added:
   sandbox/contract/libs/contract/doc/html/
   sandbox/contract/libs/contract/doc/html/CONTRACT_ASSERT.html (contents, props changed)
   sandbox/contract/libs/contract/doc/html/CONTRACT_ASSERT_BLOCK_INVARIANT.html (contents, props changed)
   sandbox/contract/libs/contract/doc/html/CONTRACT_ASSERT_BLOCK_INVARIANT_MSG.html (contents, props changed)
   sandbox/contract/libs/contract/doc/html/CONTRACT_ASSERT_LOOP_VARIANT.html (contents, props changed)
   sandbox/contract/libs/contract/doc/html/CONTRACT_ASSERT_LOOP_VARIANT_MSG.html (contents, props changed)
   sandbox/contract/libs/contract/doc/html/CONTRACT_ASSERT_MSG.html (contents, props changed)
   sandbox/contract/libs/contract/doc/html/CONTRACT_BODY.html (contents, props changed)
   sandbox/contract/libs/contract/doc/html/CONTRACT_CHECK_BLOCK_INVARIANT.html (contents, props changed)
   sandbox/contract/libs/contract/doc/html/CONTRACT_CHECK_CLASS_INVARIANT.html (contents, props changed)
   sandbox/contract/libs/contract/doc/html/CONTRACT_CHECK_POSTCONDITION.html (contents, props changed)
   sandbox/contract/libs/contract/doc/html/CONTRACT_CHECK_PRECONDITION.html (contents, props changed)
   sandbox/contract/libs/contract/doc/html/CONTRACT_CONFIG_MAX_FUNCTION_ARITY.html (contents, props changed)
   sandbox/contract/libs/contract/doc/html/CONTRACT_CONFIG_MAX_MULTIPLE_INHERITANCE.html (contents, props changed)
   sandbox/contract/libs/contract/doc/html/CONTRACT_CONSTRUCTOR.html (contents, props changed)
   sandbox/contract/libs/contract/doc/html/CONTRACT_CONSTRUCTOR_BODY.html (contents, props changed)
   sandbox/contract/libs/contract/doc/html/CONTRACT_DESTRUCTOR.html (contents, props changed)
   sandbox/contract/libs/contract/doc/html/CONTRACT_DESTRUCTOR_BODY.html (contents, props changed)
   sandbox/contract/libs/contract/doc/html/CONTRACT_FUNCTION.html (contents, props changed)
   sandbox/contract/libs/contract/doc/html/CONTRACT_INIT_LOOP_VARIANT.html (contents, props changed)
   sandbox/contract/libs/contract/doc/html/CONTRACT_INVARIANT.html (contents, props changed)
   sandbox/contract/libs/contract/doc/html/CONTRACT_OLDOF.html (contents, props changed)
   sandbox/contract/libs/contract/doc/html/CONTRACT_WRAP_TYPE.html (contents, props changed)
   sandbox/contract/libs/contract/doc/html/contract/
   sandbox/contract/libs/contract/doc/html/contract/block_invariant_failed.html (contents, props changed)
   sandbox/contract/libs/contract/doc/html/contract/class_invariant_failed.html (contents, props changed)
   sandbox/contract/libs/contract/doc/html/contract/constructor.html (contents, props changed)
   sandbox/contract/libs/contract/doc/html/contract/contract_failed_handler.html (contents, props changed)
   sandbox/contract/libs/contract/doc/html/contract/copy.html (contents, props changed)
   sandbox/contract/libs/contract/doc/html/contract/copyable.html (contents, props changed)
   sandbox/contract/libs/contract/doc/html/contract/destructor.html (contents, props changed)
   sandbox/contract/libs/contract/doc/html/contract/failure.html (contents, props changed)
   sandbox/contract/libs/contract/doc/html/contract/from.html (contents, props changed)
   sandbox/contract/libs/contract/doc/html/contract/loop_variant_type.html (contents, props changed)
   sandbox/contract/libs/contract/doc/html/contract/nonmember_function.html (contents, props changed)
   sandbox/contract/libs/contract/doc/html/contract/nonstatic_member_function.html (contents, props changed)
   sandbox/contract/libs/contract/doc/html/contract/postcondition_failed.html (contents, props changed)
   sandbox/contract/libs/contract/doc/html/contract/precondition_failed.html (contents, props changed)
   sandbox/contract/libs/contract/doc/html/contract/set_block_invariant_failed.html (contents, props changed)
   sandbox/contract/libs/contract/doc/html/contract/set_class_invariant_failed.html (contents, props changed)
   sandbox/contract/libs/contract/doc/html/contract/set_postcondition_failed.html (contents, props changed)
   sandbox/contract/libs/contract/doc/html/contract/set_precondition_failed.html (contents, props changed)
   sandbox/contract/libs/contract/doc/html/contract/state.html (contents, props changed)
   sandbox/contract/libs/contract/doc/html/contract/static_member_function.html (contents, props changed)
   sandbox/contract/libs/contract/doc/html/contract/wrap.html (contents, props changed)
   sandbox/contract/libs/contract/doc/html/contract/wrap_void_T__id2358596.html (contents, props changed)
   sandbox/contract/libs/contract/doc/html/contract/wrap_void_T__id437056.html (contents, props changed)
   sandbox/contract/libs/contract/doc/html/contract/wrap_void_T__id437106.html (contents, props changed)
   sandbox/contract/libs/contract/doc/html/contract/wrap_void_T__id437174.html (contents, props changed)
   sandbox/contract/libs/contract/doc/html/contract/wrap_void_T__id437179.html (contents, props changed)
   sandbox/contract/libs/contract/doc/html/contract/wrap_void_T__id437181.html (contents, props changed)
   sandbox/contract/libs/contract/doc/html/contract/wrap_void_T__id437240.html (contents, props changed)
   sandbox/contract/libs/contract/doc/html/contract/wrap_void_T__id437311.html (contents, props changed)
   sandbox/contract/libs/contract/doc/html/contract/wrap_void_T__id437312.html (contents, props changed)
   sandbox/contract/libs/contract/doc/html/contract/wrap_void_T__id437380.html (contents, props changed)
   sandbox/contract/libs/contract/doc/html/contract/wrap_void_T__id437384.html (contents, props changed)
   sandbox/contract/libs/contract/doc/html/contract/wrap_void_T__id437445.html (contents, props changed)
   sandbox/contract/libs/contract/doc/html/contract/wrap_void_T__id437465.html (contents, props changed)
   sandbox/contract/libs/contract/doc/html/contract/wrap_void_T__id437506.html (contents, props changed)
   sandbox/contract/libs/contract/doc/html/contract/wrap_void_T__id437513.html (contents, props changed)
   sandbox/contract/libs/contract/doc/html/contract/wrap_void_T__id437516.html (contents, props changed)
   sandbox/contract/libs/contract/doc/html/contract/wrap_void_T__id437520.html (contents, props changed)
   sandbox/contract/libs/contract/doc/html/contract/wrap_void_T__id437556.html (contents, props changed)
   sandbox/contract/libs/contract/doc/html/contract/wrap_void_T__id437585.html (contents, props changed)
   sandbox/contract/libs/contract/doc/html/contract/wrap_void_T__id437653.html (contents, props changed)
   sandbox/contract/libs/contract/doc/html/contract/wrap_void_T__id437721.html (contents, props changed)
   sandbox/contract/libs/contract/doc/html/contract/wrap_void_T__id437784.html (contents, props changed)
   sandbox/contract/libs/contract/doc/html/contract/wrap_void_T__id437791.html (contents, props changed)
   sandbox/contract/libs/contract/doc/html/contract/wrap_void_T__id437854.html (contents, props changed)
   sandbox/contract/libs/contract/doc/html/contract/wrap_void_T__id437991.html (contents, props changed)
   sandbox/contract/libs/contract/doc/html/contract/wrap_void_T__id437994.html (contents, props changed)
   sandbox/contract/libs/contract/doc/html/contract/wrap_void_T__id438135.html (contents, props changed)
   sandbox/contract/libs/contract/doc/html/contract/wrap_void_T__id438205.html (contents, props changed)
   sandbox/contract/libs/contract/doc/html/contract/wrap_void_T__id438271.html (contents, props changed)
   sandbox/contract/libs/contract/doc/html/contract/wrap_void_T__id438810.html (contents, props changed)
   sandbox/contract/libs/contract/doc/html/contract/wrap_void_T__id439081.html (contents, props changed)
   sandbox/contract/libs/contract/doc/html/contract/wrap_void_T__id439083.html (contents, props changed)
   sandbox/contract/libs/contract/doc/html/contract/wrap_void_T__id439086.html (contents, props changed)
   sandbox/contract/libs/contract/doc/html/contract__/
   sandbox/contract/libs/contract/doc/html/contract__/Rationale.html (contents, props changed)
   sandbox/contract/libs/contract/doc/html/contract__/Requirements.html (contents, props changed)
   sandbox/contract/libs/contract/doc/html/contract__/bibliography.html (contents, props changed)
   sandbox/contract/libs/contract/doc/html/contract__/contract_programming.html (contents, props changed)
   sandbox/contract/libs/contract/doc/html/contract__/examples.html (contents, props changed)
   sandbox/contract/libs/contract/doc/html/contract__/getting_started.html (contents, props changed)
   sandbox/contract/libs/contract/doc/html/contract__/grammar.html (contents, props changed)
   sandbox/contract/libs/contract/doc/html/contract__/license.html (contents, props changed)
   sandbox/contract/libs/contract/doc/html/contract__/release_history.html (contents, props changed)
   sandbox/contract/libs/contract/doc/html/contract__/throw_on_failure.html (contents, props changed)
   sandbox/contract/libs/contract/doc/html/contract__/todo.html (contents, props changed)
   sandbox/contract/libs/contract/doc/html/contract__/tutorial.html (contents, props changed)
   sandbox/contract/libs/contract/doc/html/contract__/without_the_macros.html (contents, props changed)
   sandbox/contract/libs/contract/doc/html/doc/
   sandbox/contract/libs/contract/doc/html/doc/html/
   sandbox/contract/libs/contract/doc/html/doc/html/boostbook.css (contents, props changed)
   sandbox/contract/libs/contract/doc/html/doc/html/images/
   sandbox/contract/libs/contract/doc/html/doc/html/images/alert.png (contents, props changed)
   sandbox/contract/libs/contract/doc/html/doc/html/images/blank.png (contents, props changed)
   sandbox/contract/libs/contract/doc/html/doc/html/images/caution.png (contents, props changed)
   sandbox/contract/libs/contract/doc/html/doc/html/images/draft.png (contents, props changed)
   sandbox/contract/libs/contract/doc/html/doc/html/images/home.png (contents, props changed)
   sandbox/contract/libs/contract/doc/html/doc/html/images/important.png (contents, props changed)
   sandbox/contract/libs/contract/doc/html/doc/html/images/next.png (contents, props changed)
   sandbox/contract/libs/contract/doc/html/doc/html/images/next_disabled.png (contents, props changed)
   sandbox/contract/libs/contract/doc/html/doc/html/images/note.png (contents, props changed)
   sandbox/contract/libs/contract/doc/html/doc/html/images/prev.png (contents, props changed)
   sandbox/contract/libs/contract/doc/html/doc/html/images/prev_disabled.png (contents, props changed)
   sandbox/contract/libs/contract/doc/html/doc/html/images/smiley.png (contents, props changed)
   sandbox/contract/libs/contract/doc/html/doc/html/images/tip.png (contents, props changed)
   sandbox/contract/libs/contract/doc/html/doc/html/images/toc-blank.png (contents, props changed)
   sandbox/contract/libs/contract/doc/html/doc/html/images/toc-minus.png (contents, props changed)
   sandbox/contract/libs/contract/doc/html/doc/html/images/toc-plus.png (contents, props changed)
   sandbox/contract/libs/contract/doc/html/doc/html/images/up.png (contents, props changed)
   sandbox/contract/libs/contract/doc/html/doc/html/images/up_disabled.png (contents, props changed)
   sandbox/contract/libs/contract/doc/html/doc/html/images/warning.png (contents, props changed)
   sandbox/contract/libs/contract/doc/html/doc/src/
   sandbox/contract/libs/contract/doc/html/doc/src/images/
   sandbox/contract/libs/contract/doc/html/doc/src/images/callouts/
   sandbox/contract/libs/contract/doc/html/doc/src/images/callouts/1.png (contents, props changed)

Added: sandbox/contract/libs/contract/doc/html/CONTRACT_ASSERT.html
==============================================================================
--- (empty file)
+++ sandbox/contract/libs/contract/doc/html/CONTRACT_ASSERT.html 2011-06-28 20:54:41 EDT (Tue, 28 Jun 2011)
@@ -0,0 +1,69 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
+<title>Macro CONTRACT_ASSERT</title>
+<link rel="stylesheet" href="doc/html/boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
+<link rel="home" href="index.html" title="Contract++ 0.3.490">
+<link rel="up" href="reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.assert_hpp" title="Header &lt;E:/sandbox/contractpp/trunk/doc/qbk/src/contract/assert.hpp&gt;">
+<link rel="prev" href="contract/postcondition_failed.html" title="Function postcondition_failed">
+<link rel="next" href="CONTRACT_ASSERT_MSG.html" title="Macro CONTRACT_ASSERT_MSG">
+</head>
+<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
+<table cellpadding="2" width="100%"><tr><td valign="top"></td></tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="contract/postcondition_failed.html"><img src="images/prev.png" alt="Prev"></a><a accesskey="u" href="reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.assert_hpp"><img src="images/up.png" alt="Up"></a><a accesskey="h" href="index.html"><img src="images/home.png" alt="Home"></a><a accesskey="n" href="CONTRACT_ASSERT_MSG.html"><img src="images/next.png" alt="Next"></a>
+</div>
+<div class="refentry">
+<a name="CONTRACT_ASSERT"></a><div class="titlepage"></div>
+<div class="refnamediv">
+<h2><span class="refentrytitle">Macro CONTRACT_ASSERT</span></h2>
+<p>CONTRACT_ASSERT</p>
+</div>
+<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
+<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="comment">// In header: &lt;<a class="link" href="reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.assert_hpp" title="Header &lt;E:/sandbox/contractpp/trunk/doc/qbk/src/contract/assert.hpp&gt;">E:/sandbox/contractpp/trunk/doc/qbk/src/contract/assert.hpp</a>&gt;
+
+</span>CONTRACT_ASSERT(boolean_condition)</pre></div>
+<div class="refsect1">
+<a name="id961537"></a><h2>Description</h2>
+<p>Macro used to assert contract conditions for class invariants, preconditions, and postconditions.</p>
+<p>Whenever possible, it is recommended to use this macro instead of throwing <code class="computeroutput"><a class="link" href="contract/failure.html" title="Class failure">contract::failure</a></code> directly. For example (see the Tutorial section for more information): </p>
+<pre class="programlisting"> <span class="identifier">CONTRACT_ASSERT</span><span class="special">(</span> <span class="keyword">true</span> <span class="special">)</span><span class="special">;</span>
+</pre>
+<p>The code asserting the specified boolean condition is used as the description of the assertion (otherwise use <code class="computeroutput">CONTRACT_ASSERT_MSG()</code>).</p>
+<p><span class="bold"><strong>Parameters:</strong></span> </p>
+<div class="informaltable"><table class="table">
+<colgroup>
+<col>
+<col>
+</colgroup>
+<tbody><tr>
+<td><span class="bold"><strong><code class="computeroutput">boolean_condition</code></strong></span></td>
+<td>The boolean contract condition being asserted. </td>
+</tr></tbody>
+</table></div>
+<p>
+</p>
+<p><span class="bold"><strong>Returns:</strong></span> This macro expands to code equivalent to the following (see the Without the Macros section): </p>
+<pre class="programlisting"> <span class="keyword">if</span> <span class="special">(</span><span class="special">!</span><span class="special">(</span><span class="identifier">boolean_condition</span><span class="special">)</span><span class="special">)</span>
+ <span class="keyword">throw</span> <a class="link" href="contract/failure.html" title="Class failure">contract::failure</a><span class="special">(</span><span class="identifier">__FILE__</span><span class="special">,</span> <span class="identifier">__LINE__</span><span class="special">,</span> <span class="special">#</span> <span class="identifier">boolean_condition</span><span class="special">)</span><span class="special">;</span>
+</pre>
+<p> Note how <code class="computeroutput">__FILE__</code> and <code class="computeroutput">__LINE__</code> are automatically used by the macro to improve error reporting. (The preprocessor operator <code class="computeroutput">#</code> makes a string from the specified token.)</p>
+<p><span class="bold"><strong>See:</strong></span> <code class="computeroutput">CONTRACT_ASSERT_MSG()</code>, <code class="computeroutput"><a class="link" href="contract/failure.html" title="Class failure">contract::failure</a></code> </p>
+</div>
+</div>
+<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
+<td align="left"></td>
+<td align="right"><div class="copyright-footer">Copyright &#169; 2009, 2010 Lorenzo Caminiti<p>
+ Distributed under the Contract++ Software License, Version 1.0 (see accompanying
+ file LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="contract/postcondition_failed.html"><img src="images/prev.png" alt="Prev"></a><a accesskey="u" href="reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.assert_hpp"><img src="images/up.png" alt="Up"></a><a accesskey="h" href="index.html"><img src="images/home.png" alt="Home"></a><a accesskey="n" href="CONTRACT_ASSERT_MSG.html"><img src="images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>

Added: sandbox/contract/libs/contract/doc/html/CONTRACT_ASSERT_BLOCK_INVARIANT.html
==============================================================================
--- (empty file)
+++ sandbox/contract/libs/contract/doc/html/CONTRACT_ASSERT_BLOCK_INVARIANT.html 2011-06-28 20:54:41 EDT (Tue, 28 Jun 2011)
@@ -0,0 +1,76 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
+<title>Macro CONTRACT_ASSERT_BLOCK_INVARIANT</title>
+<link rel="stylesheet" href="doc/html/boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
+<link rel="home" href="index.html" title="Contract++ 0.3.490">
+<link rel="up" href="reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.block_hpp" title="Header &lt;E:/sandbox/contractpp/trunk/doc/qbk/src/contract/block.hpp&gt;">
+<link rel="prev" href="contract/loop_variant_type.html" title="Type definition loop_variant_type">
+<link rel="next" href="CONTRACT_ASSERT_BLOCK_INVARIANT_MSG.html" title="Macro CONTRACT_ASSERT_BLOCK_INVARIANT_MSG">
+</head>
+<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
+<table cellpadding="2" width="100%"><tr><td valign="top"></td></tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="contract/loop_variant_type.html"><img src="images/prev.png" alt="Prev"></a><a accesskey="u" href="reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.block_hpp"><img src="images/up.png" alt="Up"></a><a accesskey="h" href="index.html"><img src="images/home.png" alt="Home"></a><a accesskey="n" href="CONTRACT_ASSERT_BLOCK_INVARIANT_MSG.html"><img src="images/next.png" alt="Next"></a>
+</div>
+<div class="refentry">
+<a name="CONTRACT_ASSERT_BLOCK_INVARIANT"></a><div class="titlepage"></div>
+<div class="refnamediv">
+<h2><span class="refentrytitle">Macro CONTRACT_ASSERT_BLOCK_INVARIANT</span></h2>
+<p>CONTRACT_ASSERT_BLOCK_INVARIANT</p>
+</div>
+<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
+<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="comment">// In header: &lt;<a class="link" href="reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.block_hpp" title="Header &lt;E:/sandbox/contractpp/trunk/doc/qbk/src/contract/block.hpp&gt;">E:/sandbox/contractpp/trunk/doc/qbk/src/contract/block.hpp</a>&gt;
+
+</span>CONTRACT_ASSERT_BLOCK_INVARIANT(boolen_condition)</pre></div>
+<div class="refsect1">
+<a name="id962620"></a><h2>Description</h2>
+<p>Macro used to assert invariant contract conditions from within a code block.</p>
+<p>To assert class invariants, preconditions, and postcondition use <code class="computeroutput">CONTRACT_ASSERT()</code> instead.</p>
+<p>The code asserting the boolean condition is also used as the description of the condition. For example (see the Tutorial section for more information): </p>
+<pre class="programlisting"> <span class="special">...</span>
+ <span class="special">{</span> <span class="comment">// From within this code block.</span>
+ <span class="keyword">int</span> <span class="identifier">x</span> <span class="special">=</span> <span class="number">0</span><span class="special">;</span>
+ <span class="identifier">CONTRACT_ASSERT_BLOCK_INVARIANT</span><span class="special">(</span> <span class="identifier">x</span> <span class="special">==</span> <span class="number">0</span> <span class="special">)</span><span class="special">;</span>
+ <span class="special">}</span>
+ <span class="special">...</span>
+</pre>
+<p><span class="bold"><strong>Parameters:</strong></span> </p>
+<div class="informaltable"><table class="table">
+<colgroup>
+<col>
+<col>
+</colgroup>
+<tbody><tr>
+<td><span class="bold"><strong><code class="computeroutput">boolean_condition</code></strong></span></td>
+<td>The boolean contract condition being asserted. </td>
+</tr></tbody>
+</table></div>
+<p>
+</p>
+<p><span class="bold"><strong>Returns:</strong></span> This macro expands to code that will automatically invoke <code class="computeroutput">contract::block_invariant_failed()</code> if the specified condition is evaluated to be <code class="computeroutput">false</code>. The macro expands to code equivalent to the following: </p>
+<pre class="programlisting"> <span class="keyword">try</span> <span class="special">{</span>
+ <span class="identifier">CONTRACT_ASSERT</span><span class="special">(</span> <span class="identifier">boolean_condition</span> <span class="special">)</span><span class="special">;</span>
+ <span class="special">}</span> <span class="keyword">catch</span> <span class="special">(</span><span class="special">...</span><span class="special">)</span> <span class="special">{</span>
+ <span class="identifier">contract</span><span class="special">::</span><span class="identifier">block_invariant_failed</span><span class="special">(</span><span class="identifier">contract</span><span class="special">::</span><span class="identifier">FROM_BLOCK</span><span class="special">)</span><span class="special">;</span>
+ <span class="special">}</span>
+</pre>
+<p><span class="bold"><strong>See:</strong></span> <code class="computeroutput">CONTRACT_ASSERT_BLOCK_INVARIANT_MSG()</code> </p>
+</div>
+</div>
+<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
+<td align="left"></td>
+<td align="right"><div class="copyright-footer">Copyright &#169; 2009, 2010 Lorenzo Caminiti<p>
+ Distributed under the Contract++ Software License, Version 1.0 (see accompanying
+ file LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="contract/loop_variant_type.html"><img src="images/prev.png" alt="Prev"></a><a accesskey="u" href="reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.block_hpp"><img src="images/up.png" alt="Up"></a><a accesskey="h" href="index.html"><img src="images/home.png" alt="Home"></a><a accesskey="n" href="CONTRACT_ASSERT_BLOCK_INVARIANT_MSG.html"><img src="images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>

Added: sandbox/contract/libs/contract/doc/html/CONTRACT_ASSERT_BLOCK_INVARIANT_MSG.html
==============================================================================
--- (empty file)
+++ sandbox/contract/libs/contract/doc/html/CONTRACT_ASSERT_BLOCK_INVARIANT_MSG.html 2011-06-28 20:54:41 EDT (Tue, 28 Jun 2011)
@@ -0,0 +1,82 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
+<title>Macro CONTRACT_ASSERT_BLOCK_INVARIANT_MSG</title>
+<link rel="stylesheet" href="doc/html/boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
+<link rel="home" href="index.html" title="Contract++ 0.3.490">
+<link rel="up" href="reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.block_hpp" title="Header &lt;E:/sandbox/contractpp/trunk/doc/qbk/src/contract/block.hpp&gt;">
+<link rel="prev" href="CONTRACT_ASSERT_BLOCK_INVARIANT.html" title="Macro CONTRACT_ASSERT_BLOCK_INVARIANT">
+<link rel="next" href="CONTRACT_ASSERT_LOOP_VARIANT.html" title="Macro CONTRACT_ASSERT_LOOP_VARIANT">
+</head>
+<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
+<table cellpadding="2" width="100%"><tr><td valign="top"></td></tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="CONTRACT_ASSERT_BLOCK_INVARIANT.html"><img src="images/prev.png" alt="Prev"></a><a accesskey="u" href="reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.block_hpp"><img src="images/up.png" alt="Up"></a><a accesskey="h" href="index.html"><img src="images/home.png" alt="Home"></a><a accesskey="n" href="CONTRACT_ASSERT_LOOP_VARIANT.html"><img src="images/next.png" alt="Next"></a>
+</div>
+<div class="refentry">
+<a name="CONTRACT_ASSERT_BLOCK_INVARIANT_MSG"></a><div class="titlepage"></div>
+<div class="refnamediv">
+<h2><span class="refentrytitle">Macro CONTRACT_ASSERT_BLOCK_INVARIANT_MSG</span></h2>
+<p>CONTRACT_ASSERT_BLOCK_INVARIANT_MSG</p>
+</div>
+<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
+<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="comment">// In header: &lt;<a class="link" href="reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.block_hpp" title="Header &lt;E:/sandbox/contractpp/trunk/doc/qbk/src/contract/block.hpp&gt;">E:/sandbox/contractpp/trunk/doc/qbk/src/contract/block.hpp</a>&gt;
+
+</span>CONTRACT_ASSERT_BLOCK_INVARIANT_MSG(boolean_condition, string_description)</pre></div>
+<div class="refsect1">
+<a name="id962994"></a><h2>Description</h2>
+<p>Macro used to assert invariant contract conditions from within a code block specifying also a human readable message.</p>
+<p>To assert class invariants, preconditions, and postcondition use <code class="computeroutput">CONTRACT_ASSERT_MSG()</code> instead.</p>
+<p>For example (see the Tutorial section for more information): </p>
+<pre class="programlisting"> <span class="special">...</span>
+ <span class="special">{</span> <span class="comment">// From within this code block.</span>
+ <span class="keyword">int</span> <span class="identifier">x</span> <span class="special">=</span> <span class="number">0</span><span class="special">;</span>
+ <span class="identifier">CONTRACT_ASSERT_BLOCK_INVARIANT_MSG</span><span class="special">(</span> <span class="identifier">x</span> <span class="special">==</span> <span class="number">0</span><span class="special">,</span> <span class="string">"x is zero"</span> <span class="special">)</span><span class="special">;</span>
+ <span class="special">}</span>
+ <span class="special">...</span>
+</pre>
+<p><span class="bold"><strong>Parameters:</strong></span> </p>
+<div class="informaltable"><table class="table">
+<colgroup>
+<col>
+<col>
+</colgroup>
+<tbody>
+<tr>
+<td><span class="bold"><strong><code class="computeroutput">boolean_condition</code></strong></span></td>
+<td>The boolean contract condition being asserted. </td>
+</tr>
+<tr>
+<td><span class="bold"><strong><code class="computeroutput">string_description</code></strong></span></td>
+<td>A string providing a human readable description of the condition being asserted. (used for error reporting). </td>
+</tr>
+</tbody>
+</table></div>
+<p>
+</p>
+<p><span class="bold"><strong>Returns:</strong></span> This macro expands to code that will automatically invoke <code class="computeroutput">contract::block_invariant_failed()</code> if the specified condition is evaluated to be <code class="computeroutput">false</code>. The macro expands to code equivalent to the following: </p>
+<pre class="programlisting"> <span class="keyword">try</span> <span class="special">{</span>
+ <span class="identifier">CONTRACT_ASSERT_MSG</span><span class="special">(</span> <span class="identifier">boolean_condition</span><span class="special">,</span> <span class="identifier">string_description</span> <span class="special">)</span><span class="special">;</span>
+ <span class="special">}</span> <span class="keyword">catch</span> <span class="special">(</span><span class="special">...</span><span class="special">)</span> <span class="special">{</span>
+ <span class="identifier">contract</span><span class="special">::</span><span class="identifier">block_invariant_failed</span><span class="special">(</span><span class="identifier">contract</span><span class="special">::</span><span class="identifier">FROM_BLOCK</span><span class="special">)</span><span class="special">;</span>
+ <span class="special">}</span>
+</pre>
+<p><span class="bold"><strong>See:</strong></span> <code class="computeroutput">CONTRACT_ASSERT_BLOCK_INVARIANT()</code> </p>
+</div>
+</div>
+<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
+<td align="left"></td>
+<td align="right"><div class="copyright-footer">Copyright &#169; 2009, 2010 Lorenzo Caminiti<p>
+ Distributed under the Contract++ Software License, Version 1.0 (see accompanying
+ file LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="CONTRACT_ASSERT_BLOCK_INVARIANT.html"><img src="images/prev.png" alt="Prev"></a><a accesskey="u" href="reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.block_hpp"><img src="images/up.png" alt="Up"></a><a accesskey="h" href="index.html"><img src="images/home.png" alt="Home"></a><a accesskey="n" href="CONTRACT_ASSERT_LOOP_VARIANT.html"><img src="images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>

Added: sandbox/contract/libs/contract/doc/html/CONTRACT_ASSERT_LOOP_VARIANT.html
==============================================================================
--- (empty file)
+++ sandbox/contract/libs/contract/doc/html/CONTRACT_ASSERT_LOOP_VARIANT.html 2011-06-28 20:54:41 EDT (Tue, 28 Jun 2011)
@@ -0,0 +1,81 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
+<title>Macro CONTRACT_ASSERT_LOOP_VARIANT</title>
+<link rel="stylesheet" href="doc/html/boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
+<link rel="home" href="index.html" title="Contract++ 0.3.490">
+<link rel="up" href="reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.block_hpp" title="Header &lt;E:/sandbox/contractpp/trunk/doc/qbk/src/contract/block.hpp&gt;">
+<link rel="prev" href="CONTRACT_ASSERT_BLOCK_INVARIANT_MSG.html" title="Macro CONTRACT_ASSERT_BLOCK_INVARIANT_MSG">
+<link rel="next" href="CONTRACT_ASSERT_LOOP_VARIANT_MSG.html" title="Macro CONTRACT_ASSERT_LOOP_VARIANT_MSG">
+</head>
+<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
+<table cellpadding="2" width="100%"><tr><td valign="top"></td></tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="CONTRACT_ASSERT_BLOCK_INVARIANT_MSG.html"><img src="images/prev.png" alt="Prev"></a><a accesskey="u" href="reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.block_hpp"><img src="images/up.png" alt="Up"></a><a accesskey="h" href="index.html"><img src="images/home.png" alt="Home"></a><a accesskey="n" href="CONTRACT_ASSERT_LOOP_VARIANT_MSG.html"><img src="images/next.png" alt="Next"></a>
+</div>
+<div class="refentry">
+<a name="CONTRACT_ASSERT_LOOP_VARIANT"></a><div class="titlepage"></div>
+<div class="refnamediv">
+<h2><span class="refentrytitle">Macro CONTRACT_ASSERT_LOOP_VARIANT</span></h2>
+<p>CONTRACT_ASSERT_LOOP_VARIANT</p>
+</div>
+<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
+<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="comment">// In header: &lt;<a class="link" href="reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.block_hpp" title="Header &lt;E:/sandbox/contractpp/trunk/doc/qbk/src/contract/block.hpp&gt;">E:/sandbox/contractpp/trunk/doc/qbk/src/contract/block.hpp</a>&gt;
+
+</span>CONTRACT_ASSERT_LOOP_VARIANT(integer_expression)</pre></div>
+<div class="refsect1">
+<a name="id963408"></a><h2>Description</h2>
+<p>Macro used to assert loop variant.</p>
+<p>At each loop iteration, the value of the specified loop variant expression is automatically evaluated and asserted to be positive (<code class="computeroutput">&gt; 0</code>) and to decrease (<code class="computeroutput">&lt;</code>) from the variant value at previous loop iteration. A loop can only have one variant.</p>
+<p><span class="bold"><strong>Note:</strong></span> Loop variants can be used to check <span class="bold"><strong>loop correctness</strong></span> (see the Tutorial section and related references): Because the loop variant decreases monotonically at each loop iteration and it cannot be zero or smaller than zero, it is possible to guarantee loop termination.</p>
+<p>The macro <code class="computeroutput">CONTRACT_INIT_LOOP_VARIANT</code> must be used (once and only once) before asserting the loop variant and within the same or higher scope of the block containing <code class="computeroutput">CONTRACT_ASSERT_LOOP_VARIANT()</code>.</p>
+<p>Loops are code blocks that repeat themselves in iteration. Therefore, it is possible to use <code class="computeroutput">CONTRACT_ASSERT_BLOCK_INVARIANT()</code> (or <code class="computeroutput">CONTRACT_ASSERT_BLOCK_INVARIANT_MSG()</code>) to assert loop invariants together with loop variants. A loop can have multiple invariants.</p>
+<p>For example (see the Tutorial section for more information): </p>
+<pre class="programlisting"> <span class="special">...</span>
+ <span class="special">{</span>
+ <span class="identifier">CONTRACT_INIT_LOOP_VARIANT</span><span class="special">;</span> <span class="comment">// Declare variant within scope.</span>
+ <span class="keyword">for</span> <span class="special">(</span><span class="identifier">i</span> <span class="special">=</span> <span class="number">0</span><span class="special">;</span> <span class="identifier">i</span> <span class="special">&lt;</span> <span class="identifier">v</span><span class="special">.</span><span class="identifier">size</span><span class="special">(</span><span class="special">)</span><span class="special">;</span> <span class="special">++</span><span class="identifier">i</span><span class="special">)</span> <span class="special">{</span>
+ <span class="comment">// Loop invariants.</span>
+ <span class="identifier">CONTRACT_ASSERT_BLOCK_INVARIANT</span><span class="special">(</span> <span class="identifier">i</span> <span class="special">&gt;=</span> <span class="number">0</span> <span class="special">)</span><span class="special">;</span>
+ <span class="identifier">CONTRACT_ASSERT_BLOCK_INVARIANT</span><span class="special">(</span> <span class="identifier">i</span> <span class="special">&lt;</span> <span class="identifier">v</span><span class="special">.</span><span class="identifier">size</span><span class="special">(</span><span class="special">)</span> <span class="special">)</span><span class="special">;</span>
+ <span class="comment">// Loop variant (assert always positive and decreasing).</span>
+ <span class="identifier">CONTRACT_ASSERT_LOOP_VARIANT</span><span class="special">(</span> <span class="identifier">v</span><span class="special">.</span><span class="identifier">size</span><span class="special">(</span><span class="special">)</span> <span class="special">-</span> <span class="identifier">i</span> <span class="special">)</span><span class="special">;</span>
+
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special">&lt;&lt;</span> <span class="identifier">v</span><span class="special">[</span><span class="identifier">i</span><span class="special">]</span> <span class="special">&lt;&lt;</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">endl</span><span class="special">;</span>
+ <span class="special">}</span>
+ <span class="special">...</span>
+</pre>
+<p>The variant expression code is used as a human readable description of the variant (see <code class="computeroutput">CONTRACT_ASSERT_LOOP_VARIANT_MSG()</code>).</p>
+<p><span class="bold"><strong>Parameters:</strong></span> </p>
+<div class="informaltable"><table class="table">
+<colgroup>
+<col>
+<col>
+</colgroup>
+<tbody><tr>
+<td><span class="bold"><strong><code class="computeroutput">integer_expression</code></strong></span></td>
+<td>The integer expression which is evaluated at each loop iteration and asserted to be positive and decreasing from one iteration to the next one. </td>
+</tr></tbody>
+</table></div>
+<p>
+</p>
+<p><span class="bold"><strong>Returns:</strong></span> This macro expands to code that will automatically invoke <code class="computeroutput">contract::block_invariant_failed()</code> if the specified variant is not positive or it does not decrease.</p>
+<p><span class="bold"><strong>See:</strong></span> <code class="computeroutput">CONTRACT_INIT_LOOP_VARIANT</code>, <code class="computeroutput">CONTRACT_ASSERT_LOOP_VARIANT_MSG()</code> </p>
+</div>
+</div>
+<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
+<td align="left"></td>
+<td align="right"><div class="copyright-footer">Copyright &#169; 2009, 2010 Lorenzo Caminiti<p>
+ Distributed under the Contract++ Software License, Version 1.0 (see accompanying
+ file LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="CONTRACT_ASSERT_BLOCK_INVARIANT_MSG.html"><img src="images/prev.png" alt="Prev"></a><a accesskey="u" href="reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.block_hpp"><img src="images/up.png" alt="Up"></a><a accesskey="h" href="index.html"><img src="images/home.png" alt="Home"></a><a accesskey="n" href="CONTRACT_ASSERT_LOOP_VARIANT_MSG.html"><img src="images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>

Added: sandbox/contract/libs/contract/doc/html/CONTRACT_ASSERT_LOOP_VARIANT_MSG.html
==============================================================================
--- (empty file)
+++ sandbox/contract/libs/contract/doc/html/CONTRACT_ASSERT_LOOP_VARIANT_MSG.html 2011-06-28 20:54:41 EDT (Tue, 28 Jun 2011)
@@ -0,0 +1,68 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
+<title>Macro CONTRACT_ASSERT_LOOP_VARIANT_MSG</title>
+<link rel="stylesheet" href="doc/html/boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
+<link rel="home" href="index.html" title="Contract++ 0.3.490">
+<link rel="up" href="reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.block_hpp" title="Header &lt;E:/sandbox/contractpp/trunk/doc/qbk/src/contract/block.hpp&gt;">
+<link rel="prev" href="CONTRACT_ASSERT_LOOP_VARIANT.html" title="Macro CONTRACT_ASSERT_LOOP_VARIANT">
+<link rel="next" href="CONTRACT_INIT_LOOP_VARIANT.html" title="Macro CONTRACT_INIT_LOOP_VARIANT">
+</head>
+<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
+<table cellpadding="2" width="100%"><tr><td valign="top"></td></tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="CONTRACT_ASSERT_LOOP_VARIANT.html"><img src="images/prev.png" alt="Prev"></a><a accesskey="u" href="reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.block_hpp"><img src="images/up.png" alt="Up"></a><a accesskey="h" href="index.html"><img src="images/home.png" alt="Home"></a><a accesskey="n" href="CONTRACT_INIT_LOOP_VARIANT.html"><img src="images/next.png" alt="Next"></a>
+</div>
+<div class="refentry">
+<a name="CONTRACT_ASSERT_LOOP_VARIANT_MSG"></a><div class="titlepage"></div>
+<div class="refnamediv">
+<h2><span class="refentrytitle">Macro CONTRACT_ASSERT_LOOP_VARIANT_MSG</span></h2>
+<p>CONTRACT_ASSERT_LOOP_VARIANT_MSG</p>
+</div>
+<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
+<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="comment">// In header: &lt;<a class="link" href="reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.block_hpp" title="Header &lt;E:/sandbox/contractpp/trunk/doc/qbk/src/contract/block.hpp&gt;">E:/sandbox/contractpp/trunk/doc/qbk/src/contract/block.hpp</a>&gt;
+
+</span>CONTRACT_ASSERT_LOOP_VARIANT_MSG(integer_expression, string_description)</pre></div>
+<div class="refsect1">
+<a name="id964013"></a><h2>Description</h2>
+<p>Macro used to assert loop variant specifying also a human readable description.</p>
+<p>See <code class="computeroutput">CONTRACT_ASSERT_LOOP_VARIANT()</code> explanations and examples.</p>
+<p><span class="bold"><strong>Parameters:</strong></span> </p>
+<div class="informaltable"><table class="table">
+<colgroup>
+<col>
+<col>
+</colgroup>
+<tbody>
+<tr>
+<td><span class="bold"><strong><code class="computeroutput">integer_expression</code></strong></span></td>
+<td>The integer expression which is evaluated at each loop iteration and asserted to be positive and decreasing from one iteration to the next one. </td>
+</tr>
+<tr>
+<td><span class="bold"><strong><code class="computeroutput">string_description</code></strong></span></td>
+<td>A human readable description of the loop variant expression (used for error reporting). </td>
+</tr>
+</tbody>
+</table></div>
+<p>
+</p>
+<p><span class="bold"><strong>Returns:</strong></span> This macro expands to code that will automatically invoke <code class="computeroutput">contract::block_invariant_failed()</code> if the specified variant is not positive or it does not decrease.</p>
+<p><span class="bold"><strong>See:</strong></span> <code class="computeroutput">CONTRACT_INIT_LOOP_VARIANT()</code>, <code class="computeroutput">CONTRACT_ASSERT_LOOP_VARIANT()</code> </p>
+</div>
+</div>
+<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
+<td align="left"></td>
+<td align="right"><div class="copyright-footer">Copyright &#169; 2009, 2010 Lorenzo Caminiti<p>
+ Distributed under the Contract++ Software License, Version 1.0 (see accompanying
+ file LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="CONTRACT_ASSERT_LOOP_VARIANT.html"><img src="images/prev.png" alt="Prev"></a><a accesskey="u" href="reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.block_hpp"><img src="images/up.png" alt="Up"></a><a accesskey="h" href="index.html"><img src="images/home.png" alt="Home"></a><a accesskey="n" href="CONTRACT_INIT_LOOP_VARIANT.html"><img src="images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>

Added: sandbox/contract/libs/contract/doc/html/CONTRACT_ASSERT_MSG.html
==============================================================================
--- (empty file)
+++ sandbox/contract/libs/contract/doc/html/CONTRACT_ASSERT_MSG.html 2011-06-28 20:54:41 EDT (Tue, 28 Jun 2011)
@@ -0,0 +1,74 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
+<title>Macro CONTRACT_ASSERT_MSG</title>
+<link rel="stylesheet" href="doc/html/boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
+<link rel="home" href="index.html" title="Contract++ 0.3.490">
+<link rel="up" href="reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.assert_hpp" title="Header &lt;E:/sandbox/contractpp/trunk/doc/qbk/src/contract/assert.hpp&gt;">
+<link rel="prev" href="CONTRACT_ASSERT.html" title="Macro CONTRACT_ASSERT">
+<link rel="next" href="contract/loop_variant_type.html" title="Type definition loop_variant_type">
+</head>
+<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
+<table cellpadding="2" width="100%"><tr><td valign="top"></td></tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="CONTRACT_ASSERT.html"><img src="images/prev.png" alt="Prev"></a><a accesskey="u" href="reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.assert_hpp"><img src="images/up.png" alt="Up"></a><a accesskey="h" href="index.html"><img src="images/home.png" alt="Home"></a><a accesskey="n" href="contract/loop_variant_type.html"><img src="images/next.png" alt="Next"></a>
+</div>
+<div class="refentry">
+<a name="CONTRACT_ASSERT_MSG"></a><div class="titlepage"></div>
+<div class="refnamediv">
+<h2><span class="refentrytitle">Macro CONTRACT_ASSERT_MSG</span></h2>
+<p>CONTRACT_ASSERT_MSG</p>
+</div>
+<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
+<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="comment">// In header: &lt;<a class="link" href="reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.assert_hpp" title="Header &lt;E:/sandbox/contractpp/trunk/doc/qbk/src/contract/assert.hpp&gt;">E:/sandbox/contractpp/trunk/doc/qbk/src/contract/assert.hpp</a>&gt;
+
+</span>CONTRACT_ASSERT_MSG(boolean_condition, string_description)</pre></div>
+<div class="refsect1">
+<a name="id961844"></a><h2>Description</h2>
+<p>Macro used to assert contract conditions for class invariants, preconditions, and postconditions specifying also a human readable message.</p>
+<p>When possible, it is recommended to use this macro instead of throwing <code class="computeroutput"><a class="link" href="contract/failure.html" title="Class failure">contract::failure</a></code> directly. For example (see the Tutorial section for more information): </p>
+<pre class="programlisting"> <span class="identifier">CONTRACT_ASSERT_MSG</span><span class="special">(</span> <span class="keyword">true</span><span class="special">,</span> <span class="string">"always true"</span> <span class="special">)</span><span class="special">;</span>
+</pre>
+<p><span class="bold"><strong>Parameters:</strong></span> </p>
+<div class="informaltable"><table class="table">
+<colgroup>
+<col>
+<col>
+</colgroup>
+<tbody>
+<tr>
+<td><span class="bold"><strong><code class="computeroutput">boolean_condition</code></strong></span></td>
+<td>The boolean contract condition being asserted. </td>
+</tr>
+<tr>
+<td><span class="bold"><strong><code class="computeroutput">string_description</code></strong></span></td>
+<td>A string providing a human readable description of the condition being (used for error reporting). </td>
+</tr>
+</tbody>
+</table></div>
+<p>
+</p>
+<p><span class="bold"><strong>Returns:</strong></span> This macro expands to code equivalent to the following (see the Without the Macros section): </p>
+<pre class="programlisting"> <span class="keyword">if</span> <span class="special">(</span><span class="special">!</span><span class="special">(</span><span class="identifier">boolean_condition</span><span class="special">)</span><span class="special">)</span>
+ <span class="keyword">throw</span> <a class="link" href="contract/failure.html" title="Class failure">contract::failure</a><span class="special">(</span><span class="identifier">__FILE__</span><span class="special">,</span> <span class="identifier">__LINE__</span><span class="special">,</span> <span class="identifier">string_description</span><span class="special">)</span><span class="special">;</span>
+</pre>
+<p> Note how <code class="computeroutput">__FILE__</code> and <code class="computeroutput">__LINE__</code> are automatically used by the macro to improve error reporting.</p>
+<p><span class="bold"><strong>See:</strong></span> <code class="computeroutput">CONTRACT_ASSERT()</code>, <code class="computeroutput"><a class="link" href="contract/failure.html" title="Class failure">contract::failure</a></code> </p>
+</div>
+</div>
+<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
+<td align="left"></td>
+<td align="right"><div class="copyright-footer">Copyright &#169; 2009, 2010 Lorenzo Caminiti<p>
+ Distributed under the Contract++ Software License, Version 1.0 (see accompanying
+ file LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="CONTRACT_ASSERT.html"><img src="images/prev.png" alt="Prev"></a><a accesskey="u" href="reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.assert_hpp"><img src="images/up.png" alt="Up"></a><a accesskey="h" href="index.html"><img src="images/home.png" alt="Home"></a><a accesskey="n" href="contract/loop_variant_type.html"><img src="images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>

Added: sandbox/contract/libs/contract/doc/html/CONTRACT_BODY.html
==============================================================================
--- (empty file)
+++ sandbox/contract/libs/contract/doc/html/CONTRACT_BODY.html 2011-06-28 20:54:41 EDT (Tue, 28 Jun 2011)
@@ -0,0 +1,81 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
+<title>Macro CONTRACT_BODY</title>
+<link rel="stylesheet" href="doc/html/boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
+<link rel="home" href="index.html" title="Contract++ 0.3.490">
+<link rel="up" href="reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.body_hpp" title="Header &lt;E:/sandbox/contractpp/trunk/doc/qbk/src/contract/body.hpp&gt;">
+<link rel="prev" href="CONTRACT_DESTRUCTOR_BODY.html" title="Macro CONTRACT_DESTRUCTOR_BODY">
+<link rel="next" href="CONTRACT_CONFIG_MAX_FUNCTION_ARITY.html" title="Macro CONTRACT_CONFIG_MAX_FUNCTION_ARITY">
+</head>
+<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
+<table cellpadding="2" width="100%"><tr><td valign="top"></td></tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="CONTRACT_DESTRUCTOR_BODY.html"><img src="images/prev.png" alt="Prev"></a><a accesskey="u" href="reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.body_hpp"><img src="images/up.png" alt="Up"></a><a accesskey="h" href="index.html"><img src="images/home.png" alt="Home"></a><a accesskey="n" href="CONTRACT_CONFIG_MAX_FUNCTION_ARITY.html"><img src="images/next.png" alt="Next"></a>
+</div>
+<div class="refentry">
+<a name="CONTRACT_BODY"></a><div class="titlepage"></div>
+<div class="refnamediv">
+<h2><span class="refentrytitle">Macro CONTRACT_BODY</span></h2>
+<p>CONTRACT_BODY</p>
+</div>
+<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
+<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="comment">// In header: &lt;<a class="link" href="reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.body_hpp" title="Header &lt;E:/sandbox/contractpp/trunk/doc/qbk/src/contract/body.hpp&gt;">E:/sandbox/contractpp/trunk/doc/qbk/src/contract/body.hpp</a>&gt;
+
+</span>CONTRACT_BODY(function_name)</pre></div>
+<div class="refsect1">
+<a name="id965808"></a><h2>Description</h2>
+<p>Macro used to name the function body when separating the function definition from its declaration.</p>
+<p>This macro is used when the function is defined separately from its declaration (for example in a separate ".cpp" file) to name the body function: </p>
+<pre class="programlisting"> <span class="special">...</span> <span class="comment">// Function return type, class-type:: prefix, etc.</span>
+ <span class="identifier">CONTRACT_BODY</span><span class="special">(</span><span class="identifier">function_name</span><span class="special">)</span>
+ <span class="special">(</span><span class="special">...</span><span class="special">)</span> <span class="special">{</span> <span class="comment">// Function arguments.</span>
+ <span class="special">...</span> <span class="comment">// Function implementation.</span>
+ <span class="special">}</span>
+</pre>
+<p><span class="bold"><strong>Parameters:</strong></span> </p>
+<div class="informaltable"><table class="table">
+<colgroup>
+<col>
+<col>
+</colgroup>
+<tbody><tr>
+<td><span class="bold"><strong><code class="computeroutput">function_name</code></strong></span></td>
+<td>The name of the function. For operators the name must be <code class="computeroutput">operator(</code><span class="emphasis"><em>symbol, word</em></span><code class="computeroutput">)</code> where <span class="emphasis"><em>word</em></span> must contain no special operator symbol and it must match what specified in the contract declaration (see the Tutorial section). </td>
+</tr></tbody>
+</table></div>
+<p>
+</p>
+<p><span class="bold"><strong>Returns:</strong></span> This macro expands to code equivalent to the following: </p>
+<pre class="programlisting"> <span class="special">...</span> <span class="comment">// Function return type, class-type:: prefix, etc.</span>
+ <span class="preprocessor">#if</span> <span class="identifier">defined</span> <span class="identifier">CONTRACT_CHECK_CLASS_INVARIANT</span> <span class="special">||</span> \
+ <span class="identifier">defined</span> <span class="identifier">CONTRACT_CHECK_PRECONDITION</span> <span class="special">||</span> \
+ <span class="identifier">defined</span> <span class="identifier">CONTRACT_CHECK_POSTCONDITION</span>
+ <span class="identifier">contract_body_</span> <span class="special">##</span> <span class="identifier">function_name</span> <span class="special">##</span> <span class="identifier">_</span> <span class="comment">// Body function name.</span>
+ <span class="preprocessor">#else</span>
+ <span class="identifier">function_name</span> <span class="comment">// Function name (contracts off).</span>
+ <span class="preprocessor">#endif</span>
+ <span class="special">(</span><span class="special">...</span><span class="special">)</span> <span class="special">{</span> <span class="comment">// Function arguments.</span>
+ <span class="special">...</span> <span class="comment">// Function implementation.</span>
+ <span class="special">}</span>
+</pre>
+<p> (The preprocessor operator <code class="computeroutput">##</code> concatenates the specified tokens.)</p>
+<p><span class="bold"><strong>See:</strong></span> Tutorial section, <code class="computeroutput">CONTRACT_FUNCTION()</code> </p>
+</div>
+</div>
+<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
+<td align="left"></td>
+<td align="right"><div class="copyright-footer">Copyright &#169; 2009, 2010 Lorenzo Caminiti<p>
+ Distributed under the Contract++ Software License, Version 1.0 (see accompanying
+ file LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="CONTRACT_DESTRUCTOR_BODY.html"><img src="images/prev.png" alt="Prev"></a><a accesskey="u" href="reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.body_hpp"><img src="images/up.png" alt="Up"></a><a accesskey="h" href="index.html"><img src="images/home.png" alt="Home"></a><a accesskey="n" href="CONTRACT_CONFIG_MAX_FUNCTION_ARITY.html"><img src="images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>

Added: sandbox/contract/libs/contract/doc/html/CONTRACT_CHECK_BLOCK_INVARIANT.html
==============================================================================
--- (empty file)
+++ sandbox/contract/libs/contract/doc/html/CONTRACT_CHECK_BLOCK_INVARIANT.html 2011-06-28 20:54:41 EDT (Tue, 28 Jun 2011)
@@ -0,0 +1,48 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
+<title>Macro CONTRACT_CHECK_BLOCK_INVARIANT</title>
+<link rel="stylesheet" href="doc/html/boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
+<link rel="home" href="index.html" title="Contract++ 0.3.490">
+<link rel="up" href="reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract_hpp" title="Header &lt;E:/sandbox/contractpp/trunk/doc/qbk/src/contract.hpp&gt;">
+<link rel="prev" href="contract/constructor.html" title="Class template constructor">
+<link rel="next" href="CONTRACT_CHECK_CLASS_INVARIANT.html" title="Macro CONTRACT_CHECK_CLASS_INVARIANT">
+</head>
+<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
+<table cellpadding="2" width="100%"><tr><td valign="top"></td></tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="contract/constructor.html"><img src="images/prev.png" alt="Prev"></a><a accesskey="u" href="reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract_hpp"><img src="images/up.png" alt="Up"></a><a accesskey="h" href="index.html"><img src="images/home.png" alt="Home"></a><a accesskey="n" href="CONTRACT_CHECK_CLASS_INVARIANT.html"><img src="images/next.png" alt="Next"></a>
+</div>
+<div class="refentry">
+<a name="CONTRACT_CHECK_BLOCK_INVARIANT"></a><div class="titlepage"></div>
+<div class="refnamediv">
+<h2><span class="refentrytitle">Macro CONTRACT_CHECK_BLOCK_INVARIANT</span></h2>
+<p>CONTRACT_CHECK_BLOCK_INVARIANT</p>
+</div>
+<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
+<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="comment">// In header: &lt;<a class="link" href="reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract_hpp" title="Header &lt;E:/sandbox/contractpp/trunk/doc/qbk/src/contract.hpp&gt;">E:/sandbox/contractpp/trunk/doc/qbk/src/contract.hpp</a>&gt;
+
+</span>CONTRACT_CHECK_BLOCK_INVARIANT</pre></div>
+<div class="refsect1">
+<a name="id968308"></a><h2>Description</h2>
+<p>Block invariants (and therefore also loop variants) are compiled and checked at run-time <span class="bold"><strong>only</strong></span> when this macro is #defined (#undefined by default).</p>
+<p>When this macro is #undefined, block invariants (and loop variants) are not compiled in the object code and no block invariant (and loop variants) contract overhead is added.</p>
+<p><span class="bold"><strong>See:</strong></span> Getting Started section for more information. </p>
+</div>
+</div>
+<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
+<td align="left"></td>
+<td align="right"><div class="copyright-footer">Copyright &#169; 2009, 2010 Lorenzo Caminiti<p>
+ Distributed under the Contract++ Software License, Version 1.0 (see accompanying
+ file LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="contract/constructor.html"><img src="images/prev.png" alt="Prev"></a><a accesskey="u" href="reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract_hpp"><img src="images/up.png" alt="Up"></a><a accesskey="h" href="index.html"><img src="images/home.png" alt="Home"></a><a accesskey="n" href="CONTRACT_CHECK_CLASS_INVARIANT.html"><img src="images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>

Added: sandbox/contract/libs/contract/doc/html/CONTRACT_CHECK_CLASS_INVARIANT.html
==============================================================================
--- (empty file)
+++ sandbox/contract/libs/contract/doc/html/CONTRACT_CHECK_CLASS_INVARIANT.html 2011-06-28 20:54:41 EDT (Tue, 28 Jun 2011)
@@ -0,0 +1,48 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
+<title>Macro CONTRACT_CHECK_CLASS_INVARIANT</title>
+<link rel="stylesheet" href="doc/html/boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
+<link rel="home" href="index.html" title="Contract++ 0.3.490">
+<link rel="up" href="reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract_hpp" title="Header &lt;E:/sandbox/contractpp/trunk/doc/qbk/src/contract.hpp&gt;">
+<link rel="prev" href="CONTRACT_CHECK_BLOCK_INVARIANT.html" title="Macro CONTRACT_CHECK_BLOCK_INVARIANT">
+<link rel="next" href="CONTRACT_CHECK_PRECONDITION.html" title="Macro CONTRACT_CHECK_PRECONDITION">
+</head>
+<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
+<table cellpadding="2" width="100%"><tr><td valign="top"></td></tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="CONTRACT_CHECK_BLOCK_INVARIANT.html"><img src="images/prev.png" alt="Prev"></a><a accesskey="u" href="reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract_hpp"><img src="images/up.png" alt="Up"></a><a accesskey="h" href="index.html"><img src="images/home.png" alt="Home"></a><a accesskey="n" href="CONTRACT_CHECK_PRECONDITION.html"><img src="images/next.png" alt="Next"></a>
+</div>
+<div class="refentry">
+<a name="CONTRACT_CHECK_CLASS_INVARIANT"></a><div class="titlepage"></div>
+<div class="refnamediv">
+<h2><span class="refentrytitle">Macro CONTRACT_CHECK_CLASS_INVARIANT</span></h2>
+<p>CONTRACT_CHECK_CLASS_INVARIANT</p>
+</div>
+<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
+<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="comment">// In header: &lt;<a class="link" href="reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract_hpp" title="Header &lt;E:/sandbox/contractpp/trunk/doc/qbk/src/contract.hpp&gt;">E:/sandbox/contractpp/trunk/doc/qbk/src/contract.hpp</a>&gt;
+
+</span>CONTRACT_CHECK_CLASS_INVARIANT</pre></div>
+<div class="refsect1">
+<a name="id968379"></a><h2>Description</h2>
+<p>Class invariants are compiled and checked at run-time <span class="bold"><strong>only</strong></span> when this macro is #defined (#undefined by default).</p>
+<p>When this macro is #undefined, class invariants are not compiled in the object code and no class invariant contract overhead is added.</p>
+<p><span class="bold"><strong>See:</strong></span> Getting Started section for more information. </p>
+</div>
+</div>
+<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
+<td align="left"></td>
+<td align="right"><div class="copyright-footer">Copyright &#169; 2009, 2010 Lorenzo Caminiti<p>
+ Distributed under the Contract++ Software License, Version 1.0 (see accompanying
+ file LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="CONTRACT_CHECK_BLOCK_INVARIANT.html"><img src="images/prev.png" alt="Prev"></a><a accesskey="u" href="reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract_hpp"><img src="images/up.png" alt="Up"></a><a accesskey="h" href="index.html"><img src="images/home.png" alt="Home"></a><a accesskey="n" href="CONTRACT_CHECK_PRECONDITION.html"><img src="images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>

Added: sandbox/contract/libs/contract/doc/html/CONTRACT_CHECK_POSTCONDITION.html
==============================================================================
--- (empty file)
+++ sandbox/contract/libs/contract/doc/html/CONTRACT_CHECK_POSTCONDITION.html 2011-06-28 20:54:41 EDT (Tue, 28 Jun 2011)
@@ -0,0 +1,48 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
+<title>Macro CONTRACT_CHECK_POSTCONDITION</title>
+<link rel="stylesheet" href="doc/html/boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
+<link rel="home" href="index.html" title="Contract++ 0.3.490">
+<link rel="up" href="reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract_hpp" title="Header &lt;E:/sandbox/contractpp/trunk/doc/qbk/src/contract.hpp&gt;">
+<link rel="prev" href="CONTRACT_CHECK_PRECONDITION.html" title="Macro CONTRACT_CHECK_PRECONDITION">
+<link rel="next" href="contract/destructor.html" title="Class template destructor">
+</head>
+<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
+<table cellpadding="2" width="100%"><tr><td valign="top"></td></tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="CONTRACT_CHECK_PRECONDITION.html"><img src="images/prev.png" alt="Prev"></a><a accesskey="u" href="reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract_hpp"><img src="images/up.png" alt="Up"></a><a accesskey="h" href="index.html"><img src="images/home.png" alt="Home"></a><a accesskey="n" href="contract/destructor.html"><img src="images/next.png" alt="Next"></a>
+</div>
+<div class="refentry">
+<a name="CONTRACT_CHECK_POSTCONDITION"></a><div class="titlepage"></div>
+<div class="refnamediv">
+<h2><span class="refentrytitle">Macro CONTRACT_CHECK_POSTCONDITION</span></h2>
+<p>CONTRACT_CHECK_POSTCONDITION</p>
+</div>
+<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
+<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="comment">// In header: &lt;<a class="link" href="reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract_hpp" title="Header &lt;E:/sandbox/contractpp/trunk/doc/qbk/src/contract.hpp&gt;">E:/sandbox/contractpp/trunk/doc/qbk/src/contract.hpp</a>&gt;
+
+</span>CONTRACT_CHECK_POSTCONDITION</pre></div>
+<div class="refsect1">
+<a name="id968518"></a><h2>Description</h2>
+<p>Postconditions are compiled and checked at run-time <span class="bold"><strong>only</strong></span> when this macro is #defined (#undefined by default).</p>
+<p>When this macro is #undefined, postconditions are not compiled in the object code and no postcondition contract overhead is added.</p>
+<p><span class="bold"><strong>See:</strong></span> Getting Started section for more information. </p>
+</div>
+</div>
+<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
+<td align="left"></td>
+<td align="right"><div class="copyright-footer">Copyright &#169; 2009, 2010 Lorenzo Caminiti<p>
+ Distributed under the Contract++ Software License, Version 1.0 (see accompanying
+ file LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="CONTRACT_CHECK_PRECONDITION.html"><img src="images/prev.png" alt="Prev"></a><a accesskey="u" href="reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract_hpp"><img src="images/up.png" alt="Up"></a><a accesskey="h" href="index.html"><img src="images/home.png" alt="Home"></a><a accesskey="n" href="contract/destructor.html"><img src="images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>

Added: sandbox/contract/libs/contract/doc/html/CONTRACT_CHECK_PRECONDITION.html
==============================================================================
--- (empty file)
+++ sandbox/contract/libs/contract/doc/html/CONTRACT_CHECK_PRECONDITION.html 2011-06-28 20:54:41 EDT (Tue, 28 Jun 2011)
@@ -0,0 +1,48 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
+<title>Macro CONTRACT_CHECK_PRECONDITION</title>
+<link rel="stylesheet" href="doc/html/boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
+<link rel="home" href="index.html" title="Contract++ 0.3.490">
+<link rel="up" href="reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract_hpp" title="Header &lt;E:/sandbox/contractpp/trunk/doc/qbk/src/contract.hpp&gt;">
+<link rel="prev" href="CONTRACT_CHECK_CLASS_INVARIANT.html" title="Macro CONTRACT_CHECK_CLASS_INVARIANT">
+<link rel="next" href="CONTRACT_CHECK_POSTCONDITION.html" title="Macro CONTRACT_CHECK_POSTCONDITION">
+</head>
+<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
+<table cellpadding="2" width="100%"><tr><td valign="top"></td></tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="CONTRACT_CHECK_CLASS_INVARIANT.html"><img src="images/prev.png" alt="Prev"></a><a accesskey="u" href="reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract_hpp"><img src="images/up.png" alt="Up"></a><a accesskey="h" href="index.html"><img src="images/home.png" alt="Home"></a><a accesskey="n" href="CONTRACT_CHECK_POSTCONDITION.html"><img src="images/next.png" alt="Next"></a>
+</div>
+<div class="refentry">
+<a name="CONTRACT_CHECK_PRECONDITION"></a><div class="titlepage"></div>
+<div class="refnamediv">
+<h2><span class="refentrytitle">Macro CONTRACT_CHECK_PRECONDITION</span></h2>
+<p>CONTRACT_CHECK_PRECONDITION</p>
+</div>
+<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
+<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="comment">// In header: &lt;<a class="link" href="reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract_hpp" title="Header &lt;E:/sandbox/contractpp/trunk/doc/qbk/src/contract.hpp&gt;">E:/sandbox/contractpp/trunk/doc/qbk/src/contract.hpp</a>&gt;
+
+</span>CONTRACT_CHECK_PRECONDITION</pre></div>
+<div class="refsect1">
+<a name="id968448"></a><h2>Description</h2>
+<p>Preconditions are compiled and checked at run-time <span class="bold"><strong>only</strong></span> when this macro is #defined (#undefined by default).</p>
+<p>When this macro is #undefined, preconditions are not compiled in the object code and no precondition contract overhead is added.</p>
+<p><span class="bold"><strong>See:</strong></span> Getting Started section for more information. </p>
+</div>
+</div>
+<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
+<td align="left"></td>
+<td align="right"><div class="copyright-footer">Copyright &#169; 2009, 2010 Lorenzo Caminiti<p>
+ Distributed under the Contract++ Software License, Version 1.0 (see accompanying
+ file LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="CONTRACT_CHECK_CLASS_INVARIANT.html"><img src="images/prev.png" alt="Prev"></a><a accesskey="u" href="reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract_hpp"><img src="images/up.png" alt="Up"></a><a accesskey="h" href="index.html"><img src="images/home.png" alt="Home"></a><a accesskey="n" href="CONTRACT_CHECK_POSTCONDITION.html"><img src="images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>

Added: sandbox/contract/libs/contract/doc/html/CONTRACT_CONFIG_MAX_FUNCTION_ARITY.html
==============================================================================
--- (empty file)
+++ sandbox/contract/libs/contract/doc/html/CONTRACT_CONFIG_MAX_FUNCTION_ARITY.html 2011-06-28 20:54:41 EDT (Tue, 28 Jun 2011)
@@ -0,0 +1,66 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
+<title>Macro CONTRACT_CONFIG_MAX_FUNCTION_ARITY</title>
+<link rel="stylesheet" href="doc/html/boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
+<link rel="home" href="index.html" title="Contract++ 0.3.490">
+<link rel="up" href="reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.config_hpp" title="Header &lt;E:/sandbox/contractpp/trunk/doc/qbk/src/contract/config.hpp&gt;">
+<link rel="prev" href="CONTRACT_BODY.html" title="Macro CONTRACT_BODY">
+<link rel="next" href="CONTRACT_CONFIG_MAX_MULTIPLE_INHERITANCE.html" title="Macro CONTRACT_CONFIG_MAX_MULTIPLE_INHERITANCE">
+</head>
+<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
+<table cellpadding="2" width="100%"><tr><td valign="top"></td></tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="CONTRACT_BODY.html"><img src="images/prev.png" alt="Prev"></a><a accesskey="u" href="reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.config_hpp"><img src="images/up.png" alt="Up"></a><a accesskey="h" href="index.html"><img src="images/home.png" alt="Home"></a><a accesskey="n" href="CONTRACT_CONFIG_MAX_MULTIPLE_INHERITANCE.html"><img src="images/next.png" alt="Next"></a>
+</div>
+<div class="refentry">
+<a name="CONTRACT_CONFIG_MAX_FUNCTION_ARITY"></a><div class="titlepage"></div>
+<div class="refnamediv">
+<h2><span class="refentrytitle">Macro CONTRACT_CONFIG_MAX_FUNCTION_ARITY</span></h2>
+<p>CONTRACT_CONFIG_MAX_FUNCTION_ARITY</p>
+</div>
+<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
+<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="comment">// In header: &lt;<a class="link" href="reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.config_hpp" title="Header &lt;E:/sandbox/contractpp/trunk/doc/qbk/src/contract/config.hpp&gt;">E:/sandbox/contractpp/trunk/doc/qbk/src/contract/config.hpp</a>&gt;
+
+</span>CONTRACT_CONFIG_MAX_FUNCTION_ARITY</pre></div>
+<div class="refsect1">
+<a name="id966353"></a><h2>Description</h2>
+<p>The maximum number of function arguments supported by this library.</p>
+<p><span class="bold"><strong>Warning:</strong></span> Increasing this number can <span class="bold"><strong>significantly</strong></span> increase compilation time. If possible, do not increase this number.</p>
+<p>If you need to write a contract for a function with a number of arguments larger than the one specified by this macro default value, consider alternatives like wrapping the arguments within a <code class="computeroutput">struct</code>. For example, consider the function: </p>
+<pre class="programlisting"> <span class="comment">// Many arguments thus need to increase configuration macro value.</span>
+ <span class="keyword">void</span> <span class="identifier">f</span><span class="special">(</span><span class="keyword">int</span> <span class="identifier">i1</span><span class="special">,</span> <span class="keyword">int</span> <span class="identifier">i2</span><span class="special">,</span> <span class="keyword">int</span> <span class="identifier">i3</span><span class="special">,</span> <span class="keyword">int</span> <span class="identifier">i4</span><span class="special">,</span> <span class="keyword">int</span> <span class="identifier">i5</span><span class="special">,</span> <span class="keyword">int</span> <span class="identifier">i6</span><span class="special">,</span> <span class="keyword">int</span> <span class="identifier">i7</span><span class="special">)</span><span class="special">;</span>
+</pre>
+<p> However, this function could be rewritten as a single argument function using a <code class="computeroutput">struct:</code> </p>
+<pre class="programlisting"> <span class="keyword">struct</span> <span class="identifier">ints</span> <span class="special">{</span>
+ <span class="keyword">int</span> <span class="identifier">i1</span><span class="special">;</span>
+ <span class="keyword">int</span> <span class="identifier">i2</span><span class="special">;</span>
+ <span class="keyword">int</span> <span class="identifier">i3</span><span class="special">;</span>
+ <span class="keyword">int</span> <span class="identifier">i4</span><span class="special">;</span>
+ <span class="keyword">int</span> <span class="identifier">i5</span><span class="special">;</span>
+ <span class="keyword">int</span> <span class="identifier">i6</span><span class="special">;</span>
+ <span class="keyword">int</span> <span class="identifier">i7</span><span class="special">;</span>
+ <span class="special">}</span><span class="special">;</span>
+
+ <span class="comment">// Just one argument and default macro value suffice. </span>
+ <span class="keyword">void</span> <span class="identifier">f</span><span class="special">(</span><span class="identifier">ints</span> <span class="identifier">i</span><span class="special">)</span><span class="special">;</span>
+</pre>
+<p> Now the contract for <code class="computeroutput">f</code> only requires one argument and this macro value does not need to be increased. </p>
+</div>
+</div>
+<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
+<td align="left"></td>
+<td align="right"><div class="copyright-footer">Copyright &#169; 2009, 2010 Lorenzo Caminiti<p>
+ Distributed under the Contract++ Software License, Version 1.0 (see accompanying
+ file LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="CONTRACT_BODY.html"><img src="images/prev.png" alt="Prev"></a><a accesskey="u" href="reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.config_hpp"><img src="images/up.png" alt="Up"></a><a accesskey="h" href="index.html"><img src="images/home.png" alt="Home"></a><a accesskey="n" href="CONTRACT_CONFIG_MAX_MULTIPLE_INHERITANCE.html"><img src="images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>

Added: sandbox/contract/libs/contract/doc/html/CONTRACT_CONFIG_MAX_MULTIPLE_INHERITANCE.html
==============================================================================
--- (empty file)
+++ sandbox/contract/libs/contract/doc/html/CONTRACT_CONFIG_MAX_MULTIPLE_INHERITANCE.html 2011-06-28 20:54:41 EDT (Tue, 28 Jun 2011)
@@ -0,0 +1,47 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
+<title>Macro CONTRACT_CONFIG_MAX_MULTIPLE_INHERITANCE</title>
+<link rel="stylesheet" href="doc/html/boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
+<link rel="home" href="index.html" title="Contract++ 0.3.490">
+<link rel="up" href="reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.config_hpp" title="Header &lt;E:/sandbox/contractpp/trunk/doc/qbk/src/contract/config.hpp&gt;">
+<link rel="prev" href="CONTRACT_CONFIG_MAX_FUNCTION_ARITY.html" title="Macro CONTRACT_CONFIG_MAX_FUNCTION_ARITY">
+<link rel="next" href="contract/constructor.html" title="Class template constructor">
+</head>
+<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
+<table cellpadding="2" width="100%"><tr><td valign="top"></td></tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="CONTRACT_CONFIG_MAX_FUNCTION_ARITY.html"><img src="images/prev.png" alt="Prev"></a><a accesskey="u" href="reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.config_hpp"><img src="images/up.png" alt="Up"></a><a accesskey="h" href="index.html"><img src="images/home.png" alt="Home"></a><a accesskey="n" href="contract/constructor.html"><img src="images/next.png" alt="Next"></a>
+</div>
+<div class="refentry">
+<a name="CONTRACT_CONFIG_MAX_MULTIPLE_INHERITANCE"></a><div class="titlepage"></div>
+<div class="refnamediv">
+<h2><span class="refentrytitle">Macro CONTRACT_CONFIG_MAX_MULTIPLE_INHERITANCE</span></h2>
+<p>CONTRACT_CONFIG_MAX_MULTIPLE_INHERITANCE</p>
+</div>
+<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
+<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="comment">// In header: &lt;<a class="link" href="reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.config_hpp" title="Header &lt;E:/sandbox/contractpp/trunk/doc/qbk/src/contract/config.hpp&gt;">E:/sandbox/contractpp/trunk/doc/qbk/src/contract/config.hpp</a>&gt;
+
+</span>CONTRACT_CONFIG_MAX_MULTIPLE_INHERITANCE</pre></div>
+<div class="refsect1">
+<a name="id966804"></a><h2>Description</h2>
+<p>The maximum number of base classes supported when subcontracting with multiple inheritance.</p>
+<p><span class="bold"><strong>Warning:</strong></span> Increasing this number can <span class="bold"><strong>significantly</strong></span> increase compilation time. If possible, do not increase this number. </p>
+</div>
+</div>
+<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
+<td align="left"></td>
+<td align="right"><div class="copyright-footer">Copyright &#169; 2009, 2010 Lorenzo Caminiti<p>
+ Distributed under the Contract++ Software License, Version 1.0 (see accompanying
+ file LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="CONTRACT_CONFIG_MAX_FUNCTION_ARITY.html"><img src="images/prev.png" alt="Prev"></a><a accesskey="u" href="reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.config_hpp"><img src="images/up.png" alt="Up"></a><a accesskey="h" href="index.html"><img src="images/home.png" alt="Home"></a><a accesskey="n" href="contract/constructor.html"><img src="images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>

Added: sandbox/contract/libs/contract/doc/html/CONTRACT_CONSTRUCTOR.html
==============================================================================
--- (empty file)
+++ sandbox/contract/libs/contract/doc/html/CONTRACT_CONSTRUCTOR.html 2011-06-28 20:54:41 EDT (Tue, 28 Jun 2011)
@@ -0,0 +1,101 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
+<title>Macro CONTRACT_CONSTRUCTOR</title>
+<link rel="stylesheet" href="doc/html/boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
+<link rel="home" href="index.html" title="Contract++ 0.3.490">
+<link rel="up" href="reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.macros_hpp" title="Header &lt;E:/sandbox/contractpp/trunk/doc/qbk/src/contract/macros.hpp&gt;">
+<link rel="prev" href="CONTRACT_INVARIANT.html" title="Macro CONTRACT_INVARIANT">
+<link rel="next" href="CONTRACT_DESTRUCTOR.html" title="Macro CONTRACT_DESTRUCTOR">
+</head>
+<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
+<table cellpadding="2" width="100%"><tr><td valign="top"></td></tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="CONTRACT_INVARIANT.html"><img src="images/prev.png" alt="Prev"></a><a accesskey="u" href="reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.macros_hpp"><img src="images/up.png" alt="Up"></a><a accesskey="h" href="index.html"><img src="images/home.png" alt="Home"></a><a accesskey="n" href="CONTRACT_DESTRUCTOR.html"><img src="images/next.png" alt="Next"></a>
+</div>
+<div class="refentry">
+<a name="CONTRACT_CONSTRUCTOR"></a><div class="titlepage"></div>
+<div class="refnamediv">
+<h2><span class="refentrytitle">Macro CONTRACT_CONSTRUCTOR</span></h2>
+<p>CONTRACT_CONSTRUCTOR</p>
+</div>
+<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
+<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="comment">// In header: &lt;<a class="link" href="reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.macros_hpp" title="Header &lt;E:/sandbox/contractpp/trunk/doc/qbk/src/contract/macros.hpp&gt;">E:/sandbox/contractpp/trunk/doc/qbk/src/contract/macros.hpp</a>&gt;
+
+</span>CONTRACT_CONSTRUCTOR(sequence)</pre></div>
+<div class="refsect1">
+<a name="id970515"></a><h2>Description</h2>
+<p>Macro used to write contracts for constructors.</p>
+<p>This macro must be used right after the constructor declaration -- and after the member initialization list if such a list is specified. There is no need for a trailing <code class="computeroutput">";"</code> after the macro closing parenthesis <code class="computeroutput">")"</code>.</p>
+<p>For example (see the Tutorial section for more information): </p>
+<pre class="programlisting"> <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> <span class="identifier">T</span><span class="special">&gt;</span>
+ <span class="keyword">class</span> <span class="identifier">myvector</span> <span class="special">{</span>
+ <span class="special">...</span> <span class="comment">// Invariants.</span>
+
+ <span class="keyword">public</span><span class="special">:</span>
+ <span class="keyword">explicit</span> <span class="identifier">myvector</span><span class="special">(</span><span class="identifier">size_type</span> <span class="identifier">count</span><span class="special">)</span> <span class="comment">// Constructor declaration.</span>
+ <span class="special">:</span> <span class="identifier">vector_</span><span class="special">(</span><span class="identifier">count</span><span class="special">)</span> <span class="comment">// Member initialization list.</span>
+ <span class="identifier">CONTRACT_COSTRUCTOR</span><span class="special">(</span> <span class="special">(</span><span class="keyword">class</span><span class="special">)</span> <span class="special">(</span><span class="identifier">myvector</span><span class="special">)</span>
+ <span class="special">(</span><span class="keyword">public</span><span class="special">)</span> <span class="special">(</span><span class="identifier">myvector</span><span class="special">)</span><span class="special">(</span> <span class="special">(</span><span class="identifier">size_type</span><span class="special">)</span><span class="special">(</span><span class="identifier">count</span><span class="special">)</span> <span class="special">)</span>
+ <span class="special">(</span><span class="identifier">precondition</span><span class="special">)</span> <span class="special">(</span><span class="special">{</span>
+ <span class="special">...</span> <span class="comment">// Assert constructor preconditions.</span>
+ <span class="special">}</span><span class="special">)</span>
+ <span class="special">(</span><span class="identifier">postcondition</span><span class="special">)</span> <span class="special">(</span><span class="special">{</span>
+ <span class="special">...</span> <span class="comment">// Assert constructor postconditions.</span>
+ <span class="special">}</span><span class="special">)</span>
+ <span class="special">(</span><span class="identifier">body</span><span class="special">)</span> <span class="special">(</span><span class="special">{</span>
+ <span class="special">...</span> <span class="comment">// Actual constructor implementation.</span>
+ <span class="special">}</span><span class="special">)</span> <span class="special">)</span> <span class="comment">// No need for ";" after macro closing parenthesis ")".</span>
+
+ <span class="special">...</span> <span class="comment">// Rest of the class.</span>
+ <span class="special">}</span><span class="special">;</span>
+</pre>
+<p><span class="bold"><strong>Parameters:</strong></span> </p>
+<div class="informaltable"><table class="table">
+<colgroup>
+<col>
+<col>
+</colgroup>
+<tbody><tr>
+<td><span class="bold"><strong><code class="computeroutput">sequence</code></strong></span></td>
+<td>A Boost.Preprocessor sequence of tokens <code class="computeroutput">(<span class="emphasis"><em>1st-token</em></span>)(<span class="emphasis"><em>2nd-token</em></span>)<span class="emphasis"><em>...</em></span>(<span class="emphasis"><em>last-token</em></span>)</code> that repeats the constructor signature syntactic elements and specifies the contract.<div class="itemizedlist"><ul class="itemizedlist" type="disc">
+<li class="listitem"><p>The signature tokens are needed by the library to generate the contract code with the function name, the argument types and names, etc as discussed in the Without the Macros section (e.g., the argument names are needed to actually name the precondition and postcondition function arguments).</p></li>
+<li class="listitem"><p>The extra parenthesis <code class="computeroutput">()</code> around the tokens are mandatory (they are the ones making the preprocessor sequence).</p></li>
+<li class="listitem"><p>It is recommended to use <code class="computeroutput">CONTRACT_ASSERT()</code> to assert preconditions and postconditions within the relative code blocks.</p></li>
+<li class="listitem"><p>Within the postcondition code block, <code class="computeroutput">CONTRACT_OLDOF(</code><span class="emphasis"><em>argument-name</em></span><code class="computeroutput">)</code> is a constant reference to the related old argument value (as the value was before body execution) but only if the <span class="emphasis"><em>argument-type</em></span> was tagged <code class="computeroutput">(copyable)</code> in <code class="computeroutput">sequence</code>.</p></li>
+<li class="listitem"><p>For the body block, <code class="computeroutput">";"</code> can be used to separate the constructor definition from its declaration (see <code class="computeroutput">CONTRACT_CONSTRUCTOR_BODY()</code>).</p></li>
+<li class="listitem"><p>As explained in the Tutorial section, the tokens in <code class="computeroutput">sequence</code> appear in the exact same order as they appear in the constructor declaration followed by the optional preconditions, optional postconditions, and mandatory body.</p></li>
+<li class="listitem"><p>The constructor <code class="computeroutput">sequence</code> syntax is as follows (<span class="emphasis"><em>[]</em></span> for optional tokens, <span class="emphasis"><em>{}</em></span> tokens resulting from parenthesis contents evaluation, <span class="emphasis"><em>||</em></span> one token or the other, <span class="emphasis"><em>+</em></span> tokens repeated 1 or more times):</p></li>
+</ul></div>
+<code class="computeroutput"> <span class="emphasis"><em>[</em></span>(class)<span class="emphasis"><em>]</em></span> (<span class="emphasis"><em>class-type</em></span>) <span class="emphasis"><em>{</em></span>(public) <span class="emphasis"><em>||</em></span> (protected) <span class="emphasis"><em>||</em></span> (private)<span class="emphasis"><em>}</em></span> <span class="emphasis"><em>[</em></span>(template)( <span class="emphasis"><em>{</em></span>(<span class="emphasis"><em>function-template-parameter-type</em></span>)(<span class="emphasis"><em>function-template-parameter-name</em></span>)<span class="emphasis"><em>}+</em></span> )<span class="emphasis"><em>]</em></span> (<span class="emphasis"><em>class-name</em></span>)( <span class="emphasis"><em>{</em></span>(void) <span class="emphasis"><em>||</em></span> <span class="emphasis"><em>{[</em></span>(copyable)<span class="emphasis"><em>]</em></span>(<span class="emphasis"><em>argument-type</em></span>)(<span class="emphasis"><em>argument-name</em></
span>)<span class="emphasis"><em>}+}</em></span> ) <span class="emphasis"><em>[</em></span>(precondition) ({ ... })<span class="emphasis"><em>]</em></span> <span class="emphasis"><em>[</em></span>(postcondition) ({ ... })<span class="emphasis"><em>]</em></span> (body) ({ ... }) </code> </td>
+</tr></tbody>
+</table></div>
+<p>
+</p>
+<p><span class="bold"><strong>Returns:</strong></span> See the Without the Macro section for examples of the code generated by this macro expansion. </p>
+<div class="itemizedlist"><ul class="itemizedlist" type="disc">
+<li class="listitem"><p>If contract compilation is turned on, this macro expands to the constructor contract. </p></li>
+<li class="listitem"><p>Otherwise, if contract compilation is turned off, this macro expands to just the constructor function body using the given body code block (and no contract overhead is added).</p></li>
+</ul></div>
+<p>
+<span class="bold"><strong>Note:</strong></span> For functions with no argument <code class="computeroutput">(<span class="emphasis"><em>class-name</em></span>)( (void) )</code>, and not just <code class="computeroutput">(<span class="emphasis"><em>class-name</em></span>)( )</code>, must be used to specify the empty argument list within <code class="computeroutput">sequence</code>. This is because ISO standard C++ does not allow for empty macro parameters (this library also supports <code class="computeroutput">(<span class="emphasis"><em>class-name</em></span>)( )</code> but this will only compile on C99 so its use is not recommended -- see the Tutorial section for more information).</p>
+<p><span class="bold"><strong>Note:</strong></span> In comparing the <code class="computeroutput">sequence</code> syntax of constructors with the one of member functions from <code class="computeroutput">CONTRACT_FUNCTION()</code>, note the following differences (see also the Constructor Call Semantics in the Tutorial section): There is no <code class="computeroutput">(copyable)</code> before <span class="emphasis"><em>class-type</em></span> because there is no object before construction body execution; There is no <code class="computeroutput">(inherit)</code> because constructors cannot directly subcontract; There is no <code class="computeroutput">(static)</code> or <code class="computeroutput">(virtual)</code> because constructors cannot be static or virtual; There is no <code class="computeroutput">(<span class="emphasis"><em>result-type</em></span>)</code> because constructors have no return value; The <span class="emphasis"><em>function-name</em></span> must be the <span class="emphasis"><em>class-nam
e</em></span> as always for constructors; There is no trailing <code class="computeroutput">(const)</code> because constructor cannot be constant members.</p>
+<p><span class="bold"><strong>See:</strong></span> <code class="computeroutput">CONTRACT_ASSERT()</code>, <code class="computeroutput">CONTRACT_INVARIANT()</code>, <code class="computeroutput">CONTRACT_DESTRUCTOR()</code>, <code class="computeroutput">CONTRACT_FUNCTION()</code> </p>
+</div>
+</div>
+<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
+<td align="left"></td>
+<td align="right"><div class="copyright-footer">Copyright &#169; 2009, 2010 Lorenzo Caminiti<p>
+ Distributed under the Contract++ Software License, Version 1.0 (see accompanying
+ file LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="CONTRACT_INVARIANT.html"><img src="images/prev.png" alt="Prev"></a><a accesskey="u" href="reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.macros_hpp"><img src="images/up.png" alt="Up"></a><a accesskey="h" href="index.html"><img src="images/home.png" alt="Home"></a><a accesskey="n" href="CONTRACT_DESTRUCTOR.html"><img src="images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>

Added: sandbox/contract/libs/contract/doc/html/CONTRACT_CONSTRUCTOR_BODY.html
==============================================================================
--- (empty file)
+++ sandbox/contract/libs/contract/doc/html/CONTRACT_CONSTRUCTOR_BODY.html 2011-06-28 20:54:41 EDT (Tue, 28 Jun 2011)
@@ -0,0 +1,140 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
+<title>Macro CONTRACT_CONSTRUCTOR_BODY</title>
+<link rel="stylesheet" href="doc/html/boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
+<link rel="home" href="index.html" title="Contract++ 0.3.490">
+<link rel="up" href="reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.body_hpp" title="Header &lt;E:/sandbox/contractpp/trunk/doc/qbk/src/contract/body.hpp&gt;">
+<link rel="prev" href="CONTRACT_INIT_LOOP_VARIANT.html" title="Macro CONTRACT_INIT_LOOP_VARIANT">
+<link rel="next" href="CONTRACT_DESTRUCTOR_BODY.html" title="Macro CONTRACT_DESTRUCTOR_BODY">
+</head>
+<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
+<table cellpadding="2" width="100%"><tr><td valign="top"></td></tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="CONTRACT_INIT_LOOP_VARIANT.html"><img src="images/prev.png" alt="Prev"></a><a accesskey="u" href="reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.body_hpp"><img src="images/up.png" alt="Up"></a><a accesskey="h" href="index.html"><img src="images/home.png" alt="Home"></a><a accesskey="n" href="CONTRACT_DESTRUCTOR_BODY.html"><img src="images/next.png" alt="Next"></a>
+</div>
+<div class="refentry">
+<a name="CONTRACT_CONSTRUCTOR_BODY"></a><div class="titlepage"></div>
+<div class="refnamediv">
+<h2><span class="refentrytitle">Macro CONTRACT_CONSTRUCTOR_BODY</span></h2>
+<p>CONTRACT_CONSTRUCTOR_BODY</p>
+</div>
+<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
+<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="comment">// In header: &lt;<a class="link" href="reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.body_hpp" title="Header &lt;E:/sandbox/contractpp/trunk/doc/qbk/src/contract/body.hpp&gt;">E:/sandbox/contractpp/trunk/doc/qbk/src/contract/body.hpp</a>&gt;
+
+</span>CONTRACT_CONSTRUCTOR_BODY(class_type, class_name)</pre></div>
+<div class="refsect1">
+<a name="id964546"></a><h2>Description</h2>
+<p>Macro used to name the constructor body when separating constructor definition from its declaration.</p>
+<p>This macro is used when the constructor is defined outside the class declaration (for example in a separate ".cpp" file) to name the constructor body function: </p>
+<pre class="programlisting"> <span class="identifier">BOOST_CONTRACT_CONSTRUCTOR_BODY</span><span class="special">(</span><span class="identifier">class_type</span><span class="special">,</span> <span class="identifier">class_name</span><span class="special">)</span>
+ <span class="special">(</span><span class="special">...</span><span class="special">)</span> <span class="special">{</span> <span class="comment">// Constructor arguments.</span>
+ <span class="special">...</span> <span class="comment">// Constructor implementation.</span>
+ <span class="special">}</span>
+</pre>
+<p><span class="bold"><strong>Parameters:</strong></span> </p>
+<div class="informaltable"><table class="table">
+<colgroup>
+<col>
+<col>
+</colgroup>
+<tbody>
+<tr>
+<td><span class="bold"><strong><code class="computeroutput">class_type</code></strong></span></td>
+<td>The type of the class. For class templates this must also list the template parameters. </td>
+</tr>
+<tr>
+<td><span class="bold"><strong><code class="computeroutput">class_name</code></strong></span></td>
+<td>The constructor name which is the class type name. For class templates this shall not list the template parameters. </td>
+</tr>
+</tbody>
+</table></div>
+<p>
+</p>
+<p><span class="bold"><strong>Returns:</strong></span> This macro expands to code equivalent to the following: </p>
+<pre class="programlisting"> <span class="preprocessor">#if</span> <span class="identifier">defined</span> <span class="identifier">CONTRACT_CHECK_CLASS_INVARIANT</span> <span class="special">||</span> \
+ <span class="identifier">defined</span> <span class="identifier">CONTRACT_CHECK_PRECONDITION</span> <span class="special">||</span> \
+ <span class="identifier">defined</span> <span class="identifier">CONTRACT_CHECK_POSTCONDITION</span>
+ <span class="keyword">void</span> <span class="identifier">class_type</span><span class="special">::</span><span class="identifier">contract_body_constructor_</span> <span class="comment">// Constructor body function name.</span>
+ <span class="preprocessor">#else</span>
+ <span class="identifier">class_type</span><span class="special">::</span><span class="identifier">class_name</span> <span class="comment">// Constructor function (contracts off).</span>
+ <span class="preprocessor">#endif</span>
+ <span class="special">(</span><span class="special">...</span><span class="special">)</span> <span class="special">{</span> <span class="comment">// Constructor arguments.</span>
+ <span class="special">...</span> <span class="comment">// Constructor implementation.</span>
+ <span class="special">}</span>
+</pre>
+<p><span class="bold"><strong>Member Initialization List</strong></span></p>
+<p>A limitation of this mechanism is that it does not directly support constructor member initialization list. If a member initialization list is specified then the constructor definition must be provided together with its declaration (for example in the header file). (This library could overcome this limitation in the future if upcoming C++ standard revisions were to support delegating constructors.)</p>
+<p>If the constructor implementation must be separated from its declaration, a possible workaround is to:</p>
+<div class="orderedlist"><ol class="orderedlist" type="1">
+<li class="listitem"><p>Delegate the construction job to a special initialization function which must be named "constructor" (and it should be private to avoid other code from messing with the object construction).</p></li>
+<li class="listitem"><p>Program the real constructor to just invoke the initialization function.</p></li>
+<li class="listitem"><p>Write the contract for the initialization function instead that for the real constructor (but using CONTRACT_CONSTRUCTOR() instead of CONTRACT_FUNCTION()).</p></li>
+</ol></div>
+<p>
+</p>
+<p>If this is done then both the constructor and the initialization function body definitions can be separated from the contract declaration. For example: </p>
+<pre class="programlisting"> <span class="comment">// Declaration.</span>
+
+ <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> <span class="identifier">T</span><span class="special">&gt;</span>
+ <span class="keyword">class</span> <span class="identifier">myvector</span> <span class="special">{</span>
+ <span class="special">...</span> <span class="comment">// Invariants.</span>
+
+ <span class="keyword">public</span><span class="special">:</span>
+ <span class="keyword">typedef</span> <span class="keyword">typename</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">vector</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">&gt;</span><span class="special">::</span><span class="identifier">size_type</span> <span class="identifier">size_type</span><span class="special">;</span>
+ <span class="keyword">typedef</span> <span class="keyword">typename</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">vector</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">&gt;</span><span class="special">::</span><span class="identifier">const_reference</span> <span class="identifier">const_reference</span><span class="special">;</span>
+
+ <span class="keyword">explicit</span> <span class="identifier">myvector</span><span class="special">(</span><span class="identifier">size_type</span> <span class="identifier">count</span><span class="special">)</span><span class="special">;</span> <span class="comment">// Separated definition.</span>
+
+ <span class="special">...</span> <span class="comment">// Rest of the class.</span>
+
+ <span class="keyword">private</span><span class="special">:</span>
+ <span class="comment">// The initialization function is private and must be named "constructor</span>
+<span class="string">".
+ void constructor(size_type count)
+ // Specify the contract for the initialization function instead of the real constructor.
+ CONTRACT_CONSTRUCTOR( (class) (myvector)
+ (private) (myvector)( (size_type)(count) ), {
+ // Constructor preconditions (none in this case).
+ }, {
+ // Constructor postconditions.
+ CONTRACT_ASSERT(self.now.size() == count.now,
+ "</span><span class="identifier">size</span> <span class="identifier">set</span> <span class="identifier">to</span> <span class="identifier">count</span><span class="string">");
+ }, ;) // Now we can separate the body definition using "</span><span class="special">;</span><span class="string">".
+
+ std::vector&lt;T&gt; vector_;
+ };
+
+ // Separated definition (possibly in a different file).
+
+ template&lt;typename T&gt;
+ myvector&lt;T&gt;::myvector(size_type count):
+ vector_(count) { // Member initialization list.
+ constructor(count); // Just invoke the initialization function.
+ }
+
+ template&lt;typename T&gt;
+ void myvector&lt;T&gt;::CONTRACT_BODY(constructor)(size_type count) {
+ // Actual constructor implementation (do nothing in this case).
+ }
+</span></pre>
+<p>To allow for this workaround, the <code class="computeroutput">CONTRACT_CONSTRUCTOR()</code> macro can follow a member function but <span class="bold"><strong>only</strong></span> when the member function is named "constructor", it has a <code class="computeroutput">void</code> return type, and it is not <code class="computeroutput">const</code> (essentially, only when its signature matches the one of a constructor). Be aware that for this special "constructor" member function, class invariants will <span class="bold"><strong>not</strong></span> be checked before body execution (because the <code class="computeroutput">CONTRACT_CONSTRUCTOR()</code> macro implements the Constructor Call Semantics and not the Member Function Call Semantics as explained in the Tutorial section).</p>
+<p><span class="bold"><strong>See:</strong></span> Tutorial section, <code class="computeroutput">CONTRACT_CONSTRUCTOR()</code> </p>
+</div>
+</div>
+<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
+<td align="left"></td>
+<td align="right"><div class="copyright-footer">Copyright &#169; 2009, 2010 Lorenzo Caminiti<p>
+ Distributed under the Contract++ Software License, Version 1.0 (see accompanying
+ file LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="CONTRACT_INIT_LOOP_VARIANT.html"><img src="images/prev.png" alt="Prev"></a><a accesskey="u" href="reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.body_hpp"><img src="images/up.png" alt="Up"></a><a accesskey="h" href="index.html"><img src="images/home.png" alt="Home"></a><a accesskey="n" href="CONTRACT_DESTRUCTOR_BODY.html"><img src="images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>

Added: sandbox/contract/libs/contract/doc/html/CONTRACT_DESTRUCTOR.html
==============================================================================
--- (empty file)
+++ sandbox/contract/libs/contract/doc/html/CONTRACT_DESTRUCTOR.html 2011-06-28 20:54:41 EDT (Tue, 28 Jun 2011)
@@ -0,0 +1,93 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
+<title>Macro CONTRACT_DESTRUCTOR</title>
+<link rel="stylesheet" href="doc/html/boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
+<link rel="home" href="index.html" title="Contract++ 0.3.490">
+<link rel="up" href="reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.macros_hpp" title="Header &lt;E:/sandbox/contractpp/trunk/doc/qbk/src/contract/macros.hpp&gt;">
+<link rel="prev" href="CONTRACT_CONSTRUCTOR.html" title="Macro CONTRACT_CONSTRUCTOR">
+<link rel="next" href="CONTRACT_FUNCTION.html" title="Macro CONTRACT_FUNCTION">
+</head>
+<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
+<table cellpadding="2" width="100%"><tr><td valign="top"></td></tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="CONTRACT_CONSTRUCTOR.html"><img src="images/prev.png" alt="Prev"></a><a accesskey="u" href="reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.macros_hpp"><img src="images/up.png" alt="Up"></a><a accesskey="h" href="index.html"><img src="images/home.png" alt="Home"></a><a accesskey="n" href="CONTRACT_FUNCTION.html"><img src="images/next.png" alt="Next"></a>
+</div>
+<div class="refentry">
+<a name="CONTRACT_DESTRUCTOR"></a><div class="titlepage"></div>
+<div class="refnamediv">
+<h2><span class="refentrytitle">Macro CONTRACT_DESTRUCTOR</span></h2>
+<p>CONTRACT_DESTRUCTOR</p>
+</div>
+<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
+<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="comment">// In header: &lt;<a class="link" href="reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.macros_hpp" title="Header &lt;E:/sandbox/contractpp/trunk/doc/qbk/src/contract/macros.hpp&gt;">E:/sandbox/contractpp/trunk/doc/qbk/src/contract/macros.hpp</a>&gt;
+
+</span>CONTRACT_DESTRUCTOR(sequence)</pre></div>
+<div class="refsect1">
+<a name="id971532"></a><h2>Description</h2>
+<p>Macro used to write contracts for destructors.</p>
+<p>This macro must be used right after the destructor declaration. There is no need for a trailing <code class="computeroutput">";"</code> after the macro closing parenthesis <code class="computeroutput">")"</code>.</p>
+<p>For example (see the Tutorial section for more information): </p>
+<pre class="programlisting"> <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> <span class="identifier">T</span><span class="special">&gt;</span>
+ <span class="keyword">class</span> <span class="identifier">myvector</span> <span class="special">{</span>
+ <span class="special">...</span> <span class="comment">// Invariants.</span>
+
+ <span class="keyword">public</span><span class="special">:</span>
+ <span class="keyword">virtual</span> <span class="special">~</span><span class="identifier">myvector</span><span class="special">(</span><span class="keyword">void</span><span class="special">)</span> <span class="comment">// Destructor declaration.</span>
+ <span class="identifier">BOOST_CONTRACT_DESTRUCTOR</span><span class="special">(</span> <span class="special">(</span><span class="keyword">class</span><span class="special">)</span> <span class="special">(</span><span class="identifier">myvector</span><span class="special">)</span>
+ <span class="special">(</span><span class="keyword">public</span><span class="special">)</span> <span class="special">(</span><span class="keyword">virtual</span><span class="special">)</span> <span class="special">(</span><span class="identifier">myvector</span><span class="special">)</span><span class="special">(</span> <span class="special">(</span><span class="keyword">void</span><span class="special">)</span> <span class="special">)</span>
+ <span class="comment">// Never preconditions or postconditions for destructors.</span>
+ <span class="special">(</span><span class="identifier">body</span> <span class="special">(</span><span class="special">{</span>
+ <span class="special">...</span> <span class="comment">// Actual destructor implementation.</span>
+ <span class="special">}</span><span class="special">)</span> <span class="special">)</span> <span class="comment">// No need for ";" after macro closing parenthesis ")".</span>
+
+ <span class="special">...</span> <span class="comment">// Rest of the class.</span>
+ <span class="special">}</span><span class="special">;</span>
+</pre>
+<p><span class="bold"><strong>Parameters:</strong></span> </p>
+<div class="informaltable"><table class="table">
+<colgroup>
+<col>
+<col>
+</colgroup>
+<tbody><tr>
+<td><span class="bold"><strong><code class="computeroutput">signature_sequence</code></strong></span></td>
+<td>A Boost.Preprocessor sequence of tokens <code class="computeroutput">(<span class="emphasis"><em>1st-token</em></span>)(<span class="emphasis"><em>2nd-token</em></span>)<span class="emphasis"><em>...</em></span>(<span class="emphasis"><em>last-token</em></span>)</code> that repeats the destructor signature syntactic elements.<div class="itemizedlist"><ul class="itemizedlist" type="disc">
+<li class="listitem"><p>The signature tokens are needed by the library to generate the contract code with the function name, the argument types and names, etc as discussed in the Without the Macros section.</p></li>
+<li class="listitem"><p>The extra parenthesis <code class="computeroutput">()</code> around the tokens are mandatory (they are the ones making the preprocessor sequence).</p></li>
+<li class="listitem"><p>For the body code block, <code class="computeroutput">";"</code> can be specified to separate the destructor definition from its declaration (see <code class="computeroutput">CONTRACT_DESTRUCTOR_BODY()</code>).</p></li>
+<li class="listitem"><p>As explained in the Tutorial section, the tokens in <code class="computeroutput">sequence</code> appear in the exact same order as they appear in the destructor declaration followed by the mandatory body code block.</p></li>
+<li class="listitem"><p>The destructor <code class="computeroutput">sequence</code> syntax is as follows (<span class="emphasis"><em>[]</em></span> for optional tokens, <span class="emphasis"><em>{}</em></span> tokens resulting from parenthesis contents evaluation, <span class="emphasis"><em>||</em></span> one token or the other):</p></li>
+</ul></div>
+<code class="computeroutput"> <span class="emphasis"><em>[</em></span>(template)<span class="emphasis"><em>]</em></span> (<span class="emphasis"><em>class-type</em></span>) <span class="emphasis"><em>{</em></span>(public) <span class="emphasis"><em>||</em></span> (protected) <span class="emphasis"><em>||</em></span> (private)<span class="emphasis"><em>}</em></span> [(virtual)] (<span class="emphasis"><em>class-name</em></span>)( (void) ) (body) ({ ... }) </code> </td>
+</tr></tbody>
+</table></div>
+<p>
+</p>
+<p><span class="bold"><strong>Returns:</strong></span> See the Without the Macro section for examples of the code generated by this macro expansion. </p>
+<div class="itemizedlist"><ul class="itemizedlist" type="disc">
+<li class="listitem"><p>If contract compilation is turned on, this macro expands to the destructor contract. </p></li>
+<li class="listitem"><p>Otherwise, if contract compilation is turned off, this macro expands to just the destructor function body using body code block (and no contract overhead is added).</p></li>
+</ul></div>
+<p>
+<span class="bold"><strong>Note:</strong></span> Destructor have no argument so <code class="computeroutput">(void)</code> must always be used in <code class="computeroutput">(<span class="emphasis"><em>class-name</em></span>)( (void) )</code> to specify the empty argument list within <code class="computeroutput">sequence</code>. This is because ISO standard C++ does not allow for empty macro parameters (this library also supports <code class="computeroutput">(<span class="emphasis"><em>class-name</em></span>)( )</code> but this will only compile on C99 so its use is not recommended -- see the Tutorial section for more information).</p>
+<p><span class="bold"><strong>Note:</strong></span> In comparing the <code class="computeroutput">sequence</code> syntax of destructors with the one of member functions from <code class="computeroutput">CONTRACT_FUNCTION()</code>, note the following differences (see also the Destructor Call Semantics in the Tutorial section): There is no <code class="computeroutput">(copyable)</code> before <span class="emphasis"><em>class-type</em></span> because there are no postconditions; There is no <code class="computeroutput">(inherit)</code> because destructors cannot directly subcontract; There is no function template keyword and arguments because destructors cannot be template functions; There is no <code class="computeroutput">(static)</code> because destructors cannot be static; There is no <code class="computeroutput">(<span class="emphasis"><em>result-type</em></span>)</code> because destructors have no return value; The <span class="emphasis"><em>function-name</em></span> must be the <span class="emphasis"><e
m>class-name</em></span> as always for destructors; The function argument list must be <code class="computeroutput">(void)</code> because destructors take no argument; There is no trailing <code class="computeroutput">(const)</code> because constructor cannot be constant members.</p>
+<p><span class="bold"><strong>See:</strong></span> <code class="computeroutput">CONTRACT_ASSERT()</code>, <code class="computeroutput">CONTRACT_INVARIANT()</code>, <code class="computeroutput">CONTRACT_CONSTRUCTOR()</code>, <code class="computeroutput">CONTRACT_FUNCTION()</code> </p>
+</div>
+</div>
+<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
+<td align="left"></td>
+<td align="right"><div class="copyright-footer">Copyright &#169; 2009, 2010 Lorenzo Caminiti<p>
+ Distributed under the Contract++ Software License, Version 1.0 (see accompanying
+ file LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="CONTRACT_CONSTRUCTOR.html"><img src="images/prev.png" alt="Prev"></a><a accesskey="u" href="reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.macros_hpp"><img src="images/up.png" alt="Up"></a><a accesskey="h" href="index.html"><img src="images/home.png" alt="Home"></a><a accesskey="n" href="CONTRACT_FUNCTION.html"><img src="images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>

Added: sandbox/contract/libs/contract/doc/html/CONTRACT_DESTRUCTOR_BODY.html
==============================================================================
--- (empty file)
+++ sandbox/contract/libs/contract/doc/html/CONTRACT_DESTRUCTOR_BODY.html 2011-06-28 20:54:41 EDT (Tue, 28 Jun 2011)
@@ -0,0 +1,84 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
+<title>Macro CONTRACT_DESTRUCTOR_BODY</title>
+<link rel="stylesheet" href="doc/html/boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
+<link rel="home" href="index.html" title="Contract++ 0.3.490">
+<link rel="up" href="reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.body_hpp" title="Header &lt;E:/sandbox/contractpp/trunk/doc/qbk/src/contract/body.hpp&gt;">
+<link rel="prev" href="CONTRACT_CONSTRUCTOR_BODY.html" title="Macro CONTRACT_CONSTRUCTOR_BODY">
+<link rel="next" href="CONTRACT_BODY.html" title="Macro CONTRACT_BODY">
+</head>
+<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
+<table cellpadding="2" width="100%"><tr><td valign="top"></td></tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="CONTRACT_CONSTRUCTOR_BODY.html"><img src="images/prev.png" alt="Prev"></a><a accesskey="u" href="reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.body_hpp"><img src="images/up.png" alt="Up"></a><a accesskey="h" href="index.html"><img src="images/home.png" alt="Home"></a><a accesskey="n" href="CONTRACT_BODY.html"><img src="images/next.png" alt="Next"></a>
+</div>
+<div class="refentry">
+<a name="CONTRACT_DESTRUCTOR_BODY"></a><div class="titlepage"></div>
+<div class="refnamediv">
+<h2><span class="refentrytitle">Macro CONTRACT_DESTRUCTOR_BODY</span></h2>
+<p>CONTRACT_DESTRUCTOR_BODY</p>
+</div>
+<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
+<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="comment">// In header: &lt;<a class="link" href="reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.body_hpp" title="Header &lt;E:/sandbox/contractpp/trunk/doc/qbk/src/contract/body.hpp&gt;">E:/sandbox/contractpp/trunk/doc/qbk/src/contract/body.hpp</a>&gt;
+
+</span>CONTRACT_DESTRUCTOR_BODY(class_type, class_name)</pre></div>
+<div class="refsect1">
+<a name="id965405"></a><h2>Description</h2>
+<p>Macro used to name the destructor body when separating destructor definition from its declaration.</p>
+<p>This macro is used when the destructor is defined outside the class declaration (for example in a separate ".cpp" file) to name the destructor body function: </p>
+<pre class="programlisting"> <span class="identifier">CONTRACT_DESTRUCTOR_BODY</span><span class="special">(</span><span class="identifier">class_type</span><span class="special">,</span> <span class="identifier">class_name</span><span class="special">)</span>
+ <span class="special">(</span><span class="keyword">void</span><span class="special">)</span> <span class="special">{</span> <span class="comment">// Destructors have no argument.</span>
+ <span class="special">...</span> <span class="comment">// Destructor implementation.</span>
+ <span class="special">}</span>
+</pre>
+<p><span class="bold"><strong>Parameters:</strong></span> </p>
+<div class="informaltable"><table class="table">
+<colgroup>
+<col>
+<col>
+</colgroup>
+<tbody>
+<tr>
+<td><span class="bold"><strong><code class="computeroutput">class_type</code></strong></span></td>
+<td>The type of the class. For class templates this must also list the template parameters. </td>
+</tr>
+<tr>
+<td><span class="bold"><strong><code class="computeroutput">class_name</code></strong></span></td>
+<td>The constructor name which is the class type name -- do <span class="bold"><strong>not</strong></span> prefixed the class name with "~" (this is the class name and not the destructor name). For class templates this shall not list the template parameters. </td>
+</tr>
+</tbody>
+</table></div>
+<p>
+</p>
+<p><span class="bold"><strong>Returns:</strong></span> This macro expands to code equivalent to the following: </p>
+<pre class="programlisting"> <span class="preprocessor">#if</span> <span class="identifier">defined</span> <span class="identifier">CONTRACT_CHECK_CLASS_INVARIANT</span> <span class="special">||</span> \
+ <span class="identifier">defined</span> <span class="identifier">CONTRACT_CHECK_PRECONDITION</span> <span class="special">||</span> \
+ <span class="identifier">defined</span> <span class="identifier">CONTRACT_CHECK_POSTCONDITION</span>
+ <span class="keyword">void</span> <span class="identifier">class_type</span><span class="special">::</span><span class="identifier">contract_body_destructor_</span> <span class="comment">// Destructor body function name.</span>
+ <span class="preprocessor">#else</span>
+ <span class="identifier">class_type</span><span class="special">::</span><span class="special">~</span><span class="identifier">class_name</span> <span class="comment">// Destructor function (contracts off).</span>
+ <span class="preprocessor">#endif</span>
+ <span class="special">(</span><span class="keyword">void</span><span class="special">)</span> <span class="special">{</span> <span class="comment">// Destructor have no argument.</span>
+ <span class="special">...</span> <span class="comment">// Destructor implementation.</span>
+ <span class="special">}</span>
+</pre>
+<p><span class="bold"><strong>See:</strong></span> Tutorial section, <code class="computeroutput">CONTRACT_DESTRUCTOR()</code> </p>
+</div>
+</div>
+<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
+<td align="left"></td>
+<td align="right"><div class="copyright-footer">Copyright &#169; 2009, 2010 Lorenzo Caminiti<p>
+ Distributed under the Contract++ Software License, Version 1.0 (see accompanying
+ file LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="CONTRACT_CONSTRUCTOR_BODY.html"><img src="images/prev.png" alt="Prev"></a><a accesskey="u" href="reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.body_hpp"><img src="images/up.png" alt="Up"></a><a accesskey="h" href="index.html"><img src="images/home.png" alt="Home"></a><a accesskey="n" href="CONTRACT_BODY.html"><img src="images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>

Added: sandbox/contract/libs/contract/doc/html/CONTRACT_FUNCTION.html
==============================================================================
--- (empty file)
+++ sandbox/contract/libs/contract/doc/html/CONTRACT_FUNCTION.html 2011-06-28 20:54:41 EDT (Tue, 28 Jun 2011)
@@ -0,0 +1,104 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
+<title>Macro CONTRACT_FUNCTION</title>
+<link rel="stylesheet" href="doc/html/boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
+<link rel="home" href="index.html" title="Contract++ 0.3.490">
+<link rel="up" href="reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.macros_hpp" title="Header &lt;E:/sandbox/contractpp/trunk/doc/qbk/src/contract/macros.hpp&gt;">
+<link rel="prev" href="CONTRACT_DESTRUCTOR.html" title="Macro CONTRACT_DESTRUCTOR">
+<link rel="next" href="contract/nonmember_function.html" title="Class template nonmember_function">
+</head>
+<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
+<table cellpadding="2" width="100%"><tr><td valign="top"></td></tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="CONTRACT_DESTRUCTOR.html"><img src="images/prev.png" alt="Prev"></a><a accesskey="u" href="reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.macros_hpp"><img src="images/up.png" alt="Up"></a><a accesskey="h" href="index.html"><img src="images/home.png" alt="Home"></a><a accesskey="n" href="contract/nonmember_function.html"><img src="images/next.png" alt="Next"></a>
+</div>
+<div class="refentry">
+<a name="CONTRACT_FUNCTION"></a><div class="titlepage"></div>
+<div class="refnamediv">
+<h2><span class="refentrytitle">Macro CONTRACT_FUNCTION</span></h2>
+<p>CONTRACT_FUNCTION</p>
+</div>
+<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
+<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="comment">// In header: &lt;<a class="link" href="reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.macros_hpp" title="Header &lt;E:/sandbox/contractpp/trunk/doc/qbk/src/contract/macros.hpp&gt;">E:/sandbox/contractpp/trunk/doc/qbk/src/contract/macros.hpp</a>&gt;
+
+</span>CONTRACT_FUNCTION(sequence)</pre></div>
+<div class="refsect1">
+<a name="id972289"></a><h2>Description</h2>
+<p>Macro used to write contracts for functions (non-static members, static members, and non-members but not for constructors and destructors).</p>
+<p>This macro must be used right after the member function declaration. There is no need for a trailing <code class="computeroutput">";"</code> after the macro closing parenthesis <code class="computeroutput">")"</code>.</p>
+<p>For example (see the Tutorial section for more information): </p>
+<pre class="programlisting"> <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> <span class="identifier">T</span><span class="special">&gt;</span>
+ <span class="keyword">class</span> <span class="identifier">myvector</span> <span class="special">{</span>
+ <span class="special">...</span> <span class="comment">// Invariants.</span>
+
+ <span class="keyword">public</span><span class="special">:</span>
+ <span class="keyword">void</span> <span class="identifier">push_back</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">T</span><span class="special">&amp;</span> <span class="identifier">element</span><span class="special">)</span> <span class="comment">// Function declaration.</span>
+ <span class="identifier">CONTRACT_FUNCTION</span><span class="special">(</span> <span class="special">(</span><span class="keyword">class</span><span class="special">)</span> <span class="special">(</span><span class="identifier">copyable</span><span class="special">)</span><span class="special">(</span><span class="identifier">myvector</span><span class="special">)</span>
+ <span class="special">(</span><span class="keyword">public</span><span class="special">)</span> <span class="special">(</span><span class="keyword">void</span><span class="special">)</span> <span class="special">(</span><span class="identifier">push_back</span><span class="special">)</span><span class="special">(</span> <span class="special">(</span><span class="keyword">const</span> <span class="identifier">T</span><span class="special">&amp;</span><span class="special">)</span><span class="special">(</span><span class="identifier">element</span><span class="special">)</span> <span class="special">)</span>
+ <span class="special">(</span><span class="identifier">precondition</span><span class="special">)</span> <span class="special">(</span><span class="special">{</span>
+ <span class="special">...</span> <span class="comment">// Assert function preconditions.</span>
+ <span class="special">}</span><span class="special">)</span>
+ <span class="special">(</span><span class="identifier">postcondition</span><span class="special">)</span> <span class="special">(</span><span class="special">{</span>
+ <span class="special">...</span> <span class="comment">// Assert function postconditions.</span>
+ <span class="special">}</span><span class="special">)</span>
+ <span class="special">(</span><span class="identifier">body</span><span class="special">)</span> <span class="special">(</span><span class="special">{</span>
+ <span class="special">...</span> <span class="comment">// Actual function implementation.</span>
+ <span class="special">}</span><span class="special">)</span> <span class="special">)</span> <span class="comment">// No need for ";" after macro closing parenthesis ")".</span>
+
+ <span class="special">...</span> <span class="comment">// Rest of the class.</span>
+ <span class="special">}</span><span class="special">;</span>
+</pre>
+<p><span class="bold"><strong>Parameters:</strong></span> </p>
+<div class="informaltable"><table class="table">
+<colgroup>
+<col>
+<col>
+</colgroup>
+<tbody><tr>
+<td><span class="bold"><strong><code class="computeroutput">sequence</code></strong></span></td>
+<td>A Boost.Preprocessor sequence of tokens <code class="computeroutput">(<span class="emphasis"><em>1st-token</em></span>)(<span class="emphasis"><em>2nd-token</em></span>)<span class="emphasis"><em>...</em></span>(<span class="emphasis"><em>last-token</em></span>)</code> that repeats the function signature syntactic elements and specifies the contract.<div class="itemizedlist"><ul class="itemizedlist" type="disc">
+<li class="listitem"><p>The signature tokens are needed by the library to generate the contract code with the function name, the argument types and names, etc as explained in the the Without the Macros section (e.g., the argument names are needed to actually name the arguments for the precondition and postcondition functions).</p></li>
+<li class="listitem"><p>The extra parenthesis <code class="computeroutput">()</code> around the tokens are mandatory (they are the ones making the preprocessor sequence).</p></li>
+<li class="listitem"><p>It is recommended to use <code class="computeroutput">CONTRACT_ASSERT()</code> to assert preconditions and postconditions within the relative code blocks.</p></li>
+<li class="listitem"><p>Within the postcondition code block, <code class="computeroutput">CONTRACT_OLDOF(this)</code> is a constant pointer to the object old value (as it was before body execution) but only if <span class="emphasis"><em>class-type</em></span> was tagged <code class="computeroutput">(copyable)</code> in <code class="computeroutput">sequence</code>. Similarly, <code class="computeroutput">CONTRACT_OLDOF(</code><span class="emphasis"><em>argument-name</em></span><code class="computeroutput">)</code> is a constant reference to the related old argument value (as is was before body execution) but only if the <span class="emphasis"><em>argument-type</em></span> was tagged <code class="computeroutput">(copyable)</code> in <code class="computeroutput">sequence</code>.</p></li>
+<li class="listitem"><p>Within the postcondition code block, <span class="emphasis"><em>result-name</em></span> (with the actual name specified in <code class="computeroutput">sequence</code>) is a constant reference to the value being returned but only when <span class="emphasis"><em>result-type</em></span> is specified different from <code class="computeroutput">void</code> in <code class="computeroutput">sequence</code>.</p></li>
+<li class="listitem"><p>For the body block, <code class="computeroutput">";"</code> can be used to separate the constructor definition from its declaration (see <code class="computeroutput">CONTRACT_CONSTRUCTOR_BODY()</code>). Also, <code class="computeroutput">"= 0;"</code> can be specified when writing contracts for pure virtual member functions.</p></li>
+<li class="listitem"><p>As explained in the Tutorial section, the tokens in <code class="computeroutput">sequence</code> appear in the exact same order as they appear in the member function declaration followed by the optional preconditions, optional postconditions, and mandatory body.</p></li>
+<li class="listitem"><p>The function <code class="computeroutput">sequence</code> syntax is as follows (<span class="emphasis"><em>[]</em></span> for optional tokens, <span class="emphasis"><em>{}</em></span> tokens resulting from parenthesis contents evaluation, <span class="emphasis"><em>||</em></span> one token or the other, <span class="emphasis"><em>*</em></span> tokens repeated 0 or more times, <span class="emphasis"><em>+</em></span> tokens repeated 1 or more times, <span class="emphasis"><em>{}::</em></span> tokens specified only for member functions, <span class="emphasis"><em>{}?</em></span> tokens specified only for non-void functions):</p></li>
+</ul></div>
+<code class="computeroutput"> <span class="emphasis"><em>{[</em></span>(template)<span class="emphasis"><em>]</em></span> <span class="emphasis"><em>[</em></span>(copyable)<span class="emphasis"><em>]</em></span>(<span class="emphasis"><em>class-type</em></span>) <span class="emphasis"><em>{</em></span>(inherit)(<span class="emphasis"><em>base-class-type</em></span>)<span class="emphasis"><em>}*</em></span> <span class="emphasis"><em>{</em></span>(public) <span class="emphasis"><em>||</em></span> (protected) <span class="emphasis"><em>||</em></span> (private)<span class="emphasis"><em>}}::</em></span> <span class="emphasis"><em>[</em></span>(template)( <span class="emphasis"><em>{</em></span>(<span class="emphasis"><em>function-template-parameter-type</em></span>)(<span class="emphasis"><em>function-template-parameter-name</em></span>)<span class="emphasis"><em>}+</em></span> )<span class="emphasis"><em>]</em></span> <span class="emphasis"><em>[{</em></span>(static) <span class="emphasis"><em>||</em></span>
 (virtual)<span class="emphasis"><em>}]</em></span> (<span class="emphasis"><em>result-type</em></span>) (<span class="emphasis"><em>function-name</em></span>)( <span class="emphasis"><em>{</em></span>(void) <span class="emphasis"><em>||</em></span> <span class="emphasis"><em>{[</em></span>(copyable)<span class="emphasis"><em>]</em></span>(<span class="emphasis"><em>argument-type</em></span>)(<span class="emphasis"><em>argument-name</em></span>)<span class="emphasis"><em>}+}</em></span> ) <span class="emphasis"><em>[</em></span>(const)<span class="emphasis"><em>]</em></span> <span class="emphasis"><em>[</em></span>(precondition) ({ ... })<span class="emphasis"><em>]</em></span> <span class="emphasis"><em>[</em></span>(postcondition) {(<span class="emphasis"><em>result-name</em></span>)}? ({ ... })<span class="emphasis"><em>]</em></span> (body) ({ ... }) </code> </td>
+</tr></tbody>
+</table></div>
+<p>
+</p>
+<p><span class="bold"><strong>Returns:</strong></span> See Without the Macro section for examples of the code generated by this macro expansion. </p>
+<div class="itemizedlist"><ul class="itemizedlist" type="disc">
+<li class="listitem"><p>If contract compilation is turned on, this macro expands to the function contract (see the Without the Macros section). </p></li>
+<li class="listitem"><p>Otherwise, if contract compilation is turned off, this macro expands to just the function body using <code class="computeroutput">body_code_block</code> (and no contract overhead is added).</p></li>
+</ul></div>
+<p>
+The usual C++ restrictions on the function signature apply. For example, static member functions cannot be <code class="computeroutput">virtual</code> or <code class="computeroutput">const</code>, plus they cannot subcontract so <code class="computeroutput">(inherit)</code> cannot be specified. The library will generate compile-time errors if <code class="computeroutput">sequence</code> violates these constraints.</p>
+<p>For <span class="bold"><strong>operators</strong></span>, the operator name must also be spelled out in words and passed as <code class="computeroutput">(operator(<span class="emphasis"><em>symbol, word</em></span>))</code> (this is because operator names usually contain symbols, like <code class="computeroutput">"[]"</code>, that are not valid preprocessor token so they cannot be used by this library). The spelled out operator name is arbitrary but it cannot contain operator special symbols (see the Tutorial for more information). For example, for <code class="computeroutput">operator[]</code> the function name passed to <code class="computeroutput">sequence</code> could be <code class="computeroutput">(operator([], at))</code>.</p>
+<p><span class="bold"><strong>Overloaded</strong></span> functions, with same number of arguments and constant qualifier, must have different argument names (and not just different argument types). This is necessary otherwise this library will not be able to distinguish the contract of the overloaded functions from each other and it will generate a compile-time error. (C++ uses the argument types and not their names to distinguish overloaded functions from each other but this library cannot use the argument types because, in general, they are not valid preprocessor tokens -- see the Tutorial for more information on this topic.)</p>
+<p><span class="bold"><strong>Note:</strong></span> For functions with no argument <code class="computeroutput">(<span class="emphasis"><em>function-name</em></span>)( (void) )</code>, and not just <code class="computeroutput">(<span class="emphasis"><em>function-name</em></span>)( )</code>, must be used to specify the empty argument list within <code class="computeroutput">sequence</code>. This is because ISO standard C++ does not allow for empty macro parameters (this library also supports <code class="computeroutput">(<span class="emphasis"><em>function-name</em></span>)( )</code> but this will only compile on C99 so its use is not recommended -- see the Tutorial section for more information).</p>
+<p><span class="bold"><strong>Warning:</strong></span> While there is only a limited amount of compile-time error checking that the library can do on <code class="computeroutput">sequence</code>, the current library implementation does not uses the best possible error detection and reporting mechanism for missuses of the <code class="computeroutput">sequence</code> syntax. In some cases, and depending on the compiler used, an error in programming <code class="computeroutput">sequence</code> might result in cryptic compiler errors (involving library internal templates and preprocessor macros, Boost.Preprocessor internal macros <code class="computeroutput">BOOST_PP_...</code>, and only referring to the contract macro first line number). The best way to resolve these errors is usually to inspect the <code class="computeroutput">sequence</code> by eye instead of trying to make sense of the compiler error messages. Also, try first to compile with contracts turned off so to make sure that the errors are actually
in the contract code. Rarely, it might be useful to look at the code generated by the contract macro expansion after preprocessing using your compiler related options ("-E -P" on GCC, "\EP" on Microsoft Visual C++, etc).</p>
+<p><span class="bold"><strong>See:</strong></span> <code class="computeroutput">CONTRACT_ASSERT()</code>, <code class="computeroutput">CONTRACT_INVARIANT()</code>, <code class="computeroutput">CONTRACT_CONSTRUCTOR()</code>, <code class="computeroutput">CONTRACT_DESTRUCTOR()</code> </p>
+</div>
+</div>
+<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
+<td align="left"></td>
+<td align="right"><div class="copyright-footer">Copyright &#169; 2009, 2010 Lorenzo Caminiti<p>
+ Distributed under the Contract++ Software License, Version 1.0 (see accompanying
+ file LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="CONTRACT_DESTRUCTOR.html"><img src="images/prev.png" alt="Prev"></a><a accesskey="u" href="reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.macros_hpp"><img src="images/up.png" alt="Up"></a><a accesskey="h" href="index.html"><img src="images/home.png" alt="Home"></a><a accesskey="n" href="contract/nonmember_function.html"><img src="images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>

Added: sandbox/contract/libs/contract/doc/html/CONTRACT_INIT_LOOP_VARIANT.html
==============================================================================
--- (empty file)
+++ sandbox/contract/libs/contract/doc/html/CONTRACT_INIT_LOOP_VARIANT.html 2011-06-28 20:54:41 EDT (Tue, 28 Jun 2011)
@@ -0,0 +1,58 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
+<title>Macro CONTRACT_INIT_LOOP_VARIANT</title>
+<link rel="stylesheet" href="doc/html/boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
+<link rel="home" href="index.html" title="Contract++ 0.3.490">
+<link rel="up" href="reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.block_hpp" title="Header &lt;E:/sandbox/contractpp/trunk/doc/qbk/src/contract/block.hpp&gt;">
+<link rel="prev" href="CONTRACT_ASSERT_LOOP_VARIANT_MSG.html" title="Macro CONTRACT_ASSERT_LOOP_VARIANT_MSG">
+<link rel="next" href="CONTRACT_CONSTRUCTOR_BODY.html" title="Macro CONTRACT_CONSTRUCTOR_BODY">
+</head>
+<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
+<table cellpadding="2" width="100%"><tr><td valign="top"></td></tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="CONTRACT_ASSERT_LOOP_VARIANT_MSG.html"><img src="images/prev.png" alt="Prev"></a><a accesskey="u" href="reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.block_hpp"><img src="images/up.png" alt="Up"></a><a accesskey="h" href="index.html"><img src="images/home.png" alt="Home"></a><a accesskey="n" href="CONTRACT_CONSTRUCTOR_BODY.html"><img src="images/next.png" alt="Next"></a>
+</div>
+<div class="refentry">
+<a name="CONTRACT_INIT_LOOP_VARIANT"></a><div class="titlepage"></div>
+<div class="refnamediv">
+<h2><span class="refentrytitle">Macro CONTRACT_INIT_LOOP_VARIANT</span></h2>
+<p>CONTRACT_INIT_LOOP_VARIANT</p>
+</div>
+<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
+<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="comment">// In header: &lt;<a class="link" href="reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.block_hpp" title="Header &lt;E:/sandbox/contractpp/trunk/doc/qbk/src/contract/block.hpp&gt;">E:/sandbox/contractpp/trunk/doc/qbk/src/contract/block.hpp</a>&gt;
+
+</span>CONTRACT_INIT_LOOP_VARIANT</pre></div>
+<div class="refsect1">
+<a name="id964162"></a><h2>Description</h2>
+<p>Initialize the evaluation of the loop variant expression of type <code class="computeroutput">contract::loop_variant_type</code>.</p>
+<p>It must be used once, and only once, in a given code block. It must be used before using <code class="computeroutput">CONTRACT_ASSERT_LOOP_VARIANT()</code> (or <code class="computeroutput">CONTRACT_ASSERT_LOOP_VARIANT_MSG()</code>) at same of higher scope level.</p>
+<p>It can also be used within a <code class="computeroutput">for</code> loop initialization argument, for example: </p>
+<pre class="programlisting"> <span class="keyword">void</span> <span class="identifier">offset</span><span class="special">(</span><span class="keyword">int</span><span class="special">&amp;</span> <span class="identifier">i</span><span class="special">)</span> <span class="special">{</span>
+ <span class="special">...</span>
+ <span class="keyword">for</span> <span class="special">(</span><span class="identifier">CONTRACT_INIT_LOOP_VARIANT</span><span class="special">;</span> <span class="identifier">i</span> <span class="special">&lt;</span> <span class="identifier">MAX</span><span class="special">;</span> <span class="special">)</span> <span class="special">{</span>
+ <span class="identifier">CONTRACT_ASSERT_LOOP_VARIANT</span><span class="special">(</span> <span class="identifier">MAX</span> <span class="special">-</span> <span class="identifier">i</span> <span class="special">)</span><span class="special">;</span>
+ <span class="special">...</span>
+ <span class="identifier">i</span> <span class="special">+=</span> <span class="identifier">DELTA</span><span class="special">;</span>
+ <span class="special">}</span>
+ <span class="special">}</span>
+</pre>
+<p><span class="bold"><strong>See:</strong></span> <code class="computeroutput">contract::loop_variant_type</code>, <code class="computeroutput">CONTRACT_ASSERT_LOOP_VARIANT()</code>, <code class="computeroutput">CONTRACT_ASSERT_LOOP_VARIANT_MSG()</code> </p>
+</div>
+</div>
+<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
+<td align="left"></td>
+<td align="right"><div class="copyright-footer">Copyright &#169; 2009, 2010 Lorenzo Caminiti<p>
+ Distributed under the Contract++ Software License, Version 1.0 (see accompanying
+ file LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="CONTRACT_ASSERT_LOOP_VARIANT_MSG.html"><img src="images/prev.png" alt="Prev"></a><a accesskey="u" href="reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.block_hpp"><img src="images/up.png" alt="Up"></a><a accesskey="h" href="index.html"><img src="images/home.png" alt="Home"></a><a accesskey="n" href="CONTRACT_CONSTRUCTOR_BODY.html"><img src="images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>

Added: sandbox/contract/libs/contract/doc/html/CONTRACT_INVARIANT.html
==============================================================================
--- (empty file)
+++ sandbox/contract/libs/contract/doc/html/CONTRACT_INVARIANT.html 2011-06-28 20:54:41 EDT (Tue, 28 Jun 2011)
@@ -0,0 +1,96 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
+<title>Macro CONTRACT_INVARIANT</title>
+<link rel="stylesheet" href="doc/html/boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
+<link rel="home" href="index.html" title="Contract++ 0.3.490">
+<link rel="up" href="reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.macros_hpp" title="Header &lt;E:/sandbox/contractpp/trunk/doc/qbk/src/contract/macros.hpp&gt;">
+<link rel="prev" href="contract/from.html" title="Type from">
+<link rel="next" href="CONTRACT_CONSTRUCTOR.html" title="Macro CONTRACT_CONSTRUCTOR">
+</head>
+<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
+<table cellpadding="2" width="100%"><tr><td valign="top"></td></tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="contract/from.html"><img src="images/prev.png" alt="Prev"></a><a accesskey="u" href="reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.macros_hpp"><img src="images/up.png" alt="Up"></a><a accesskey="h" href="index.html"><img src="images/home.png" alt="Home"></a><a accesskey="n" href="CONTRACT_CONSTRUCTOR.html"><img src="images/next.png" alt="Next"></a>
+</div>
+<div class="refentry">
+<a name="CONTRACT_INVARIANT"></a><div class="titlepage"></div>
+<div class="refnamediv">
+<h2><span class="refentrytitle">Macro CONTRACT_INVARIANT</span></h2>
+<p>CONTRACT_INVARIANT</p>
+</div>
+<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
+<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="comment">// In header: &lt;<a class="link" href="reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.macros_hpp" title="Header &lt;E:/sandbox/contractpp/trunk/doc/qbk/src/contract/macros.hpp&gt;">E:/sandbox/contractpp/trunk/doc/qbk/src/contract/macros.hpp</a>&gt;
+
+</span>CONTRACT_INVARIANT(sequence)</pre></div>
+<div class="refsect1">
+<a name="id969918"></a><h2>Description</h2>
+<p>Macro used to write (static and non) class invariants.</p>
+<p>This macro should be used in a private section in the class declaration. There is no need for a trailing <code class="computeroutput">";"</code> after the macro closing parenthesis <code class="computeroutput">")"</code>.</p>
+<p>For example (see the Tutorial section for more information): </p>
+<pre class="programlisting"> <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> <span class="identifier">T</span><span class="special">&gt;</span>
+ <span class="keyword">class</span> <span class="identifier">myvector</span> <span class="special">{</span>
+
+ <span class="identifier">CONTRACT_INVARIANT</span><span class="special">(</span> <span class="special">(</span><span class="keyword">static</span><span class="special">)</span> <span class="special">(</span><span class="special">{</span>
+ <span class="special">...</span> <span class="comment">// Assert static class invariants.</span>
+ <span class="special">}</span><span class="special">)</span> <span class="special">(</span><span class="special">{</span>
+ <span class="special">...</span> <span class="comment">// Assert non-static class invariants.</span>
+ <span class="special">}</span><span class="special">)</span> <span class="special">)</span> <span class="comment">// No need for ";" after macro closing parenthesis ")".</span>
+
+ <span class="special">...</span> <span class="comment">// Rest of the class.</span>
+ <span class="special">}</span><span class="special">;</span>
+</pre>
+<p><span class="bold"><strong>Parameters:</strong></span> </p>
+<div class="informaltable"><table class="table">
+<colgroup>
+<col>
+<col>
+</colgroup>
+<tbody><tr>
+<td><span class="bold"><strong><code class="computeroutput">sequence</code></strong></span></td>
+<td>A Boost.Preprocesor sequence of tokens <code class="computeroutput">(<span class="emphasis"><em>1st-token</em></span>)(<span class="emphasis"><em>2nd-token</em></span>)<span class="emphasis"><em>...</em></span>(<span class="emphasis"><em>last-token</em></span>)</code> that specifies static and non-static class invariants.<div class="itemizedlist"><ul class="itemizedlist" type="disc">
+<li class="listitem"><p>At least one of the class invariants must be specified (i.e., you can specify only non-static class invariants, only static class invariants, or both static and non-static class invariants).</p></li>
+<li class="listitem"><p>The code block <code class="computeroutput">({ ... })</code> following <code class="computeroutput">(static)</code> should assert static class invariants. The other code block should assert non-static class invariants.</p></li>
+<li class="listitem"><p>The class invariant <code class="computeroutput">sequence</code> syntax is as follows (<span class="emphasis"><em>[]</em></span> for optional tokens):</p></li>
+</ul></div>
+<code class="computeroutput"> <span class="emphasis"><em>[</em></span>(static)({ ... })<span class="emphasis"><em>] </em></span>({ ... }) </code> </td>
+</tr></tbody>
+</table></div>
+<p>
+</p>
+<p><span class="bold"><strong>Returns:</strong></span> See the Without the Macro section for examples of the code generated by this macro expansion. </p>
+<div class="itemizedlist"><ul class="itemizedlist" type="disc">
+<li class="listitem"><p>If contract compilation is turned on, this macro expands to the augmented state member variable named <code class="computeroutput">contract_state_</code>. </p></li>
+<li class="listitem"><p>Furthermore, if invariants compilation is specifically turned on, this macro expands to the static member function <code class="computeroutput">contract_static_invariant_</code> and the non-static member function <code class="computeroutput">contract_invariant_</code> defined respectively using the two code blocks from <code class="computeroutput">(static)({ ... })</code> and <code class="computeroutput">({ ... })</code>. </p></li>
+<li class="listitem"><p>Otherwise, if contract compilation is turned off, this macro expands to nothing (and no contract overhead is added).</p></li>
+</ul></div>
+<p>
+<span class="bold"><strong>Note:</strong></span> Even if a class has no invariants, you must still use this macro (with an empty code block) otherwise the library will generate a compile-time error saying that it cannot find the invariant check function for your class (see the Tutorial section for more information): </p>
+<pre class="programlisting"> <span class="keyword">class</span> <span class="identifier">myclass</span> <span class="special">{</span>
+
+ <span class="comment">// Assert no invariant (mandatory).</span>
+ <span class="identifier">CONTRACT_INVARIANT</span><span class="special">(</span> <span class="special">(</span><span class="special">{</span><span class="special">}</span><span class="special">)</span> <span class="special">)</span>
+
+ <span class="special">...</span> <span class="comment">// Rest of the class.</span>
+ <span class="special">}</span><span class="special">;</span>
+</pre>
+<p> In this case, <code class="computeroutput">CONTRACT_INVARIANT()</code> cannot be used instead of <code class="computeroutput">CONTRACT_INVARIANT( ({}) )</code>. This is because ISO standard C++ does not allow for empty macro parameters (this library also supports <code class="computeroutput">CONTRACT_INVARIANT()</code> but this will only compile on C99 so its use is not recommended -- see the Tutorial section for more information).</p>
+<p><span class="bold"><strong>See:</strong></span> <code class="computeroutput">CONTRACT_ASSERT()</code>, <code class="computeroutput">CONTRACT_CONSTRUCTOR()</code>, <code class="computeroutput">CONTRACT_DESTRUCTOR()</code>, <code class="computeroutput">CONTRACT_FUNCTION()</code> </p>
+</div>
+</div>
+<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
+<td align="left"></td>
+<td align="right"><div class="copyright-footer">Copyright &#169; 2009, 2010 Lorenzo Caminiti<p>
+ Distributed under the Contract++ Software License, Version 1.0 (see accompanying
+ file LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="contract/from.html"><img src="images/prev.png" alt="Prev"></a><a accesskey="u" href="reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.macros_hpp"><img src="images/up.png" alt="Up"></a><a accesskey="h" href="index.html"><img src="images/home.png" alt="Home"></a><a accesskey="n" href="CONTRACT_CONSTRUCTOR.html"><img src="images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>

Added: sandbox/contract/libs/contract/doc/html/CONTRACT_OLDOF.html
==============================================================================
--- (empty file)
+++ sandbox/contract/libs/contract/doc/html/CONTRACT_OLDOF.html 2011-06-28 20:54:41 EDT (Tue, 28 Jun 2011)
@@ -0,0 +1,71 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
+<title>Macro CONTRACT_OLDOF</title>
+<link rel="stylesheet" href="doc/html/boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
+<link rel="home" href="index.html" title="Contract++ 0.3.490">
+<link rel="up" href="reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.old_hpp" title="Header &lt;E:/sandbox/contractpp/trunk/doc/qbk/src/contract/old.hpp&gt;">
+<link rel="prev" href="contract/copy.html" title="Class template copy">
+<link rel="next" href="contract/state.html" title="Class state">
+</head>
+<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
+<table cellpadding="2" width="100%"><tr><td valign="top"></td></tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="contract/copy.html"><img src="images/prev.png" alt="Prev"></a><a accesskey="u" href="reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.old_hpp"><img src="images/up.png" alt="Up"></a><a accesskey="h" href="index.html"><img src="images/home.png" alt="Home"></a><a accesskey="n" href="contract/state.html"><img src="images/next.png" alt="Next"></a>
+</div>
+<div class="refentry">
+<a name="CONTRACT_OLDOF"></a><div class="titlepage"></div>
+<div class="refnamediv">
+<h2><span class="refentrytitle">Macro CONTRACT_OLDOF</span></h2>
+<p>CONTRACT_OLDOF</p>
+</div>
+<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
+<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="comment">// In header: &lt;<a class="link" href="reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.old_hpp" title="Header &lt;E:/sandbox/contractpp/trunk/doc/qbk/src/contract/old.hpp&gt;">E:/sandbox/contractpp/trunk/doc/qbk/src/contract/old.hpp</a>&gt;
+
+</span>CONTRACT_OLDOF(variable_name)</pre></div>
+<div class="refsect1">
+<a name="id979152"></a><h2>Description</h2>
+<p>Macro used to access old value for the variable with the specified name in postconditions.</p>
+<p>The library automatically declares variables to hold old values of types tagged <code class="computeroutput"><a class="link" href="contract/copyable.html" title="Class template copyable">contract::copyable</a></code> and makes then accessible in the postconditions code block (and from the postconditions code block only). This macro simply expands the specified name to the name of the old variable automatically declared by the library.</p>
+<p>For example, in postconditions of a member function <code class="computeroutput">void myvector&lt;T&gt;::push_back(const T&amp; element)</code>, if both the class type <code class="computeroutput">myvector</code> and the <code class="computeroutput">element</code> argument type <code class="computeroutput">const T&amp;</code> have been tagged copyable (see the <code class="computeroutput">sequence</code> parameter of <code class="computeroutput">CONTRACT_FUNCTION()</code> and <code class="computeroutput"><a class="link" href="contract/copy.html" title="Class template copy">contract::copy</a></code>) then the following old values are available: </p>
+<pre class="programlisting"> <span class="identifier">CONTRACT_OLDOF</span><span class="special">(</span><span class="keyword">this</span><span class="special">)</span><span class="special">-&gt;</span><span class="special">...</span> <span class="comment">// Object old value.</span>
+ <span class="identifier">CONTRACT_OLDOF</span><span class="special">(</span><span class="identifier">element</span><span class="special">)</span><span class="special">...</span> <span class="comment">// Old value of function argument `element`.</span>
+</pre>
+<p><span class="bold"><strong>Parameters:</strong></span> </p>
+<div class="informaltable"><table class="table">
+<colgroup>
+<col>
+<col>
+</colgroup>
+<tbody><tr>
+<td><span class="bold"><strong><code class="computeroutput">variable_name</code></strong></span></td>
+<td>Use <code class="computeroutput">this</code> to access a pointer to the old object value. Use one of the function argument names to access the old value of that argument. The type of the variable with the specified name must be tagged <code class="computeroutput"><a class="link" href="contract/copyable.html" title="Class template copyable">contract::copyable</a></code> in the signature sequence its old value to be available (otherwise the use of this macro will generate a compile-time error with <code class="computeroutput">noold</code> in the error message). </td>
+</tr></tbody>
+</table></div>
+<p>
+</p>
+<p><span class="bold"><strong>Returns:</strong></span> This macro expands to code equivalent to the following: </p>
+<pre class="programlisting"> <span class="identifier">contract_old_</span> <span class="special">##</span> <span class="identifier">variable_name</span> <span class="special">##</span> <span class="identifier">_</span>
+</pre>
+<p> (The preprocessor operator <code class="computeroutput">##</code> concatenates the specified tokens.)</p>
+<p><span class="bold"><strong>Note:</strong></span> Shallow copies are performed for old values of pointer types (unless the pointed type defines a different copy constructor or <code class="computeroutput"><a class="link" href="contract/copy.html" title="Class template copy">contract::copy</a></code> has been specialized for the pointed type to perform a different copy operation). Therefore, if a pointer type is tagged <code class="computeroutput"><a class="link" href="contract/copyable.html" title="Class template copyable">contract::copyable</a></code>, the old pointer value will be available in the postconditions and not the old pointed value -- this might not be what you intended. The notable exception is the object which is passed by pointer (like <code class="computeroutput">this</code>) but its old value is automatically deep copied by the library.</p>
+<p><span class="bold"><strong>Note:</strong></span> The library supports old values for the object and all the function argument types. This is a subset of the old values supported by Eiffel which are old values for any expression that can be evaluated in postconditions. However, the old values supported by the library are usually enough to program the postconditions.</p>
+<p><span class="bold"><strong>See:</strong></span> <code class="computeroutput"><a class="link" href="contract/copy.html" title="Class template copy">contract::copy</a></code>, <code class="computeroutput"><a class="link" href="contract/copyable.html" title="Class template copyable">contract::copyable</a></code> </p>
+</div>
+</div>
+<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
+<td align="left"></td>
+<td align="right"><div class="copyright-footer">Copyright &#169; 2009, 2010 Lorenzo Caminiti<p>
+ Distributed under the Contract++ Software License, Version 1.0 (see accompanying
+ file LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="contract/copy.html"><img src="images/prev.png" alt="Prev"></a><a accesskey="u" href="reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.old_hpp"><img src="images/up.png" alt="Up"></a><a accesskey="h" href="index.html"><img src="images/home.png" alt="Home"></a><a accesskey="n" href="contract/state.html"><img src="images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>

Added: sandbox/contract/libs/contract/doc/html/CONTRACT_WRAP_TYPE.html
==============================================================================
--- (empty file)
+++ sandbox/contract/libs/contract/doc/html/CONTRACT_WRAP_TYPE.html 2011-06-28 20:54:41 EDT (Tue, 28 Jun 2011)
@@ -0,0 +1,97 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
+<title>Macro CONTRACT_WRAP_TYPE</title>
+<link rel="stylesheet" href="doc/html/boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
+<link rel="home" href="index.html" title="Contract++ 0.3.490">
+<link rel="up" href="reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.wrap_hpp" title="Header &lt;E:/sandbox/contractpp/trunk/doc/qbk/src/contract/wrap.hpp&gt;">
+<link rel="prev" href="contract/wrap_void_T__id439081.html" title="Struct template wrap&lt;void(T)&gt;">
+<link rel="next" href="contract__/Requirements.html" title="Annex: Requirements">
+</head>
+<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
+<table cellpadding="2" width="100%"><tr><td valign="top"></td></tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="contract/wrap_void_T__id439081.html"><img src="images/prev.png" alt="Prev"></a><a accesskey="u" href="reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.wrap_hpp"><img src="images/up.png" alt="Up"></a><a accesskey="h" href="index.html"><img src="images/home.png" alt="Home"></a><a accesskey="n" href="contract__/Requirements.html"><img src="images/next.png" alt="Next"></a>
+</div>
+<div class="refentry">
+<a name="CONTRACT_WRAP_TYPE"></a><div class="titlepage"></div>
+<div class="refnamediv">
+<h2><span class="refentrytitle">Macro CONTRACT_WRAP_TYPE</span></h2>
+<p>CONTRACT_WRAP_TYPE</p>
+</div>
+<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
+<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="comment">// In header: &lt;<a class="link" href="reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.wrap_hpp" title="Header &lt;E:/sandbox/contractpp/trunk/doc/qbk/src/contract/wrap.hpp&gt;">E:/sandbox/contractpp/trunk/doc/qbk/src/contract/wrap.hpp</a>&gt;
+
+</span>CONTRACT_WRAP_TYPE(parenthesized_type)</pre></div>
+<div class="refsect1">
+<a name="id981578"></a><h2>Description</h2>
+<p>Macro used to pass type expressions with unwrapped commas as macro parameters.</p>
+<p>The C++ ISO standard preprocessor only recognizes the parenthesis <code class="computeroutput"></code>() and it does not recognize any other parenthesis like <code class="computeroutput">&lt;&gt;</code>, <code class="computeroutput">{}</code>, <code class="computeroutput"></code>[], etc.</p>
+<p>As a consequence, any comma within a macro parameter which is not wrapped by the <code class="computeroutput"></code>() parenthesis will be interpreted by the preprocessor as a separation token (the end of the current macro parameter and the start of the next macro parameter). See also the Tutorial section for more explanation and examples.</p>
+<p><span class="bold"><strong>Value Expressions</strong></span></p>
+<p>Value expressions passed as macro parameters and containing unwrapped commas can be wrapped by and extra set of parenthesis <code class="computeroutput"></code>().</p>
+<p>For example, this is OK because the comma `<code class="computeroutput">,</code>` is already wrapped by the parenthesis <code class="computeroutput"></code>() of the <code class="computeroutput">add()</code> function call: </p>
+<pre class="programlisting"> <span class="identifier">CONTRACT_ASSERT</span><span class="special">(</span> <span class="identifier">add</span><span class="special">(</span><span class="number">1</span><span class="special">,</span> <span class="number">2</span><span class="special">)</span> <span class="special">==</span> <span class="number">3</span> <span class="special">)</span><span class="special">;</span> <span class="comment">// OK.</span>
+</pre>
+<p> This is incorrect instead because the comma `<code class="computeroutput">,</code>` is not wrapped. It is interpreted as a call to <code class="computeroutput">CONTRACT_ASSERT()</code> passing <span class="bold"><strong>two</strong></span> distinct macro parameters `<code class="computeroutput">std::map&lt;double</code>` and `<code class="computeroutput">int&gt;().empty()</code>` separated by the comma `<code class="computeroutput">,</code>`: </p>
+<pre class="programlisting"> <span class="identifier">CONTRACT_ASSERT</span><span class="special">(</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">map</span><span class="special">&lt;</span><span class="keyword">double</span><span class="special">,</span> <span class="keyword">int</span><span class="special">&gt;</span><span class="special">(</span><span class="special">)</span><span class="special">.</span><span class="identifier">empty</span><span class="special">(</span><span class="special">)</span> <span class="special">)</span><span class="special">;</span> <span class="comment">// Error.</span>
+</pre>
+<p> However, it can be fixed by using and extra set of parenthesis to wrap the value expression: </p>
+<pre class="programlisting"> <span class="identifier">CONTRACT_ASSERT</span><span class="special">(</span> <span class="special">(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">map</span><span class="special">&lt;</span><span class="keyword">double</span><span class="special">,</span> <span class="keyword">int</span><span class="special">&gt;</span><span class="special">(</span><span class="special">)</span><span class="special">.</span><span class="identifier">empty</span><span class="special">(</span><span class="special">)</span><span class="special">)</span> <span class="special">)</span><span class="special">;</span> <span class="comment">// OK.</span>
+</pre>
+<p><span class="bold"><strong>Type Expressions</strong></span></p>
+<p>A similar issue arises when type expressions with unwrapped commas are passed as macro parameters (including when they are passed as preprocessor sequence elements): </p>
+<pre class="programlisting"> <span class="identifier">std</span><span class="special">::</span><span class="identifier">map</span><span class="special">&lt;</span><span class="identifier">dobule</span><span class="special">,</span> <span class="keyword">int</span><span class="special">&gt;</span> <span class="identifier">m</span><span class="special">(</span><span class="keyword">void</span><span class="special">)</span>
+ <span class="identifier">CONTRACT_FUNCTION</span><span class="special">(</span> <span class="special">(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">map</span><span class="special">&lt;</span><span class="keyword">double</span><span class="special">,</span> <span class="keyword">int</span><span class="special">&gt;</span><span class="special">)</span> <span class="special">(</span><span class="identifier">m</span><span class="special">)</span><span class="special">(</span> <span class="special">(</span><span class="keyword">void</span><span class="special">)</span> <span class="special">)</span> <span class="comment">// Error.</span>
+ <span class="special">...</span>
+ <span class="special">)</span>
+</pre>
+<p> This is interpreted as a preprocessor 2-tuple with two elements `<code class="computeroutput">std::map&lt;double</code>` and `<code class="computeroutput">int&gt;</code>` separated by the comma `<code class="computeroutput">,</code>` instead that one single element of the preprocessor sequence.</p>
+<p><span class="bold"><strong>Note:</strong></span> Unfortunately, the approach followed for value expressions cannot be used for macro parameters that represent type expressions. That is because types wrapped by an extra set of parenthesis <code class="computeroutput"></code>() can introduce syntax or semantics errors depending on the context where they are used. For example, with respect to <code class="computeroutput">std::map&lt;double, int&gt;</code>, the wrapped type expression <code class="computeroutput">(std::map&lt;double, int&gt;)</code> could be compiled a C-style type cast potentically introducing a semantic error, or it could generate a syntax error if it were used to declare a variable.</p>
+<p>The macro <code class="computeroutput">CONTRACT_WRAP_TYPE()</code> (or equivalently the <code class="computeroutput"><a class="link" href="contract/wrap.html" title="Struct template wrap">contract::wrap</a></code> class template) is be used to overcome this limitation: </p>
+<pre class="programlisting"> <span class="identifier">std</span><span class="special">::</span><span class="identifier">map</span><span class="special">&lt;</span><span class="identifier">dobule</span><span class="special">,</span> <span class="keyword">int</span><span class="special">&gt;</span> <span class="identifier">m</span><span class="special">(</span><span class="keyword">void</span><span class="special">)</span>
+ <span class="identifier">CONTRACT_FUNCTION</span><span class="special">(</span> <span class="special">(</span><span class="identifier">CONTRACT_WRAP_TYPE</span><span class="special">(</span> <span class="special">(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">map</span><span class="special">&lt;</span><span class="keyword">double</span><span class="special">,</span> <span class="keyword">int</span><span class="special">&gt;</span><span class="special">)</span> <span class="special">)</span><span class="special">)</span> <span class="comment">//OK.</span>
+ <span class="special">(</span><span class="identifier">m</span><span class="special">)</span><span class="special">(</span> <span class="special">(</span><span class="keyword">void</span><span class="special">)</span> <span class="special">)</span>
+ <span class="special">...</span>
+ <span class="special">)</span>
+</pre>
+<p> Note that the extra pair of parenthesis <code class="computeroutput"></code>() used in invoking the macro are mandatory as they wrap the comma(s) so one parameter (not many) is passed to the macro.</p>
+<p><span class="bold"><strong>Parameters:</strong></span> </p>
+<div class="informaltable"><table class="table">
+<colgroup>
+<col>
+<col>
+</colgroup>
+<tbody><tr>
+<td><span class="bold"><strong><code class="computeroutput">parenthesized_type</code></strong></span></td>
+<td>The type expression wrapped within an extra set of mandatory parenthesis <code class="computeroutput"></code>(). </td>
+</tr></tbody>
+</table></div>
+<p>
+</p>
+<p><span class="bold"><strong>Returns:</strong></span> The macro in the example above expands to code equivalent to the following: </p>
+<pre class="programlisting"> <span class="identifier">std</span><span class="special">::</span><span class="identifier">map</span><span class="special">&lt;</span><span class="identifier">dobule</span><span class="special">,</span> <span class="keyword">int</span><span class="special">&gt;</span> <span class="identifier">m</span><span class="special">(</span><span class="keyword">void</span><span class="special">)</span>
+ <span class="identifier">CONTRACT_FUNCTION</span><span class="special">(</span> <span class="special">(</span><span class="identifier">contract</span><span class="special">::</span><span class="identifier">wrap</span><span class="special">&lt;</span><span class="keyword">void</span><span class="special">(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">map</span><span class="special">&lt;</span><span class="keyword">double</span><span class="special">,</span> <span class="keyword">int</span><span class="special">&gt;</span><span class="special">)</span><span class="special">&gt;</span><span class="special">::</span><span class="identifier">type</span><span class="special">)</span>
+ <span class="special">(</span><span class="identifier">m</span><span class="special">)</span><span class="special">(</span> <span class="special">(</span><span class="keyword">void</span><span class="special">)</span> <span class="special">)</span>
+ <span class="special">...</span>
+ <span class="special">)</span>
+</pre>
+<p> <span class="bold"><strong>See:</strong></span> <a class="link" href="contract/wrap.html" title="Struct template wrap">contract::wrap</a>, Tutorial section </p>
+</div>
+</div>
+<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
+<td align="left"></td>
+<td align="right"><div class="copyright-footer">Copyright &#169; 2009, 2010 Lorenzo Caminiti<p>
+ Distributed under the Contract++ Software License, Version 1.0 (see accompanying
+ file LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="contract/wrap_void_T__id439081.html"><img src="images/prev.png" alt="Prev"></a><a accesskey="u" href="reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.wrap_hpp"><img src="images/up.png" alt="Up"></a><a accesskey="h" href="index.html"><img src="images/home.png" alt="Home"></a><a accesskey="n" href="contract__/Requirements.html"><img src="images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>

Added: sandbox/contract/libs/contract/doc/html/contract/block_invariant_failed.html
==============================================================================
--- (empty file)
+++ sandbox/contract/libs/contract/doc/html/contract/block_invariant_failed.html 2011-06-28 20:54:41 EDT (Tue, 28 Jun 2011)
@@ -0,0 +1,61 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
+<title>Function block_invariant_failed</title>
+<link rel="stylesheet" href="../doc/html/boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
+<link rel="home" href="../index.html" title="Contract++ 0.3.490">
+<link rel="up" href="../reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.assert_hpp" title="Header &lt;E:/sandbox/contractpp/trunk/doc/qbk/src/contract/assert.hpp&gt;">
+<link rel="prev" href="set_block_invariant_failed.html" title="Function set_block_invariant_failed">
+<link rel="next" href="set_class_invariant_failed.html" title="Function set_class_invariant_failed">
+</head>
+<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
+<table cellpadding="2" width="100%"><tr><td valign="top"></td></tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="set_block_invariant_failed.html"><img src="../images/prev.png" alt="Prev"></a><a accesskey="u" href="../reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.assert_hpp"><img src="../images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../images/home.png" alt="Home"></a><a accesskey="n" href="set_class_invariant_failed.html"><img src="../images/next.png" alt="Next"></a>
+</div>
+<div class="refentry">
+<a name="contract.block_invariant_failed"></a><div class="titlepage"></div>
+<div class="refnamediv">
+<h2><span class="refentrytitle">Function block_invariant_failed</span></h2>
+<p>contract::block_invariant_failed</p>
+</div>
+<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
+<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="comment">// In header: &lt;<a class="link" href="../reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.assert_hpp" title="Header &lt;E:/sandbox/contractpp/trunk/doc/qbk/src/contract/assert.hpp&gt;">E:/sandbox/contractpp/trunk/doc/qbk/src/contract/assert.hpp</a>&gt;
+
+</span>
+<span class="keyword">void</span> <span class="identifier">block_invariant_failed</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">from</span> <span class="special">&amp;</span> where<span class="special">)</span><span class="special">;</span></pre></div>
+<div class="refsect1">
+<a name="id960554"></a><h2>Description</h2>
+<p>Automatically invoked by this library when a block invariant condition fails.</p>
+<p>It calls <code class="computeroutput">std::terminate()</code> by default but it can be redefined using <code class="computeroutput">contract::set_block_invariant_failed()</code>. When this function is called, the exception raised by the contract failure is the active unhandled exception (which can be re-thrown using <code class="computeroutput">throw</code> and then caught, see Throw on Failure annex).</p>
+<p><span class="bold"><strong>Parameters:</strong></span> </p>
+<div class="informaltable"><table class="table">
+<colgroup>
+<col>
+<col>
+</colgroup>
+<tbody><tr>
+<td><span class="bold"><strong><code class="computeroutput">where</code></strong></span></td>
+<td>The source that found the the block invariant failure. </td>
+</tr></tbody>
+</table></div>
+<p>
+</p>
+</div>
+</div>
+<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
+<td align="left"></td>
+<td align="right"><div class="copyright-footer">Copyright &#169; 2009, 2010 Lorenzo Caminiti<p>
+ Distributed under the Contract++ Software License, Version 1.0 (see accompanying
+ file LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="set_block_invariant_failed.html"><img src="../images/prev.png" alt="Prev"></a><a accesskey="u" href="../reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.assert_hpp"><img src="../images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../images/home.png" alt="Home"></a><a accesskey="n" href="set_class_invariant_failed.html"><img src="../images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>

Added: sandbox/contract/libs/contract/doc/html/contract/class_invariant_failed.html
==============================================================================
--- (empty file)
+++ sandbox/contract/libs/contract/doc/html/contract/class_invariant_failed.html 2011-06-28 20:54:41 EDT (Tue, 28 Jun 2011)
@@ -0,0 +1,61 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
+<title>Function class_invariant_failed</title>
+<link rel="stylesheet" href="../doc/html/boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
+<link rel="home" href="../index.html" title="Contract++ 0.3.490">
+<link rel="up" href="../reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.assert_hpp" title="Header &lt;E:/sandbox/contractpp/trunk/doc/qbk/src/contract/assert.hpp&gt;">
+<link rel="prev" href="set_class_invariant_failed.html" title="Function set_class_invariant_failed">
+<link rel="next" href="set_precondition_failed.html" title="Function set_precondition_failed">
+</head>
+<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
+<table cellpadding="2" width="100%"><tr><td valign="top"></td></tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="set_class_invariant_failed.html"><img src="../images/prev.png" alt="Prev"></a><a accesskey="u" href="../reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.assert_hpp"><img src="../images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../images/home.png" alt="Home"></a><a accesskey="n" href="set_precondition_failed.html"><img src="../images/next.png" alt="Next"></a>
+</div>
+<div class="refentry">
+<a name="contract.class_invariant_failed"></a><div class="titlepage"></div>
+<div class="refnamediv">
+<h2><span class="refentrytitle">Function class_invariant_failed</span></h2>
+<p>contract::class_invariant_failed</p>
+</div>
+<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
+<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="comment">// In header: &lt;<a class="link" href="../reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.assert_hpp" title="Header &lt;E:/sandbox/contractpp/trunk/doc/qbk/src/contract/assert.hpp&gt;">E:/sandbox/contractpp/trunk/doc/qbk/src/contract/assert.hpp</a>&gt;
+
+</span>
+<span class="keyword">void</span> <span class="identifier">class_invariant_failed</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">from</span> <span class="special">&amp;</span> where<span class="special">)</span><span class="special">;</span></pre></div>
+<div class="refsect1">
+<a name="id960846"></a><h2>Description</h2>
+<p>Automatically invoked by this library when a class invariant condition fails.</p>
+<p>It calls <code class="computeroutput">std::terminate()</code> by default but it can be redefined using <code class="computeroutput">contract::set_class_invariant_failed()</code>. When this function is called, the exception raised by the contract failure is the active unhandled exception (which can be re-thrown using <code class="computeroutput">throw</code> and then caught, see Throw on Failure annex).</p>
+<p><span class="bold"><strong>Parameters:</strong></span> </p>
+<div class="informaltable"><table class="table">
+<colgroup>
+<col>
+<col>
+</colgroup>
+<tbody><tr>
+<td><span class="bold"><strong><code class="computeroutput">where</code></strong></span></td>
+<td>The source that found the the invariant failure. </td>
+</tr></tbody>
+</table></div>
+<p>
+</p>
+</div>
+</div>
+<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
+<td align="left"></td>
+<td align="right"><div class="copyright-footer">Copyright &#169; 2009, 2010 Lorenzo Caminiti<p>
+ Distributed under the Contract++ Software License, Version 1.0 (see accompanying
+ file LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="set_class_invariant_failed.html"><img src="../images/prev.png" alt="Prev"></a><a accesskey="u" href="../reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.assert_hpp"><img src="../images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../images/home.png" alt="Home"></a><a accesskey="n" href="set_precondition_failed.html"><img src="../images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>

Added: sandbox/contract/libs/contract/doc/html/contract/constructor.html
==============================================================================
--- (empty file)
+++ sandbox/contract/libs/contract/doc/html/contract/constructor.html 2011-06-28 20:54:41 EDT (Tue, 28 Jun 2011)
@@ -0,0 +1,178 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
+<title>Class template constructor</title>
+<link rel="stylesheet" href="../doc/html/boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
+<link rel="home" href="../index.html" title="Contract++ 0.3.490">
+<link rel="up" href="../reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.constructor_hpp" title="Header &lt;E:/sandbox/contractpp/trunk/doc/qbk/src/contract/constructor.hpp&gt;">
+<link rel="prev" href="../CONTRACT_CONFIG_MAX_MULTIPLE_INHERITANCE.html" title="Macro CONTRACT_CONFIG_MAX_MULTIPLE_INHERITANCE">
+<link rel="next" href="../CONTRACT_CHECK_BLOCK_INVARIANT.html" title="Macro CONTRACT_CHECK_BLOCK_INVARIANT">
+</head>
+<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
+<table cellpadding="2" width="100%"><tr><td valign="top"></td></tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="../CONTRACT_CONFIG_MAX_MULTIPLE_INHERITANCE.html"><img src="../images/prev.png" alt="Prev"></a><a accesskey="u" href="../reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.constructor_hpp"><img src="../images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../images/home.png" alt="Home"></a><a accesskey="n" href="../CONTRACT_CHECK_BLOCK_INVARIANT.html"><img src="../images/next.png" alt="Next"></a>
+</div>
+<div class="refentry">
+<a name="contract.constructor"></a><div class="titlepage"></div>
+<div class="refnamediv">
+<h2><span class="refentrytitle">Class template constructor</span></h2>
+<p>contract::constructor</p>
+</div>
+<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
+<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="comment">// In header: &lt;<a class="link" href="../reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.constructor_hpp" title="Header &lt;E:/sandbox/contractpp/trunk/doc/qbk/src/contract/constructor.hpp&gt;">E:/sandbox/contractpp/trunk/doc/qbk/src/contract/constructor.hpp</a>&gt;
+
+</span><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> F<span class="special">&gt;</span>
+<span class="keyword">class</span> <a class="link" href="constructor.html" title="Class template constructor">constructor</a> <span class="special">:</span> <span class="keyword">public</span> <span class="identifier">contract</span><span class="special">::</span><span class="identifier">nonstatic_member_function</span><span class="special">&lt;</span> <span class="identifier">F</span> <span class="special">&gt;</span> <span class="special">{</span>
+<span class="keyword">public</span><span class="special">:</span>
+ <span class="comment">// <a class="link" href="constructor.html#contract.constructorconstruct-copy-destruct">construct/copy/destruct</a></span>
+ <a class="link" href="constructor.html#id433571-bb"><span class="identifier">constructor</span></a><span class="special">(</span><span class="identifier">__BodyFunctionPointer__</span><span class="special">,</span> <span class="identifier">__PreconditionFunctionPointer__</span><span class="special">,</span>
+ <span class="identifier">__PostconditionFunctionPointer__</span><span class="special">)</span><span class="special">;</span>
+ <a class="link" href="constructor.html#id433779-bb"><span class="special">~</span><span class="identifier">constructor</span></a><span class="special">(</span><span class="special">)</span><span class="special">;</span>
+
+ <span class="comment">// <a class="link" href="constructor.html#id433500-bb">public member functions</a></span>
+ <span class="keyword">void</span> <a class="link" href="constructor.html#id433504-bb"><span class="identifier">call</span></a><span class="special">(</span><span class="identifier">__MaybeCvClassPointer__</span><span class="special">,</span> <span class="identifier">ArgumentType1</span><span class="special">,</span> <span class="special">...</span><span class="special">,</span> <span class="identifier">ArgumetnTypeN</span><span class="special">)</span><span class="special">;</span>
+<span class="special">}</span><span class="special">;</span></pre></div>
+<div class="refsect1">
+<a name="id967265"></a><h2>Description</h2>
+<p>Class template used to write contracts for constructors.</p>
+<p><span class="bold"><strong>Note:</strong></span> Only the differences between this class and the <code class="computeroutput"><a class="link" href="nonstatic_member_function.html" title="Class template nonstatic_member_function">contract::nonstatic_member_function</a></code> class are documented here. Read the <code class="computeroutput"><a class="link" href="nonstatic_member_function.html" title="Class template nonstatic_member_function">contract::nonstatic_member_function</a></code> documentation first.</p>
+<p>The <code class="computeroutput">CONTRACT_CONSTRUCTOR()</code> macro expands to code that uses this class template (see the Without the Macros section) -- whenever possible, use the macro instead of using this class template directly. Rarely, it might be needed to use this class template directly to implement workarounds for compilers that do not fully comply with the ISO C++ standard.</p>
+<p><span class="bold"><strong>Parameters:</strong></span> </p>
+<div class="informaltable"><table class="table">
+<colgroup>
+<col>
+<col>
+</colgroup>
+<tbody><tr>
+<td><span class="bold"><strong><code class="computeroutput">F</code></strong></span></td>
+<td>The function type of the constructor function being contracted. </td>
+</tr></tbody>
+</table></div>
+<p>
+</p>
+<p>Base contract classes cannot be specified because constructors do not directly subcontract (C++ object construction mechanism will automatically invoke base class contracts when they are present).</p>
+<p>The function type <code class="computeroutput">F</code> must be specified as follows: </p>
+<pre class="programlisting"> <span class="keyword">void</span> <span class="special">(</span><span class="identifier">ClassType</span><span class="special">*</span><span class="special">,</span> <span class="identifier">ArgumentType1</span><span class="special">,</span> <span class="special">...</span><span class="special">,</span> <span class="identifier">ArgumentTypeN</span><span class="special">)</span>
+</pre>
+<p> Note: </p>
+<div class="itemizedlist"><ul class="itemizedlist" type="disc">
+<li class="listitem"><p>The result type is always <code class="computeroutput">void</code> because constructors return no value. </p></li>
+<li class="listitem"><p><code class="computeroutput">ClassType</code> is never <code class="computeroutput">const</code> because constructors can never be constant members (as they modify the object by constructing it). </p></li>
+<li class="listitem"><p><code class="computeroutput">ClassType</code> cannot be tagged <code class="computeroutput"><a class="link" href="copyable.html" title="Class template copyable">contract::copyable</a></code> because there is no object before constructor body execution (it has not been constructed yet) -- the library will generate a compile-time error otherwise.</p></li>
+</ul></div>
+<p>
+<span class="bold"><strong>See:</strong></span> Without the Macros section, <code class="computeroutput"><a class="link" href="nonstatic_member_function.html" title="Class template nonstatic_member_function">contract::nonstatic_member_function</a></code> </p>
+<div class="refsect2">
+<a name="id967519"></a><h3>
+<a name="contract.constructorconstruct-copy-destruct"></a><code class="computeroutput">constructor</code>
+ public
+ construct/copy/destruct</h3>
+<div class="orderedlist"><ol class="orderedlist" type="1">
+<li class="listitem">
+<pre class="literallayout"><a name="id433571-bb"></a><span class="identifier">constructor</span><span class="special">(</span><span class="identifier">__BodyFunctionPointer__</span> body_function<span class="special">,</span>
+ <span class="identifier">__PreconditionFunctionPointer__</span> precondition_function<span class="special">,</span>
+ <span class="identifier">__PostconditionFunctionPointer__</span> postcondition_function<span class="special">)</span><span class="special">;</span></pre>
+<p>Construct this contract object using the specified body, preconditions, and postconditions functions.</p>
+<p><span class="bold"><strong>Parameters:</strong></span> </p>
+<div class="informaltable"><table class="table">
+<colgroup>
+<col>
+<col>
+</colgroup>
+<tbody>
+<tr>
+<td><span class="bold"><strong><code class="computeroutput">body_function</code></strong></span></td>
+<td>A pointer to the function executing the body. </td>
+</tr>
+<tr>
+<td><span class="bold"><strong><code class="computeroutput">precondition_function</code></strong></span></td>
+<td>A pointer to the function asserting the preconditions. </td>
+</tr>
+<tr>
+<td><span class="bold"><strong><code class="computeroutput">postcondition_function</code></strong></span></td>
+<td>A pointer to the function asserting the postconditions. </td>
+</tr>
+</tbody>
+</table></div>
+<p>
+</p>
+<p>Refer to the <code class="computeroutput"><code class="computeroutput"><a class="link" href="nonstatic_member_function.html" title="Class template nonstatic_member_function">contract::nonstatic_member_function</a></code></code> documentation for the definition of metaprogramming constructs used below (<code class="computeroutput">__IfCopyable__</code>, etc).</p>
+<p>The body function pointer type is defined as follows: </p>
+<pre class="programlisting"> typedef void (ClassType::* __BodyFunctionPointer__)
+ ( __RemoveCopyable__&lt; ArgumentType1 &gt;,
+ ...,
+ __RemoveCopyable__&lt; ArgumentTypeN &gt;
+ );
+</pre>
+<p>The precondition function pointer type is defined as follows: </p>
+<pre class="programlisting"> typedef void (* __PreconditionFunctionPointer__)
+ ( boost::add_reference&lt;boost::add_const&lt;
+ __RemoveCopyable__&lt; ArgumentType1 &gt; &gt;::type&gt;::type,
+ ...,
+ boost::add_reference&lt;boost::add_const&lt;
+ __RemoveCopyable__&lt; ArgumentTypeN &gt; &gt;::type&gt;::type
+ );
+</pre>
+<p> </p>
+<div class="itemizedlist"><ul class="itemizedlist" type="disc">
+<li class="listitem"><p>This is a <span class="bold"><strong>static</strong></span> member function (because is does not specify the class type using <code class="computeroutput">(*)</code> instead of <code class="computeroutput">(ClassType::*)</code>). This ensures that constructor preconditions do not access the object (as before constructor body no object has been constructed yet). </p></li>
+<li class="listitem"><p>The precondition function is never <code class="computeroutput">const</code> (because is must be <code class="computeroutput">static</code>).</p></li>
+</ul></div>
+<p>
+The postcondition function pointer type is defined as follows: </p>
+<pre class="programlisting"> typedef void (ClassType::* __PreconditionFunctionPointer__)
+ ( contract::noold,
+ boost::add_reference&lt;boost::add_const&lt;
+ __RemoveCopyable__&lt; ArgumentType1 &gt; &gt;::type&gt;::type,
+ __IfCopyable__&lt; ArgumentType1,
+ boost::add_reference&lt;boost::add_const&lt;
+ __RemoveCopyable__&lt; ArgumentType1 &gt; &gt;::type&gt;::type &gt;,
+ ...,
+ boost::add_reference&lt;boost::add_const&lt;
+ __RemoveCopyable__&lt; ArgumentTypeN &gt; &gt;::type&gt;::type,
+ __IfCopyable__&lt; ArgumentTypeN,
+ boost::add_reference&lt;boost::add_const&lt;
+ __RemoveCopyable__&lt; ArgumentTypeN &gt; &gt;::type&gt;::type &gt;
+ ) const;
+</pre>
+<p> </p>
+<div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>The old object value is never available (it is always of type <code class="computeroutput">contract::noold</code>). This ensure that constructor postconditions never access the object old value (as there was no object before constructor body execution). </p></li></ul></div>
+<p>
+</p>
+</li>
+<li class="listitem">
+<pre class="literallayout"><a name="id433779-bb"></a><span class="special">~</span><span class="identifier">constructor</span><span class="special">(</span><span class="special">)</span><span class="special">;</span></pre>
+<p>Destroy this contract object. </p>
+</li>
+</ol></div>
+</div>
+<div class="refsect2">
+<a name="id967895"></a><h3>
+<a name="id433500-bb"></a><code class="computeroutput">constructor</code> public member functions</h3>
+<div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem">
+<pre class="literallayout"><span class="keyword">void</span> <a name="id433504-bb"></a><span class="identifier">call</span><span class="special">(</span><span class="identifier">__MaybeCvClassPointer__</span> object<span class="special">,</span> <span class="identifier">ArgumentType1</span> argument1<span class="special">,</span> <span class="special">...</span><span class="special">,</span>
+ <span class="identifier">ArgumetnTypeN</span> argumentN<span class="special">)</span><span class="special">;</span></pre>
+<p>Check the contract and executes the member function body.</p>
+<p>Refer to the <code class="computeroutput"><code class="computeroutput"><a class="link" href="nonstatic_member_function.html" title="Class template nonstatic_member_function">contract::nonstatic_member_function</a></code></code> documentation.</p>
+<p>Accordingly with <code class="computeroutput">F</code>, the <code class="computeroutput">call()</code> function always returns <code class="computeroutput">void</code>. </p>
+</li></ol></div>
+</div>
+</div>
+</div>
+<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
+<td align="left"></td>
+<td align="right"><div class="copyright-footer">Copyright &#169; 2009, 2010 Lorenzo Caminiti<p>
+ Distributed under the Contract++ Software License, Version 1.0 (see accompanying
+ file LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="../CONTRACT_CONFIG_MAX_MULTIPLE_INHERITANCE.html"><img src="../images/prev.png" alt="Prev"></a><a accesskey="u" href="../reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.constructor_hpp"><img src="../images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../images/home.png" alt="Home"></a><a accesskey="n" href="../CONTRACT_CHECK_BLOCK_INVARIANT.html"><img src="../images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>

Added: sandbox/contract/libs/contract/doc/html/contract/contract_failed_handler.html
==============================================================================
--- (empty file)
+++ sandbox/contract/libs/contract/doc/html/contract/contract_failed_handler.html 2011-06-28 20:54:41 EDT (Tue, 28 Jun 2011)
@@ -0,0 +1,64 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
+<title>Type definition contract_failed_handler</title>
+<link rel="stylesheet" href="../doc/html/boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
+<link rel="home" href="../index.html" title="Contract++ 0.3.490">
+<link rel="up" href="../reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.assert_hpp" title="Header &lt;E:/sandbox/contractpp/trunk/doc/qbk/src/contract/assert.hpp&gt;">
+<link rel="prev" href="failure.html" title="Class failure">
+<link rel="next" href="set_block_invariant_failed.html" title="Function set_block_invariant_failed">
+</head>
+<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
+<table cellpadding="2" width="100%"><tr><td valign="top"></td></tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="failure.html"><img src="../images/prev.png" alt="Prev"></a><a accesskey="u" href="../reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.assert_hpp"><img src="../images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../images/home.png" alt="Home"></a><a accesskey="n" href="set_block_invariant_failed.html"><img src="../images/next.png" alt="Next"></a>
+</div>
+<div class="refentry">
+<a name="contract.contract_failed_handler"></a><div class="titlepage"></div>
+<div class="refnamediv">
+<h2><span class="refentrytitle">Type definition contract_failed_handler</span></h2>
+<p>contract_failed_handler</p>
+</div>
+<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
+<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="comment">// In header: &lt;<a class="link" href="../reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.assert_hpp" title="Header &lt;E:/sandbox/contractpp/trunk/doc/qbk/src/contract/assert.hpp&gt;">E:/sandbox/contractpp/trunk/doc/qbk/src/contract/assert.hpp</a>&gt;
+
+</span>
+<span class="keyword">typedef</span> <span class="identifier">__ContractFailedHandler__</span> <span class="identifier">contract_failed_handler</span><span class="special">;</span></pre></div>
+<div class="refsect1">
+<a name="id960196"></a><h2>Description</h2>
+<p>Function pointer type of the contract condition failure handler functions.</p>
+<p>Where the function pointer type __ContractFailedHandler__ is defined as follows: </p>
+<pre class="programlisting"> <span class="keyword">typedef</span> <span class="keyword">void</span> <span class="special">(</span><span class="special">*</span> <span class="identifier">contract_failed_handler</span><span class="special">)</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">from</span><span class="special">&amp;</span> <span class="identifier">where</span><span class="special">)</span><span class="special">;</span>
+</pre>
+<p><span class="bold"><strong>Parameters:</strong></span> </p>
+<div class="informaltable"><table class="table">
+<colgroup>
+<col>
+<col>
+</colgroup>
+<tbody><tr>
+<td><span class="bold"><strong><code class="computeroutput">where</code></strong></span></td>
+<td>The source that found the condition failure. This is useful for example to program failure handlers that throw exceptions in general but never from within destructors. </td>
+</tr></tbody>
+</table></div>
+<p>
+</p>
+<p><span class="bold"><strong>See:</strong></span> Throw on Failure annex for an example. </p>
+</div>
+</div>
+<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
+<td align="left"></td>
+<td align="right"><div class="copyright-footer">Copyright &#169; 2009, 2010 Lorenzo Caminiti<p>
+ Distributed under the Contract++ Software License, Version 1.0 (see accompanying
+ file LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="failure.html"><img src="../images/prev.png" alt="Prev"></a><a accesskey="u" href="../reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.assert_hpp"><img src="../images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../images/home.png" alt="Home"></a><a accesskey="n" href="set_block_invariant_failed.html"><img src="../images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>

Added: sandbox/contract/libs/contract/doc/html/contract/copy.html
==============================================================================
--- (empty file)
+++ sandbox/contract/libs/contract/doc/html/contract/copy.html 2011-06-28 20:54:41 EDT (Tue, 28 Jun 2011)
@@ -0,0 +1,177 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
+<title>Class template copy</title>
+<link rel="stylesheet" href="../doc/html/boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
+<link rel="home" href="../index.html" title="Contract++ 0.3.490">
+<link rel="up" href="../reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.old_hpp" title="Header &lt;E:/sandbox/contractpp/trunk/doc/qbk/src/contract/old.hpp&gt;">
+<link rel="prev" href="copyable.html" title="Class template copyable">
+<link rel="next" href="../CONTRACT_OLDOF.html" title="Macro CONTRACT_OLDOF">
+</head>
+<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
+<table cellpadding="2" width="100%"><tr><td valign="top"></td></tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="copyable.html"><img src="../images/prev.png" alt="Prev"></a><a accesskey="u" href="../reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.old_hpp"><img src="../images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../images/home.png" alt="Home"></a><a accesskey="n" href="../CONTRACT_OLDOF.html"><img src="../images/next.png" alt="Next"></a>
+</div>
+<div class="refentry">
+<a name="contract.copy"></a><div class="titlepage"></div>
+<div class="refnamediv">
+<h2><span class="refentrytitle">Class template copy</span></h2>
+<p>contract::copy</p>
+</div>
+<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
+<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="comment">// In header: &lt;<a class="link" href="../reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.old_hpp" title="Header &lt;E:/sandbox/contractpp/trunk/doc/qbk/src/contract/old.hpp&gt;">E:/sandbox/contractpp/trunk/doc/qbk/src/contract/old.hpp</a>&gt;
+
+</span><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> T<span class="special">&gt;</span>
+<span class="keyword">class</span> <a class="link" href="copy.html" title="Class template copy">copy</a> <span class="special">{</span>
+<span class="keyword">public</span><span class="special">:</span>
+ <span class="comment">// <a class="link" href="copy.html#contract.copyconstruct-copy-destruct">construct/copy/destruct</a></span>
+ <a class="link" href="copy.html#id438174-bb"><span class="identifier">copy</span></a><span class="special">(</span><span class="identifier">__ConstRef__</span><span class="special">)</span><span class="special">;</span>
+
+ <span class="comment">// <a class="link" href="copy.html#contract.copypublic-data-members">public data members</a></span>
+ <span class="identifier">__ConstType__</span> <a class="link" href="copy.html#contract.copy.value"><span class="identifier">value</span></a><span class="special">;</span>
+<span class="special">}</span><span class="special">;</span></pre></div>
+<div class="refsect1">
+<a name="id977573"></a><h2>Description</h2>
+<p>Copy wrapper used by the library to make the actual copy of variables for which old values are needed in postconditions.</p>
+<p><span class="bold"><strong>Parameters:</strong></span> </p>
+<div class="informaltable"><table class="table">
+<colgroup>
+<col>
+<col>
+</colgroup>
+<tbody><tr>
+<td><span class="bold"><strong><code class="computeroutput">T</code></strong></span></td>
+<td>Type of the object being copied. </td>
+</tr></tbody>
+</table></div>
+<p>
+</p>
+<p><span class="bold"><strong>Note:</strong></span> Under most circumstances programmers do <span class="bold"><strong>not</strong></span> need to use this class which is usually just used internally by the library.</p>
+<p>Specifically, if the copied type <code class="computeroutput">T</code> already has a public constant-correct copy constructor then the <code class="computeroutput"><a class="link" href="copy.html" title="Class template copy">contract::copy</a></code> template will use such a constructor by default and programmers do not need to define any specialization of the <code class="computeroutput"><a class="link" href="copy.html" title="Class template copy">contract::copy</a></code> template. </p>
+<pre class="programlisting"> <span class="keyword">class</span> <span class="identifier">T</span> <span class="special">{</span>
+ <span class="keyword">public</span><span class="special">:</span>
+ <span class="identifier">T</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">T</span><span class="special">&amp;</span> <span class="identifier">source</span><span class="special">)</span><span class="special">;</span> <span class="comment">// Public constant-correct copy constructor.</span>
+
+ <span class="special">...</span>
+ <span class="special">}</span><span class="special">;</span>
+</pre>
+<p> The constructor needs to be public for the library to access it and it needs to be contract-correct for the library to use it while still ensuring the contract-correctness of the contract checking code.</p>
+<p>However, the <code class="computeroutput"><a class="link" href="copy.html" title="Class template copy">contract::copy</a></code> template can be specialized by programmers to expose a non-public constant-correct copy constructor to the library via friendship: </p>
+<pre class="programlisting"> <span class="keyword">class</span> <span class="identifier">x</span> <span class="special">{</span>
+ <span class="special">...</span> <span class="comment">// User class with no public copy constructor.</span>
+
+ <span class="keyword">private</span><span class="special">:</span>
+ <span class="comment">// Only the library can access this copy constructor via friendship.</span>
+ <span class="keyword">friend</span> <span class="keyword">class</span> <a class="link" href="copy.html" title="Class template copy">contract::copy</a><span class="special">&lt;</span><span class="identifier">x</span><span class="special">&gt;</span><span class="special">;</span>
+ <span class="identifier">x</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">x</span><span class="special">*</span> <span class="identifier">source</span><span class="special">)</span><span class="special">;</span> <span class="comment">// Constant-correct (private) copy constructor.</span>
+ <span class="special">}</span><span class="special">;</span>
+</pre>
+<p>Furthermore, programmers can specialize the <code class="computeroutput"><a class="link" href="copy.html" title="Class template copy">contract::copy</a></code> template for a user defined type in order to relax the library requirement of an accessible constant-correct copy constructor all together (it is recommended <span class="bold"><strong>not</strong></span> to do this unless strictly necessary). </p>
+<pre class="programlisting"> <span class="keyword">class</span> <span class="identifier">y</span><span class="special">:</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">noncopyable</span> <span class="special">{</span> <span class="comment">// User class with no copy constructor at all.</span>
+ <span class="comment">// Self backup copy maintained by the class itself.</span>
+ <span class="identifier">y</span> <span class="identifier">backup_copy</span><span class="special">;</span> <span class="comment">// Use this as the old value.</span>
+
+ <span class="special">...</span>
+ <span class="special">}</span><span class="special">;</span>
+
+ <span class="keyword">namespace</span> <span class="identifier">contract</span> <span class="special">{</span>
+
+ <span class="comment">// Specialization to handle y old value without copying it.</span>
+ <span class="keyword">template</span><span class="special">&lt;</span><span class="special">&gt;</span>
+ <span class="keyword">class</span> <span class="identifier">copy</span><span class="special">&lt;</span><span class="identifier">y</span><span class="special">&gt;</span> <span class="special">{</span>
+ <span class="keyword">public</span><span class="special">:</span>
+ <span class="comment">// It must declare a member variable named `value`.</span>
+ <span class="keyword">const</span> <span class="identifier">y</span><span class="special">&amp;</span> <span class="identifier">value</span><span class="special">;</span> <span class="comment">// Maintains constant-correctness by using const member.</span>
+
+ <span class="comment">// It must defined this copy constructor. It must maintains</span>
+ <span class="comment">// constant-correctness taking a constant reference to `source`.</span>
+ <span class="identifier">copy</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">y</span><span class="special">&amp;</span> <span class="identifier">source</span><span class="special">)</span><span class="special">:</span>
+ <span class="comment">// This does not copy `source` (`value` is a reference).</span>
+ <span class="comment">// Instead it uses its `source` existing backup copy.</span>
+ <span class="identifier">value</span><span class="special">(</span><span class="identifier">source</span><span class="special">.</span><span class="identifier">backup_copy</span><span class="special">)</span> <span class="special">{</span><span class="special">}</span>
+ <span class="special">}</span><span class="special">;</span>
+
+ <span class="special">}</span> <span class="comment">// namespace</span>
+</pre>
+<p>The <code class="computeroutput"><a class="link" href="copy.html" title="Class template copy">contract::copy</a></code> template can also be specialized to alter the copy semantics for a type (it is recommended <span class="bold"><strong>not</strong></span> to do this unless strictly necessary). For example, by default a pointer to a double number <code class="computeroutput">double*</code> is copied by copying the pointer value and not by copying the pointed number (this is the usual C++ copy semantic for pointers). The following specialization of <code class="computeroutput"><a class="link" href="copy.html" title="Class template copy">contract::copy</a></code> copies the pointed number instead of the pointer value for postcondition old values of argument of type <code class="computeroutput">double*</code>. </p>
+<pre class="programlisting"> <span class="keyword">namespace</span> <span class="identifier">contract</span> <span class="special">{</span>
+
+ <span class="keyword">template</span><span class="special">&lt;</span><span class="special">&gt;</span>
+ <span class="keyword">class</span> <span class="identifier">copy</span><span class="special">&lt;</span><span class="keyword">double</span><span class="special">*</span><span class="special">&gt;</span> <span class="special">{</span>
+ <span class="keyword">private</span><span class="special">:</span>
+ <span class="keyword">double</span> <span class="identifier">number_</span><span class="special">;</span> <span class="comment">// Copied pointed number value.</span>
+ <span class="keyword">public</span><span class="special">:</span>
+ <span class="keyword">const</span> <span class="keyword">double</span><span class="special">*</span> <span class="identifier">value</span><span class="special">;</span> <span class="comment">// Pointer to number_.</span>
+
+ <span class="identifier">copy</span><span class="special">(</span><span class="keyword">const</span> <span class="keyword">double</span><span class="special">*</span> <span class="identifier">number_ptr</span><span class="special">)</span><span class="special">:</span> <span class="identifier">number_</span><span class="special">(</span><span class="special">)</span><span class="special">,</span> <span class="identifier">value</span><span class="special">(</span><span class="special">&amp;</span><span class="identifier">number_</span><span class="special">)</span> <span class="special">{</span>
+ <span class="comment">// Check pointer is valid.</span>
+ <span class="keyword">if</span> <span class="special">(</span><span class="special">!</span><span class="identifier">number_ptr</span><span class="special">)</span> <span class="keyword">throw</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">logic_error</span><span class="special">(</span><span class="string">"Invalid number pointer"</span><span class="special">)</span><span class="special">;</span>
+ <span class="identifier">number_</span> <span class="special">=</span> <span class="special">*</span><span class="identifier">number_ptr</span><span class="special">;</span> <span class="comment">// Copy the *pointed* number.</span>
+ <span class="special">}</span>
+ <span class="special">}</span><span class="special">;</span>
+
+ <span class="special">}</span> <span class="comment">// namespace</span>
+</pre>
+<p>See also the Examples section for a concrete example that specializes <code class="computeroutput"><a class="link" href="copy.html" title="Class template copy">contract::copy</a></code> to relax the accessible constant-correct constructor requirement. </p>
+<div class="refsect2">
+<a name="id978800"></a><h3>
+<a name="contract.copyconstruct-copy-destruct"></a><code class="computeroutput">copy</code>
+ public
+ construct/copy/destruct</h3>
+<div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem">
+<pre class="literallayout"><a name="id438174-bb"></a><span class="identifier">copy</span><span class="special">(</span><span class="identifier">__ConstRef__</span> source<span class="special">)</span><span class="special">;</span></pre>
+<p>Constructor which copies the specified object.</p>
+<p>The copy is done by constructing the member variable `value` using an accessible constant-correct copy constructor for <code class="computeroutput">T</code> (which must be available otherwise the library will generate a compile-time error).</p>
+<p><span class="bold"><strong>Note:</strong></span> Source is a constant reference so to ensure contract checking constant-correctness (correctly, this constraint cannot be relaxed not even by specializing this class template).</p>
+<p>The constant reference type is defined as follows: </p>
+<pre class="programlisting"> typedef typename boost::add_reference&lt;const_type&gt;::type __ConstRef__;
+</pre>
+<p><span class="bold"><strong>Parameters:</strong></span> </p>
+<div class="informaltable"><table class="table">
+<colgroup>
+<col>
+<col>
+</colgroup>
+<tbody><tr>
+<td><span class="bold"><strong><code class="computeroutput">source</code></strong></span></td>
+<td>The source object to be copied into the <code class="computeroutput">value</code> member variable. </td>
+</tr></tbody>
+</table></div>
+<p>
+</p>
+</li></ol></div>
+</div>
+<div class="refsect2">
+<a name="id978938"></a><h3>
+<a name="contract.copypublic-data-members"></a><code class="computeroutput">copy</code>
+ public
+ public data members</h3>
+<div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem">
+<pre class="literallayout"><span class="identifier">__ConstType__</span> <a name="contract.copy.value"></a><span class="identifier">value</span><span class="special">;</span></pre>
+<p>The copied value (used as the old value in postconditions).</p>
+<p>The variable type is defined as follows: </p>
+<pre class="programlisting"> <span class="keyword">typedef</span> <span class="keyword">typename</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">add_const</span><span class="special">&lt;</span><span class="keyword">typename</span>
+ <span class="identifier">boost</span><span class="special">::</span><span class="identifier">remove_reference</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">&gt;</span><span class="special">::</span><span class="identifier">type</span><span class="special">&gt;</span><span class="special">::</span><span class="identifier">type</span> <span class="identifier">__ConstType__</span><span class="special">;</span>
+</pre>
+<p> </p>
+</li></ol></div>
+</div>
+</div>
+</div>
+<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
+<td align="left"></td>
+<td align="right"><div class="copyright-footer">Copyright &#169; 2009, 2010 Lorenzo Caminiti<p>
+ Distributed under the Contract++ Software License, Version 1.0 (see accompanying
+ file LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="copyable.html"><img src="../images/prev.png" alt="Prev"></a><a accesskey="u" href="../reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.old_hpp"><img src="../images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../images/home.png" alt="Home"></a><a accesskey="n" href="../CONTRACT_OLDOF.html"><img src="../images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>

Added: sandbox/contract/libs/contract/doc/html/contract/copyable.html
==============================================================================
--- (empty file)
+++ sandbox/contract/libs/contract/doc/html/contract/copyable.html 2011-06-28 20:54:41 EDT (Tue, 28 Jun 2011)
@@ -0,0 +1,75 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
+<title>Class template copyable</title>
+<link rel="stylesheet" href="../doc/html/boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
+<link rel="home" href="../index.html" title="Contract++ 0.3.490">
+<link rel="up" href="../reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.old_hpp" title="Header &lt;E:/sandbox/contractpp/trunk/doc/qbk/src/contract/old.hpp&gt;">
+<link rel="prev" href="nonstatic_member_function.html" title="Class template nonstatic_member_function">
+<link rel="next" href="copy.html" title="Class template copy">
+</head>
+<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
+<table cellpadding="2" width="100%"><tr><td valign="top"></td></tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="nonstatic_member_function.html"><img src="../images/prev.png" alt="Prev"></a><a accesskey="u" href="../reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.old_hpp"><img src="../images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../images/home.png" alt="Home"></a><a accesskey="n" href="copy.html"><img src="../images/next.png" alt="Next"></a>
+</div>
+<div class="refentry">
+<a name="contract.copyable"></a><div class="titlepage"></div>
+<div class="refnamediv">
+<h2><span class="refentrytitle">Class template copyable</span></h2>
+<p>contract::copyable</p>
+</div>
+<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
+<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="comment">// In header: &lt;<a class="link" href="../reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.old_hpp" title="Header &lt;E:/sandbox/contractpp/trunk/doc/qbk/src/contract/old.hpp&gt;">E:/sandbox/contractpp/trunk/doc/qbk/src/contract/old.hpp</a>&gt;
+
+</span><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> T<span class="special">&gt;</span>
+<span class="keyword">class</span> <a class="link" href="copyable.html" title="Class template copyable">copyable</a> <span class="special">{</span>
+<span class="special">}</span><span class="special">;</span></pre></div>
+<div class="refsect1">
+<a name="id977088"></a><h2>Description</h2>
+<p>Tag the specified type <code class="computeroutput">T</code> copyable.</p>
+<p>In general, you should tag a type copyable <span class="bold"><strong>only</strong></span> when the related variable old value (before body execution) is really needed in postconditions because:</p>
+<div class="orderedlist"><ol class="orderedlist" type="1">
+<li class="listitem"><p>The correspondent variable value will be copied before body execution adding run-time overhead. The library performs the extra copy to support old values in postconditions only for variables of types tagged copyable and only when the <code class="computeroutput">CONTRACT_CHECK_POSTCONDITION</code> macro is defined.</p></li>
+<li class="listitem">
+<p>A type tagged copyable has the extra requirement that it must define an accessible constant-correct copy constructor (otherwise the library will generate a compile-time error). The copy constructor is constant-correct when it accesses the copied value via a constant reference argument (this way the copied value cannot be mistakenly modified while it is being copied to check contracts): </p>
+<pre class="programlisting"> <span class="identifier">T</span><span class="special">::</span><span class="identifier">T</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">T</span><span class="special">&amp;</span> <span class="identifier">source</span><span class="special">)</span> <span class="special">{</span> <span class="special">...</span> <span class="special">}</span> <span class="comment">// Must be accessible and construct from a const&amp;.</span>
+</pre>
+<p> See <code class="computeroutput"><a class="link" href="copy.html" title="Class template copy">contract::copy</a></code> to relax this requirement.</p>
+</li>
+</ol></div>
+<p>
+</p>
+<p><span class="bold"><strong>Parameters:</strong></span> </p>
+<div class="informaltable"><table class="table">
+<colgroup>
+<col>
+<col>
+</colgroup>
+<tbody><tr>
+<td><span class="bold"><strong><code class="computeroutput">T</code></strong></span></td>
+<td>The type to be tagged. The <span class="bold"><strong>entire</strong></span> type with eventual <code class="computeroutput">const</code>, <code class="computeroutput">&amp;</code>, <code class="computeroutput">*</code>, etc qualifier should be tagged copyable. For example, if the type is <code class="computeroutput">const int&amp;</code> then <code class="computeroutput">contract::copyable&lt;const int&amp;&gt;</code> should be used (and not <code class="computeroutput">const contract::copyable&lt;int&gt;&amp;</code>). </td>
+</tr></tbody>
+</table></div>
+<p>
+</p>
+<p><span class="bold"><strong>Note:</strong></span> When using the contract macros, <code class="computeroutput">(copyable)(T)</code> is used instead of <code class="computeroutput">contract::copyable&lt;T&gt;</code> to tag the type <code class="computeroutput">T</code> copyable in the macro <code class="computeroutput">sequence</code> parameter.</p>
+<p><span class="bold"><strong>See:</strong></span> <code class="computeroutput">CONTRACT_OLDOF()</code>, <code class="computeroutput"><a class="link" href="copy.html" title="Class template copy">contract::copy</a></code> </p>
+</div>
+</div>
+<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
+<td align="left"></td>
+<td align="right"><div class="copyright-footer">Copyright &#169; 2009, 2010 Lorenzo Caminiti<p>
+ Distributed under the Contract++ Software License, Version 1.0 (see accompanying
+ file LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="nonstatic_member_function.html"><img src="../images/prev.png" alt="Prev"></a><a accesskey="u" href="../reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.old_hpp"><img src="../images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../images/home.png" alt="Home"></a><a accesskey="n" href="copy.html"><img src="../images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>

Added: sandbox/contract/libs/contract/doc/html/contract/destructor.html
==============================================================================
--- (empty file)
+++ sandbox/contract/libs/contract/doc/html/contract/destructor.html 2011-06-28 20:54:41 EDT (Tue, 28 Jun 2011)
@@ -0,0 +1,130 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
+<title>Class template destructor</title>
+<link rel="stylesheet" href="../doc/html/boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
+<link rel="home" href="../index.html" title="Contract++ 0.3.490">
+<link rel="up" href="../reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.destructor_hpp" title="Header &lt;E:/sandbox/contractpp/trunk/doc/qbk/src/contract/destructor.hpp&gt;">
+<link rel="prev" href="../CONTRACT_CHECK_POSTCONDITION.html" title="Macro CONTRACT_CHECK_POSTCONDITION">
+<link rel="next" href="from.html" title="Type from">
+</head>
+<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
+<table cellpadding="2" width="100%"><tr><td valign="top"></td></tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="../CONTRACT_CHECK_POSTCONDITION.html"><img src="../images/prev.png" alt="Prev"></a><a accesskey="u" href="../reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.destructor_hpp"><img src="../images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../images/home.png" alt="Home"></a><a accesskey="n" href="from.html"><img src="../images/next.png" alt="Next"></a>
+</div>
+<div class="refentry">
+<a name="contract.destructor"></a><div class="titlepage"></div>
+<div class="refnamediv">
+<h2><span class="refentrytitle">Class template destructor</span></h2>
+<p>contract::destructor</p>
+</div>
+<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
+<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="comment">// In header: &lt;<a class="link" href="../reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.destructor_hpp" title="Header &lt;E:/sandbox/contractpp/trunk/doc/qbk/src/contract/destructor.hpp&gt;">E:/sandbox/contractpp/trunk/doc/qbk/src/contract/destructor.hpp</a>&gt;
+
+</span><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> F<span class="special">&gt;</span>
+<span class="keyword">class</span> <a class="link" href="destructor.html" title="Class template destructor">destructor</a> <span class="special">:</span> <span class="keyword">public</span> <span class="identifier">contract</span><span class="special">::</span><span class="identifier">nonstatic_member_function</span><span class="special">&lt;</span> <span class="identifier">F</span> <span class="special">&gt;</span> <span class="special">{</span>
+<span class="keyword">public</span><span class="special">:</span>
+ <span class="comment">// <a class="link" href="destructor.html#contract.destructorconstruct-copy-destruct">construct/copy/destruct</a></span>
+ <a class="link" href="destructor.html#id434205-bb"><span class="identifier">destructor</span></a><span class="special">(</span><span class="identifier">__BodyFunctionPointer__</span><span class="special">)</span><span class="special">;</span>
+ <a class="link" href="destructor.html#id434274-bb"><span class="special">~</span><span class="identifier">destructor</span></a><span class="special">(</span><span class="special">)</span><span class="special">;</span>
+
+ <span class="comment">// <a class="link" href="destructor.html#id434157-bb">public member functions</a></span>
+ <span class="keyword">void</span> <a class="link" href="destructor.html#id434161-bb"><span class="identifier">call</span></a><span class="special">(</span><span class="identifier">__MaybeCvClassPointer__</span><span class="special">)</span><span class="special">;</span>
+<span class="special">}</span><span class="special">;</span></pre></div>
+<div class="refsect1">
+<a name="id968926"></a><h2>Description</h2>
+<p>Class template used to write contracts for destructors.</p>
+<p><span class="bold"><strong>Note:</strong></span> Only the differences between this class and the <code class="computeroutput"><a class="link" href="nonstatic_member_function.html" title="Class template nonstatic_member_function">contract::nonstatic_member_function</a></code> class are documented here. Read the <code class="computeroutput"><a class="link" href="nonstatic_member_function.html" title="Class template nonstatic_member_function">contract::nonstatic_member_function</a></code> documentation first.</p>
+<p>The <code class="computeroutput">CONTRACT_DESTRUCTOR()</code> macro expands to code that uses this class template (see the Without the Macros section) -- whenever possible, use the macro instead of using this class template directly. Rarely, it might be needed to use this class template directly to implement workarounds for compilers that do not fully comply with the ISO C++ standard.</p>
+<p><span class="bold"><strong>Parameters:</strong></span> </p>
+<div class="informaltable"><table class="table">
+<colgroup>
+<col>
+<col>
+</colgroup>
+<tbody><tr>
+<td><span class="bold"><strong><code class="computeroutput">F</code></strong></span></td>
+<td>The function type for the destructor being contracted. </td>
+</tr></tbody>
+</table></div>
+<p>
+</p>
+<p>Base contract classes cannot be specified because destructors do not directly subcontract (C++ object destruction mechanism will automatically invoke base class contracts when they are present).</p>
+<p>The function type <code class="computeroutput">F</code> must be specified as follows: </p>
+<pre class="programlisting"> <span class="keyword">void</span> <span class="special">(</span><span class="identifier">ClassType</span><span class="special">::</span><span class="special">*</span><span class="special">)</span><span class="special">(</span><span class="special">)</span>
+</pre>
+<p> Note: </p>
+<div class="itemizedlist"><ul class="itemizedlist" type="disc">
+<li class="listitem"><p>The result type is always <code class="computeroutput">void</code> because destructors return no value. </p></li>
+<li class="listitem"><p><code class="computeroutput">ClassType</code> is never <code class="computeroutput">const</code> because destructors can never be constant members (as they modify the object by destructing it). </p></li>
+<li class="listitem"><p><code class="computeroutput">ClassType</code> cannot be tagged <code class="computeroutput"><a class="link" href="copyable.html" title="Class template copyable">contract::copyable</a></code> because there is no object before destructor body execution (it has not been destructed yet) -- the library will generate a compile-time error otherwise. </p></li>
+<li class="listitem"><p>There is no function argument type because destructors take no argument.</p></li>
+</ul></div>
+<p>
+<span class="bold"><strong>See:</strong></span> Without the Macros section, <code class="computeroutput"><a class="link" href="nonstatic_member_function.html" title="Class template nonstatic_member_function">contract::nonstatic_member_function</a></code> </p>
+<div class="refsect2">
+<a name="id969164"></a><h3>
+<a name="contract.destructorconstruct-copy-destruct"></a><code class="computeroutput">destructor</code>
+ public
+ construct/copy/destruct</h3>
+<div class="orderedlist"><ol class="orderedlist" type="1">
+<li class="listitem">
+<pre class="literallayout"><a name="id434205-bb"></a><span class="identifier">destructor</span><span class="special">(</span><span class="identifier">__BodyFunctionPointer__</span> body_function<span class="special">)</span><span class="special">;</span></pre>
+<p>Construct this contract object using the specified body.</p>
+<p>No precondition and no postcondition function is specified (destructors only check class invariants). This is because destructors have no arguments so there are no preconditions, in addition there is no object after destructor body execution so there are no postconditions (see Tutorial section for more information).</p>
+<p><span class="bold"><strong>Parameters:</strong></span> </p>
+<div class="informaltable"><table class="table">
+<colgroup>
+<col>
+<col>
+</colgroup>
+<tbody><tr>
+<td><span class="bold"><strong><code class="computeroutput">body_function</code></strong></span></td>
+<td>A pointer to the function executing the body. </td>
+</tr></tbody>
+</table></div>
+<p>
+</p>
+<p>The body function pointer type is defined as follows: </p>
+<pre class="programlisting"> typedef void (ClassType::* __BodyFunctionPointer__)();
+</pre>
+<p> </p>
+<div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>Destructor body takes no argument. </p></li></ul></div>
+<p>
+</p>
+</li>
+<li class="listitem">
+<pre class="literallayout"><a name="id434274-bb"></a><span class="special">~</span><span class="identifier">destructor</span><span class="special">(</span><span class="special">)</span><span class="special">;</span></pre>
+<p>Destroy this contract object. </p>
+</li>
+</ol></div>
+</div>
+<div class="refsect2">
+<a name="id969330"></a><h3>
+<a name="id434157-bb"></a><code class="computeroutput">destructor</code> public member functions</h3>
+<div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem">
+<pre class="literallayout"><span class="keyword">void</span> <a name="id434161-bb"></a><span class="identifier">call</span><span class="special">(</span><span class="identifier">__MaybeCvClassPointer__</span> object<span class="special">)</span><span class="special">;</span></pre>
+<p>Check the contract and executes the member function body.</p>
+<p>Refer to the <code class="computeroutput"><code class="computeroutput"><a class="link" href="nonstatic_member_function.html" title="Class template nonstatic_member_function">contract::nonstatic_member_function</a></code></code> documentation.</p>
+<p>Accordingly with <code class="computeroutput">F</code>, the <code class="computeroutput">call()</code> function always returns void and it takes no argument. </p>
+</li></ol></div>
+</div>
+</div>
+</div>
+<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
+<td align="left"></td>
+<td align="right"><div class="copyright-footer">Copyright &#169; 2009, 2010 Lorenzo Caminiti<p>
+ Distributed under the Contract++ Software License, Version 1.0 (see accompanying
+ file LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="../CONTRACT_CHECK_POSTCONDITION.html"><img src="../images/prev.png" alt="Prev"></a><a accesskey="u" href="../reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.destructor_hpp"><img src="../images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../images/home.png" alt="Home"></a><a accesskey="n" href="from.html"><img src="../images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>

Added: sandbox/contract/libs/contract/doc/html/contract/failure.html
==============================================================================
--- (empty file)
+++ sandbox/contract/libs/contract/doc/html/contract/failure.html 2011-06-28 20:54:41 EDT (Tue, 28 Jun 2011)
@@ -0,0 +1,140 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
+<title>Class failure</title>
+<link rel="stylesheet" href="../doc/html/boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
+<link rel="home" href="../index.html" title="Contract++ 0.3.490">
+<link rel="up" href="../reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.assert_hpp" title="Header &lt;E:/sandbox/contractpp/trunk/doc/qbk/src/contract/assert.hpp&gt;">
+<link rel="prev" href="../reference.html" title="Reference">
+<link rel="next" href="contract_failed_handler.html" title="Type definition contract_failed_handler">
+</head>
+<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
+<table cellpadding="2" width="100%"><tr><td valign="top"></td></tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="../reference.html"><img src="../images/prev.png" alt="Prev"></a><a accesskey="u" href="../reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.assert_hpp"><img src="../images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../images/home.png" alt="Home"></a><a accesskey="n" href="contract_failed_handler.html"><img src="../images/next.png" alt="Next"></a>
+</div>
+<div class="refentry">
+<a name="contract.failure"></a><div class="titlepage"></div>
+<div class="refnamediv">
+<h2><span class="refentrytitle">Class failure</span></h2>
+<p>contract::failure</p>
+</div>
+<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
+<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="comment">// In header: &lt;<a class="link" href="../reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.assert_hpp" title="Header &lt;E:/sandbox/contractpp/trunk/doc/qbk/src/contract/assert.hpp&gt;">E:/sandbox/contractpp/trunk/doc/qbk/src/contract/assert.hpp</a>&gt;
+
+</span>
+<span class="keyword">class</span> <a class="link" href="failure.html" title="Class failure">failure</a> <span class="special">{</span>
+<span class="keyword">public</span><span class="special">:</span>
+ <span class="comment">// <a class="link" href="failure.html#contract.failureconstruct-copy-destruct">construct/copy/destruct</a></span>
+ <span class="keyword">explicit</span> <a class="link" href="failure.html#id427467-bb"><span class="identifier">failure</span></a><span class="special">(</span><span class="keyword">const</span> <span class="keyword">char</span> <span class="special">*</span><span class="special">,</span> <span class="keyword">const</span> <span class="keyword">unsigned</span> <span class="keyword">long</span> <span class="special">&amp;</span><span class="special">,</span> <span class="keyword">const</span> <span class="keyword">char</span> <span class="special">*</span> <span class="special">=</span> <span class="string">""</span><span class="special">)</span><span class="special">;</span>
+ <a class="link" href="failure.html#id263276-bb"><span class="identifier">failure</span></a><span class="special">(</span><span class="keyword">const</span> <a class="link" href="failure.html" title="Class failure">failure</a> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>
+ failure&amp; <a class="link" href="failure.html#id263293-bb"><span class="keyword">operator</span><span class="special">=</span></a><span class="special">(</span><span class="keyword">const</span> <a class="link" href="failure.html" title="Class failure">failure</a> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>
+ <a class="link" href="failure.html#id263309-bb"><span class="special">~</span><span class="identifier">failure</span></a><span class="special">(</span><span class="special">)</span><span class="special">;</span>
+
+ <span class="comment">// <a class="link" href="failure.html#id427395-bb">public member functions</a></span>
+ <span class="keyword">const</span> <span class="keyword">char</span> <span class="special">*</span> <a class="link" href="failure.html#id427399-bb"><span class="identifier">what</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
+ <span class="keyword">const</span> <span class="keyword">char</span> <span class="special">*</span> <a class="link" href="failure.html#id427422-bb"><span class="identifier">file</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
+ <span class="keyword">unsigned</span> <span class="keyword">long</span> <a class="link" href="failure.html#id427436-bb"><span class="identifier">line</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
+ <span class="keyword">const</span> <span class="keyword">char</span> <span class="special">*</span> <a class="link" href="failure.html#id427449-bb"><span class="identifier">description</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
+<span class="special">}</span><span class="special">;</span></pre></div>
+<div class="refsect1">
+<a name="id959300"></a><h2>Description</h2>
+<p>Default exception thrown when a contract condition is found to be false.</p>
+<p>It is recommended to assert contract conditions using the <code class="computeroutput">CONTRACT_ASSERT()</code> macro instead of throwing this exception directly.</p>
+<p>The library handles exceptions (any exception, not just this one) when thrown from within block invariants (plus loop variants), class invariants, preconditions, and postconditions invoking <code class="computeroutput">contract::block_invariant_failed()</code>, <code class="computeroutput">contract::class_invariant_failed()</code>, <code class="computeroutput">contract::precondition_failed()</code>, and <code class="computeroutput">contract::postcondition_failed()</code> respectively (see the Without the Macros section).</p>
+<p>Therefore, throwing this exception on a contract condition failure does <span class="bold"><strong>not</strong></span> imply that an exception will be thrown overall to handle the failure. It only implies that the correct contract failure handler function will be automatically invoked by the library (after checking eventual overridden contracts for subcontracting, etc). It is not possible to call the failure handler functions directly instead of throwing the exception because that will not allow the library to check overridden contracts when subcontracting. The failure handler functions will then decide the action to take (the default handlers provided by the library invoke <code class="computeroutput">std::terminate()</code> but programmers can redefine this behaviour using <code class="computeroutput">contract::set_block_invariant_failed()</code>, <code class="computeroutput">contract::set_class_invariant_failed()</code>, <code class="computeroutput">contract::set_precondition_failed()</code>, and <cod
e class="computeroutput">contract::set_postcondition_failed()</code>).</p>
+<p>The member functions of this class do not throw (their exception specification is <code class="computeroutput">thow()</code>) so they can be safely used when checking contracts in compliance with STL C++ exception safety requirements at all times.</p>
+<p><span class="bold"><strong>See:</strong></span> Without the Macros section. </p>
+<div class="refsect2">
+<a name="id959438"></a><h3>
+<a name="contract.failureconstruct-copy-destruct"></a><code class="computeroutput">failure</code>
+ public
+ construct/copy/destruct</h3>
+<div class="orderedlist"><ol class="orderedlist" type="1">
+<li class="listitem">
+<pre class="literallayout"><span class="keyword">explicit</span> <a name="id427467-bb"></a><span class="identifier">failure</span><span class="special">(</span><span class="keyword">const</span> <span class="keyword">char</span> <span class="special">*</span> file<span class="special">,</span> <span class="keyword">const</span> <span class="keyword">unsigned</span> <span class="keyword">long</span> <span class="special">&amp;</span> line<span class="special">,</span>
+ <span class="keyword">const</span> <span class="keyword">char</span> <span class="special">*</span> description <span class="special">=</span> <span class="string">""</span><span class="special">)</span><span class="special">;</span></pre>
+<p>Create a condition failure object.</p>
+<p>All the constructor parameters are used to provide more descriptive error messages in case of contract condition failure. At least the file and line number must be specified so to uniquely identify the point of the contract condition failure.</p>
+<p><span class="bold"><strong>Parameters:</strong></span> </p>
+<div class="informaltable"><table class="table">
+<colgroup>
+<col>
+<col>
+</colgroup>
+<tbody>
+<tr>
+<td><span class="bold"><strong><code class="computeroutput">file</code></strong></span></td>
+<td>The source code file containing the failed contract condition (use <code class="computeroutput">__FILE__</code>). </td>
+</tr>
+<tr>
+<td><span class="bold"><strong><code class="computeroutput">line</code></strong></span></td>
+<td>The source code line number containing the failed contract condition (use <code class="computeroutput">__LINE__</code>). </td>
+</tr>
+<tr>
+<td><span class="bold"><strong><code class="computeroutput">description</code></strong></span></td>
+<td>An optional human readable description of the contract condition failure (<code class="computeroutput">""</code> if not specified). </td>
+</tr>
+</tbody>
+</table></div>
+<p>
+</p>
+</li>
+<li class="listitem">
+<pre class="literallayout"><a name="id263276-bb"></a><span class="identifier">failure</span><span class="special">(</span><span class="keyword">const</span> <a class="link" href="failure.html" title="Class failure">failure</a> <span class="special">&amp;</span> source<span class="special">)</span><span class="special">;</span></pre>
+<p>Create a condition failure object copying it from the specified one. </p>
+</li>
+<li class="listitem">
+<pre class="literallayout">failure&amp; <a name="id263293-bb"></a><span class="keyword">operator</span><span class="special">=</span><span class="special">(</span><span class="keyword">const</span> <a class="link" href="failure.html" title="Class failure">failure</a> <span class="special">&amp;</span> source<span class="special">)</span><span class="special">;</span></pre>
+<p>Copy a condition failure from the specified one. </p>
+</li>
+<li class="listitem">
+<pre class="literallayout"><a name="id263309-bb"></a><span class="special">~</span><span class="identifier">failure</span><span class="special">(</span><span class="special">)</span><span class="special">;</span></pre>
+<p>Destroy the condition failure object. </p>
+</li>
+</ol></div>
+</div>
+<div class="refsect2">
+<a name="id959843"></a><h3>
+<a name="id427395-bb"></a><code class="computeroutput">failure</code> public member functions</h3>
+<div class="orderedlist"><ol class="orderedlist" type="1">
+<li class="listitem">
+<pre class="literallayout"><span class="keyword">const</span> <span class="keyword">char</span> <span class="special">*</span> <a name="id427399-bb"></a><span class="identifier">what</span><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre>
+<p>Return a human readable message explaining the nature of the condition failure.</p>
+<p><span class="bold"><strong>Returns:</strong></span> The actual message text is library implementation specific but it will contain the condition description, the file name, and the line number (when specified). For example, the returned message could look like this: </p>
+<pre class="programlisting"> contract "size increased by 1" failed at myvector.cpp:40
+</pre>
+<p> </p>
+</li>
+<li class="listitem">
+<pre class="literallayout"><span class="keyword">const</span> <span class="keyword">char</span> <span class="special">*</span> <a name="id427422-bb"></a><span class="identifier">file</span><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre>
+<p>Return the condition failure source file. </p>
+</li>
+<li class="listitem">
+<pre class="literallayout"><span class="keyword">unsigned</span> <span class="keyword">long</span> <a name="id427436-bb"></a><span class="identifier">line</span><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre>
+<p>Return the condition failure source line number. </p>
+</li>
+<li class="listitem">
+<pre class="literallayout"><span class="keyword">const</span> <span class="keyword">char</span> <span class="special">*</span> <a name="id427449-bb"></a><span class="identifier">description</span><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre>
+<p>Return the condition failure description (<code class="computeroutput">""</code> if not specified). </p>
+</li>
+</ol></div>
+</div>
+</div>
+</div>
+<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
+<td align="left"></td>
+<td align="right"><div class="copyright-footer">Copyright &#169; 2009, 2010 Lorenzo Caminiti<p>
+ Distributed under the Contract++ Software License, Version 1.0 (see accompanying
+ file LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="../reference.html"><img src="../images/prev.png" alt="Prev"></a><a accesskey="u" href="../reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.assert_hpp"><img src="../images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../images/home.png" alt="Home"></a><a accesskey="n" href="contract_failed_handler.html"><img src="../images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>

Added: sandbox/contract/libs/contract/doc/html/contract/from.html
==============================================================================
--- (empty file)
+++ sandbox/contract/libs/contract/doc/html/contract/from.html 2011-06-28 20:54:41 EDT (Tue, 28 Jun 2011)
@@ -0,0 +1,66 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
+<title>Type from</title>
+<link rel="stylesheet" href="../doc/html/boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
+<link rel="home" href="../index.html" title="Contract++ 0.3.490">
+<link rel="up" href="../reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.from_hpp" title="Header &lt;E:/sandbox/contractpp/trunk/doc/qbk/src/contract/from.hpp&gt;">
+<link rel="prev" href="destructor.html" title="Class template destructor">
+<link rel="next" href="../CONTRACT_INVARIANT.html" title="Macro CONTRACT_INVARIANT">
+</head>
+<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
+<table cellpadding="2" width="100%"><tr><td valign="top"></td></tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="destructor.html"><img src="../images/prev.png" alt="Prev"></a><a accesskey="u" href="../reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.from_hpp"><img src="../images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../images/home.png" alt="Home"></a><a accesskey="n" href="../CONTRACT_INVARIANT.html"><img src="../images/next.png" alt="Next"></a>
+</div>
+<div class="refentry">
+<a name="contract.from"></a><div class="titlepage"></div>
+<div class="refnamediv">
+<h2><span class="refentrytitle">Type from</span></h2>
+<p>contract::from</p>
+</div>
+<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
+<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="comment">// In header: &lt;<a class="link" href="../reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.from_hpp" title="Header &lt;E:/sandbox/contractpp/trunk/doc/qbk/src/contract/from.hpp&gt;">E:/sandbox/contractpp/trunk/doc/qbk/src/contract/from.hpp</a>&gt;
+
+</span>
+<span class="keyword">enum</span> <span class="identifier">from</span> <span class="special">{</span> <a class="link" href="from.html#contract.from.FROM_CONSTRUCTOR">FROM_CONSTRUCTOR</a>, <a class="link" href="from.html#contract.from.FROM_DESTRUCTOR">FROM_DESTRUCTOR</a>, <a class="link" href="from.html#contract.from.FROM_NONSTATIC_MEMBER_FUNCTION">FROM_NONSTATIC_MEMBER_FUNCTION</a>,
+ <a class="link" href="from.html#contract.from.FORM_STATIC_MEMBER_FUNCTION">FORM_STATIC_MEMBER_FUNCTION</a>, <a class="link" href="from.html#contract.from.FROM_NONMEMBER_FUNCTION">FROM_NONMEMBER_FUNCTION</a>, <a class="link" href="from.html#contract.from.FROM_BLOCK">FROM_BLOCK</a> <span class="special">}</span><span class="special">;</span></pre></div>
+<div class="refsect1">
+<a name="id969640"></a><h2>Description</h2>
+<p>Source that found the contract condition failure.</p>
+<p>For example, this is used in the Throw on Failure annex to ensure that destructors never throw to comply with C++ STL exception safety requirements.</p>
+<p>These failure sources are identified separately because they all have different contract checking semantics with respect to each other (see the Tutorial section).</p>
+<p><span class="bold"><strong>Warning:</strong></span> You must not assume any specific integer value for these enumerated values. Only use the enumerated values because the integer values they map to are library implementation specific and they could change in future revisions of the library.</p>
+<p><span class="bold"><strong>See:</strong></span> <code class="computeroutput">contract::contract_failed_handler</code> </p>
+<div class="variablelist"><dl>
+<dt><span class="term"><code class="computeroutput">FROM_CONSTRUCTOR</code><a name="contract.from.FROM_CONSTRUCTOR"></a></span></dt>
+<dd><p>Contract condition failed from a constructor. </p></dd>
+<dt><span class="term"><code class="computeroutput">FROM_DESTRUCTOR</code><a name="contract.from.FROM_DESTRUCTOR"></a></span></dt>
+<dd><p>Contract condition failed from a destructor. </p></dd>
+<dt><span class="term"><code class="computeroutput">FROM_NONSTATIC_MEMBER_FUNCTION</code><a name="contract.from.FROM_NONSTATIC_MEMBER_FUNCTION"></a></span></dt>
+<dd><p>Contract condition failed from a non-static member function. </p></dd>
+<dt><span class="term"><code class="computeroutput">FORM_STATIC_MEMBER_FUNCTION</code><a name="contract.from.FORM_STATIC_MEMBER_FUNCTION"></a></span></dt>
+<dd><p>Contract condition failed from a static member function. </p></dd>
+<dt><span class="term"><code class="computeroutput">FROM_NONMEMBER_FUNCTION</code><a name="contract.from.FROM_NONMEMBER_FUNCTION"></a></span></dt>
+<dd><p>Contract condition failed from a non-member function. </p></dd>
+<dt><span class="term"><code class="computeroutput">FROM_BLOCK</code><a name="contract.from.FROM_BLOCK"></a></span></dt>
+<dd><p>Contract condition failed from a code block. </p></dd>
+</dl></div>
+</div>
+</div>
+<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
+<td align="left"></td>
+<td align="right"><div class="copyright-footer">Copyright &#169; 2009, 2010 Lorenzo Caminiti<p>
+ Distributed under the Contract++ Software License, Version 1.0 (see accompanying
+ file LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="destructor.html"><img src="../images/prev.png" alt="Prev"></a><a accesskey="u" href="../reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.from_hpp"><img src="../images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../images/home.png" alt="Home"></a><a accesskey="n" href="../CONTRACT_INVARIANT.html"><img src="../images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>

Added: sandbox/contract/libs/contract/doc/html/contract/loop_variant_type.html
==============================================================================
--- (empty file)
+++ sandbox/contract/libs/contract/doc/html/contract/loop_variant_type.html 2011-06-28 20:54:41 EDT (Tue, 28 Jun 2011)
@@ -0,0 +1,57 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
+<title>Type definition loop_variant_type</title>
+<link rel="stylesheet" href="../doc/html/boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
+<link rel="home" href="../index.html" title="Contract++ 0.3.490">
+<link rel="up" href="../reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.block_hpp" title="Header &lt;E:/sandbox/contractpp/trunk/doc/qbk/src/contract/block.hpp&gt;">
+<link rel="prev" href="../CONTRACT_ASSERT_MSG.html" title="Macro CONTRACT_ASSERT_MSG">
+<link rel="next" href="../CONTRACT_ASSERT_BLOCK_INVARIANT.html" title="Macro CONTRACT_ASSERT_BLOCK_INVARIANT">
+</head>
+<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
+<table cellpadding="2" width="100%"><tr><td valign="top"></td></tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="../CONTRACT_ASSERT_MSG.html"><img src="../images/prev.png" alt="Prev"></a><a accesskey="u" href="../reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.block_hpp"><img src="../images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../images/home.png" alt="Home"></a><a accesskey="n" href="../CONTRACT_ASSERT_BLOCK_INVARIANT.html"><img src="../images/next.png" alt="Next"></a>
+</div>
+<div class="refentry">
+<a name="contract.loop_variant_type"></a><div class="titlepage"></div>
+<div class="refnamediv">
+<h2><span class="refentrytitle">Type definition loop_variant_type</span></h2>
+<p>loop_variant_type</p>
+</div>
+<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
+<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="comment">// In header: &lt;<a class="link" href="../reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.block_hpp" title="Header &lt;E:/sandbox/contractpp/trunk/doc/qbk/src/contract/block.hpp&gt;">E:/sandbox/contractpp/trunk/doc/qbk/src/contract/block.hpp</a>&gt;
+
+</span>
+<span class="keyword">typedef</span> <span class="identifier">__Integer__</span> <span class="identifier">loop_variant_type</span><span class="special">;</span></pre></div>
+<div class="refsect1">
+<a name="id962321"></a><h2>Description</h2>
+<p>The type of the loop variant expression.</p>
+<p>The <code class="computeroutput">__Integer__</code> type is a signed integer type but its actual type is library implementation specific.</p>
+<p><span class="bold"><strong>Note:</strong></span> While the loop variant expression type is signed, the loop variant value is asserted to be always positive (<code class="computeroutput">&gt; 0</code>).</p>
+<p>For example, you can use this type to convert (not cast) the variant expression into the variant type: </p>
+<pre class="programlisting"> <span class="identifier">CONTRACT_INIT_LOOP_VARIANT</span><span class="special">;</span>
+ <span class="keyword">for</span> <span class="special">(</span><span class="identifier">size_t</span> <span class="identifier">i</span> <span class="special">=</span> <span class="number">0</span><span class="special">;</span> <span class="identifier">i</span> <span class="special">&lt;</span> <span class="identifier">v</span><span class="special">.</span><span class="identifier">size</span><span class="special">(</span><span class="special">)</span><span class="special">;</span> <span class="special">++</span><span class="identifier">i</span><span class="special">)</span> <span class="special">{</span>
+ <span class="identifier">CONTRACT_ASSERT_LOOP_VARIANT</span><span class="special">(</span> <span class="identifier">loop_variant_type</span><span class="special">(</span><span class="identifier">v</span><span class="special">.</span><span class="identifier">size</span><span class="special">(</span><span class="special">)</span> <span class="special">-</span> <span class="identifier">i</span><span class="special">)</span> <span class="special">)</span><span class="special">;</span>
+ <span class="special">...</span>
+ <span class="special">}</span>
+</pre>
+<p> Note this is <span class="bold"><strong>not</strong></span> a type cast so it will generate a compile-time error if the type conversion if not possible. </p>
+</div>
+</div>
+<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
+<td align="left"></td>
+<td align="right"><div class="copyright-footer">Copyright &#169; 2009, 2010 Lorenzo Caminiti<p>
+ Distributed under the Contract++ Software License, Version 1.0 (see accompanying
+ file LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="../CONTRACT_ASSERT_MSG.html"><img src="../images/prev.png" alt="Prev"></a><a accesskey="u" href="../reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.block_hpp"><img src="../images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../images/home.png" alt="Home"></a><a accesskey="n" href="../CONTRACT_ASSERT_BLOCK_INVARIANT.html"><img src="../images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>

Added: sandbox/contract/libs/contract/doc/html/contract/nonmember_function.html
==============================================================================
--- (empty file)
+++ sandbox/contract/libs/contract/doc/html/contract/nonmember_function.html 2011-06-28 20:54:41 EDT (Tue, 28 Jun 2011)
@@ -0,0 +1,167 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
+<title>Class template nonmember_function</title>
+<link rel="stylesheet" href="../doc/html/boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
+<link rel="home" href="../index.html" title="Contract++ 0.3.490">
+<link rel="up" href="../reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.nonmember_function_hpp" title="Header &lt;E:/sandbox/contractpp/trunk/doc/qbk/src/contract/nonmember_function.hpp&gt;">
+<link rel="prev" href="../CONTRACT_FUNCTION.html" title="Macro CONTRACT_FUNCTION">
+<link rel="next" href="nonstatic_member_function.html" title="Class template nonstatic_member_function">
+</head>
+<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
+<table cellpadding="2" width="100%"><tr><td valign="top"></td></tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="../CONTRACT_FUNCTION.html"><img src="../images/prev.png" alt="Prev"></a><a accesskey="u" href="../reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.nonmember_function_hpp"><img src="../images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../images/home.png" alt="Home"></a><a accesskey="n" href="nonstatic_member_function.html"><img src="../images/next.png" alt="Next"></a>
+</div>
+<div class="refentry">
+<a name="contract.nonmember_function"></a><div class="titlepage"></div>
+<div class="refnamediv">
+<h2><span class="refentrytitle">Class template nonmember_function</span></h2>
+<p>contract::nonmember_function</p>
+</div>
+<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
+<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="comment">// In header: &lt;<a class="link" href="../reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.nonmember_function_hpp" title="Header &lt;E:/sandbox/contractpp/trunk/doc/qbk/src/contract/nonmember_function.hpp&gt;">E:/sandbox/contractpp/trunk/doc/qbk/src/contract/nonmember_function.hpp</a>&gt;
+
+</span><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> F<span class="special">&gt;</span>
+<span class="keyword">class</span> <a class="link" href="nonmember_function.html" title="Class template nonmember_function">nonmember_function</a> <span class="special">{</span>
+<span class="keyword">public</span><span class="special">:</span>
+ <span class="comment">// <a class="link" href="nonmember_function.html#contract.nonmember_functionconstruct-copy-destruct">construct/copy/destruct</a></span>
+ <a class="link" href="nonmember_function.html#id436356-bb"><span class="identifier">nonmember_function</span></a><span class="special">(</span><span class="identifier">__BodyFunctionPointer__</span><span class="special">,</span> <span class="identifier">__PreconditionFunctionPointer__</span><span class="special">,</span>
+ <span class="identifier">__PostconditionFunctionPointer__</span><span class="special">)</span><span class="special">;</span>
+ <a class="link" href="nonmember_function.html#id436529-bb"><span class="special">~</span><span class="identifier">nonmember_function</span></a><span class="special">(</span><span class="special">)</span><span class="special">;</span>
+
+ <span class="comment">// <a class="link" href="nonmember_function.html#id436300-bb">public member functions</a></span>
+ <span class="identifier">ResultType</span> <a class="link" href="nonmember_function.html#id436304-bb"><span class="identifier">call</span></a><span class="special">(</span><span class="identifier">ArgumentType1</span><span class="special">,</span> <span class="special">...</span><span class="special">,</span> <span class="identifier">ArgumetnTypeN</span><span class="special">)</span><span class="special">;</span>
+<span class="special">}</span><span class="special">;</span></pre></div>
+<div class="refsect1">
+<a name="id973869"></a><h2>Description</h2>
+<p>Class template used to write contracts for non-member functions.</p>
+<p><span class="bold"><strong>Note:</strong></span> Only the differences between this class and the <code class="computeroutput"><a class="link" href="nonstatic_member_function.html" title="Class template nonstatic_member_function">contract::nonstatic_member_function</a></code> class are documented here. Read the <code class="computeroutput"><a class="link" href="nonstatic_member_function.html" title="Class template nonstatic_member_function">contract::nonstatic_member_function</a></code> documentation first.</p>
+<p>The <code class="computeroutput">CONTRACT_FUNCTION()</code> macro expands to code that uses this class template (when no <code class="computeroutput">(class)</code> is specified in the function signature sequence, see the Without the Macros section) -- whenever possible, use the macro instead of using this class template directly. Rarely, it might be needed to use this template class directly to implement workarounds for compilers that do not fully comply with the ISO C++ standard.</p>
+<p><span class="bold"><strong>Parameters:</strong></span> </p>
+<div class="informaltable"><table class="table">
+<colgroup>
+<col>
+<col>
+</colgroup>
+<tbody><tr>
+<td><span class="bold"><strong><code class="computeroutput">F</code></strong></span></td>
+<td>The function type of the non-member function being contracted. </td>
+</tr></tbody>
+</table></div>
+<p>
+</p>
+<p>The function type <code class="computeroutput">F</code> must be specified as follows: </p>
+<pre class="programlisting"> <span class="identifier">ResultType</span> <span class="special">(</span><span class="identifier">ArgumentType1</span><span class="special">,</span> <span class="special">...</span><span class="special">,</span> <span class="identifier">ArgumentTypeN</span><span class="special">)</span>
+</pre>
+<p><span class="bold"><strong>See:</strong></span> Without the Macros section, <code class="computeroutput"><a class="link" href="nonstatic_member_function.html" title="Class template nonstatic_member_function">contract::nonstatic_member_function</a></code> </p>
+<div class="refsect2">
+<a name="id974045"></a><h3>
+<a name="contract.nonmember_functionconstruct-copy-destruct"></a><code class="computeroutput">nonmember_function</code>
+ public
+ construct/copy/destruct</h3>
+<div class="orderedlist"><ol class="orderedlist" type="1">
+<li class="listitem">
+<pre class="literallayout"><a name="id436356-bb"></a><span class="identifier">nonmember_function</span><span class="special">(</span><span class="identifier">__BodyFunctionPointer__</span> body_function<span class="special">,</span>
+ <span class="identifier">__PreconditionFunctionPointer__</span> precondition_function<span class="special">,</span>
+ <span class="identifier">__PostconditionFunctionPointer__</span> postcondition_function<span class="special">)</span><span class="special">;</span></pre>
+<p>Construct this contract object using the specified body, preconditions, and postconditions functions.</p>
+<p><span class="bold"><strong>Parameters:</strong></span> </p>
+<div class="informaltable"><table class="table">
+<colgroup>
+<col>
+<col>
+</colgroup>
+<tbody>
+<tr>
+<td><span class="bold"><strong><code class="computeroutput">body_function</code></strong></span></td>
+<td>A pointer to the function executing the body. </td>
+</tr>
+<tr>
+<td><span class="bold"><strong><code class="computeroutput">precondition_function</code></strong></span></td>
+<td>A pointer to the function asserting the preconditions. </td>
+</tr>
+<tr>
+<td><span class="bold"><strong><code class="computeroutput">postcondition_function</code></strong></span></td>
+<td>A pointer to the function asserting the postconditions. </td>
+</tr>
+</tbody>
+</table></div>
+<p>
+</p>
+<p>Refer to the <code class="computeroutput"><code class="computeroutput"><a class="link" href="nonstatic_member_function.html" title="Class template nonstatic_member_function">contract::nonstatic_member_function</a></code></code> documentation for the definition of metaprogramming constructs used below (<code class="computeroutput">__IfCopyable__</code>, etc).</p>
+<p>Note the followings for the function pointer types defined below: </p>
+<div class="itemizedlist"><ul class="itemizedlist" type="disc">
+<li class="listitem"><p>They are non-member functions. </p></li>
+<li class="listitem"><p>There is no old object value in postconditions, not even <code class="computeroutput">contract::noold</code> (because non-member functions have no object).</p></li>
+</ul></div>
+<p>
+The body function pointer type is defined as follows: </p>
+<pre class="programlisting"> typedef ResultType (* __BodyFunctionPointer__)
+ ( __RemoveCopyable__&lt; ArgumentType1 &gt;,
+ ...,
+ __RemoveCopyable__&lt; ArgumentTypeN &gt;
+ );
+</pre>
+<p>The precondition function pointer type is defined as follows: </p>
+<pre class="programlisting"> typedef ResultType (* __PreconditionFunctionPointer__)
+ ( boost::add_reference&lt;boost::add_const&lt;
+ __RemoveCopyable__&lt; ArgumentType1 &gt; &gt;::type&gt;::type,
+ ...,
+ boost::add_reference&lt;boost::add_const&lt;
+ __RemoveCopyable__&lt; ArgumentTypeN &gt; &gt;::type&gt;::type
+ );
+</pre>
+<p>The postcondition function pointer type is defined as follows: </p>
+<pre class="programlisting"> typedef ResultType (* __PreconditionFunctionPointer__)
+ ( boost::add_reference&lt;boost::add_const&lt;
+ __RemoveCopyable&lt; ArgumentType1 &gt; &gt;::type&gt;::type,
+ __IfCopyable__&lt; ArgumentType1,
+ boost::add_reference&lt;boost::add_const&lt;
+ __RemoveCopyable__&lt; ArgumentType1 &gt; &gt;::type&gt;::type &gt;,
+ ...,
+ boost::add_reference&lt;boost::add_const&lt;
+ __RemoveCopyable__&lt; ArgumentTypeN &gt; &gt;::type&gt;::type,
+ __IfCopyable__&lt; ArgumentTypeN,
+ boost::add_reference&lt;boost::add_const&lt;
+ __RemoveCopyable&lt; ArgumentTypeN &gt; &gt;::type&gt;::type &gt;,
+ __IfNonVoid__&lt; boost::add_reference&lt;boost::add_const&lt;
+ ResultType&gt;::type&gt;::type &gt;
+ );
+</pre>
+<p> </p>
+</li>
+<li class="listitem">
+<pre class="literallayout"><a name="id436529-bb"></a><span class="special">~</span><span class="identifier">nonmember_function</span><span class="special">(</span><span class="special">)</span><span class="special">;</span></pre>
+<p>Destroy this contract object. </p>
+</li>
+</ol></div>
+</div>
+<div class="refsect2">
+<a name="id974360"></a><h3>
+<a name="id436300-bb"></a><code class="computeroutput">nonmember_function</code> public member functions</h3>
+<div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem">
+<pre class="literallayout"><span class="identifier">ResultType</span> <a name="id436304-bb"></a><span class="identifier">call</span><span class="special">(</span><span class="identifier">ArgumentType1</span> argument1<span class="special">,</span> <span class="special">...</span><span class="special">,</span> <span class="identifier">ArgumetnTypeN</span> argumentN<span class="special">)</span><span class="special">;</span></pre>
+<p>Check the contract and executes the member function body.</p>
+<p>Refer to the <code class="computeroutput"><code class="computeroutput"><a class="link" href="nonstatic_member_function.html" title="Class template nonstatic_member_function">contract::nonstatic_member_function</a></code></code> documentation.</p>
+<p>The <code class="computeroutput">call()</code> function takes no object (because the contracted function is not a member). </p>
+</li></ol></div>
+</div>
+</div>
+</div>
+<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
+<td align="left"></td>
+<td align="right"><div class="copyright-footer">Copyright &#169; 2009, 2010 Lorenzo Caminiti<p>
+ Distributed under the Contract++ Software License, Version 1.0 (see accompanying
+ file LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="../CONTRACT_FUNCTION.html"><img src="../images/prev.png" alt="Prev"></a><a accesskey="u" href="../reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.nonmember_function_hpp"><img src="../images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../images/home.png" alt="Home"></a><a accesskey="n" href="nonstatic_member_function.html"><img src="../images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>

Added: sandbox/contract/libs/contract/doc/html/contract/nonstatic_member_function.html
==============================================================================
--- (empty file)
+++ sandbox/contract/libs/contract/doc/html/contract/nonstatic_member_function.html 2011-06-28 20:54:41 EDT (Tue, 28 Jun 2011)
@@ -0,0 +1,283 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
+<title>Class template nonstatic_member_function</title>
+<link rel="stylesheet" href="../doc/html/boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
+<link rel="home" href="../index.html" title="Contract++ 0.3.490">
+<link rel="up" href="../reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.nonstatic_member_function_hpp" title="Header &lt;E:/sandbox/contractpp/trunk/doc/qbk/src/contract/nonstatic_member_function.hpp&gt;">
+<link rel="prev" href="nonmember_function.html" title="Class template nonmember_function">
+<link rel="next" href="copyable.html" title="Class template copyable">
+</head>
+<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
+<table cellpadding="2" width="100%"><tr><td valign="top"></td></tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="nonmember_function.html"><img src="../images/prev.png" alt="Prev"></a><a accesskey="u" href="../reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.nonstatic_member_function_hpp"><img src="../images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../images/home.png" alt="Home"></a><a accesskey="n" href="copyable.html"><img src="../images/next.png" alt="Next"></a>
+</div>
+<div class="refentry">
+<a name="contract.nonstatic_member_function"></a><div class="titlepage"></div>
+<div class="refnamediv">
+<h2><span class="refentrytitle">Class template nonstatic_member_function</span></h2>
+<p>contract::nonstatic_member_function</p>
+</div>
+<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
+<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="comment">// In header: &lt;<a class="link" href="../reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.nonstatic_member_function_hpp" title="Header &lt;E:/sandbox/contractpp/trunk/doc/qbk/src/contract/nonstatic_member_function.hpp&gt;">E:/sandbox/contractpp/trunk/doc/qbk/src/contract/nonstatic_member_function.hpp</a>&gt;
+
+</span><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> F<span class="special">,</span> <span class="keyword">typename</span> BaseContractClass1 <span class="special">=</span> <span class="keyword">void</span><span class="special">,</span> <span class="special">...</span> <span class="special">,</span>
+ <span class="keyword">typename</span> BaseContractClassM <span class="special">=</span> <span class="keyword">void</span><span class="special">&gt;</span>
+<span class="keyword">class</span> <a class="link" href="nonstatic_member_function.html" title="Class template nonstatic_member_function">nonstatic_member_function</a> <span class="special">{</span>
+<span class="keyword">public</span><span class="special">:</span>
+ <span class="comment">// <a class="link" href="nonstatic_member_function.html#contract.nonstatic_member_functionconstruct-copy-destruct">construct/copy/destruct</a></span>
+ <a class="link" href="nonstatic_member_function.html#id437408-bb"><span class="identifier">nonstatic_member_function</span></a><span class="special">(</span><span class="identifier">__BodyFunctionPointer__</span><span class="special">,</span>
+ <span class="identifier">__PreconditionFunctionPointer__</span><span class="special">,</span>
+ <span class="identifier">__PostconditionFunctionPointer__</span><span class="special">)</span><span class="special">;</span>
+ <a class="link" href="nonstatic_member_function.html#id437722-bb"><span class="special">~</span><span class="identifier">nonstatic_member_function</span></a><span class="special">(</span><span class="special">)</span><span class="special">;</span>
+
+ <span class="comment">// <a class="link" href="nonstatic_member_function.html#id437202-bb">public member functions</a></span>
+ <span class="identifier">ResultType</span> <a class="link" href="nonstatic_member_function.html#id437206-bb"><span class="identifier">call</span></a><span class="special">(</span><span class="identifier">__MaybeCVClassPointer__</span><span class="special">,</span> <span class="identifier">ArgumentType1</span><span class="special">,</span> <span class="special">...</span><span class="special">,</span> <span class="identifier">ArgumetnTypeN</span><span class="special">)</span><span class="special">;</span>
+<span class="special">}</span><span class="special">;</span></pre></div>
+<div class="refsect1">
+<a name="id975001"></a><h2>Description</h2>
+<p>Class template used to write contracts for non-static member functions.</p>
+<p><span class="bold"><strong>Note:</strong></span> This class is used to write contracts for non-static member functions but it cannot be used for static-member functions (see <code class="computeroutput">contract::static_member</code>), constructors (see <code class="computeroutput"><a class="link" href="constructor.html" title="Class template constructor">contract::constructor</a></code>), destructors (see <code class="computeroutput"><a class="link" href="destructor.html" title="Class template destructor">contract::destructor</a></code>), and non-m ember functions (see <code class="computeroutput"><a class="link" href="nonmember_function.html" title="Class template nonmember_function">contract::nonmember_function</a></code>) because they have different contract checking semantics.</p>
+<p>The <code class="computeroutput">CONTRACT_FUNCTION()</code> macro expands to code that uses this class template (see the Without the Macros section) -- whenever possible, use the macro instead of using this class template directly. Rarely, it might be needed to use this class template directly to implement workarounds for compilers that do not fully comply with the ISO C++ standard.</p>
+<p><span class="bold"><strong>Parameters:</strong></span> </p>
+<div class="informaltable"><table class="table">
+<colgroup>
+<col>
+<col>
+</colgroup>
+<tbody>
+<tr>
+<td><span class="bold"><strong><code class="computeroutput">F</code></strong></span></td>
+<td>The function type of the function being contracted. </td>
+</tr>
+<tr>
+<td><span class="bold"><strong><code class="computeroutput">BaseContractClass1, ..., BaseContractClassM</code></strong></span></td>
+<td>These are the contracts from which the member function is subcontracting. These are all optional, they are only specified when the member function is subcontracting: no base contract is specified if no subcontracting, only <code class="computeroutput">BaseContractClass1</code> is specified to subcontract from 1 base class only, and more base contract classes are specified to support subcontracting with multiple inheritance. <div class="itemizedlist"><ul class="itemizedlist" type="disc">
+<li class="listitem"><p>Each of these types must inherit from <code class="computeroutput"><a class="link" href="nonstatic_member_function.html" title="Class template nonstatic_member_function">contract::nonstatic_member_function</a></code> (so to be a contract class) and its class type must be a base class of the contracted class (otherwise the library will generate a compile-time error). </p></li>
+<li class="listitem"><p>When multiple base contract classes are specified, the overridden contracts are checked following the order of the specified template parameters. The derived class contract is checked last. </p></li>
+<li class="listitem"><p>The maximum number of supported base class contracts <span class="emphasis"><em>M</em></span> is specified by the <code class="computeroutput">CONTRACT_CONFIG_MAX_MULTIPLE_INHERITANCE</code> configuration macro. </p></li>
+</ul></div>
+</td>
+</tr>
+</tbody>
+</table></div>
+<p>
+</p>
+<p>The following metaprogramming constructs (e.g., <code class="computeroutput">__AMetaprogrammingConstruct__</code>) are used in this documentation to define the different types:</p>
+<div class="itemizedlist"><ul class="itemizedlist" type="disc">
+<li class="listitem"><p>If <code class="computeroutput">S</code> is <code class="computeroutput">contract::copyable&lt;T&gt;</code> then <code class="computeroutput">__RemoveCopyable__&lt; S &gt;</code> is <code class="computeroutput">T</code>, otherwise it is <code class="computeroutput">S</code> (i.e., this removes the eventual <code class="computeroutput"><a class="link" href="copyable.html" title="Class template copyable">contract::copyable</a></code> tag from the specified type).</p></li>
+<li class="listitem"><p><code class="computeroutput">__UncopyableClassType__</code> is <code class="computeroutput">__RemoveCopyable__&lt; __RemoveCV__&lt; ClassType &gt; &gt;</code>.</p></li>
+<li class="listitem"><p>If <code class="computeroutput">ClassType</code> is cv-qualified then <code class="computeroutput">__MaybeCV__</code> is the cv-qualifier (<code class="computeroutput">const</code>, <code class="computeroutput">volatile</code>, or <code class="computeroutput">const volatile</code>), otherwise it is nothing.</p></li>
+<li class="listitem"><p>If <code class="computeroutput">S</code> is tagged <code class="computeroutput"><a class="link" href="copyable.html" title="Class template copyable">contract::copyable</a></code> then <code class="computeroutput"> __IfCopyable__&lt; S, T &gt;</code> is the <code class="computeroutput">T</code>, otherwise it is the <code class="computeroutput">contract::noold</code>.</p></li>
+<li class="listitem"><p>If <code class="computeroutput">F</code> has a non-void <code class="computeroutput">ResultType</code> then <code class="computeroutput">__IfNonVoid__&lt; C &gt;</code> is <code class="computeroutput">C</code>, otherwise it is nothing.</p></li>
+<li class="listitem"><p><code class="computeroutput">__MaybeCvClassPointer__</code> is a pointer to <code class="computeroutput">__UncopyableClassType__</code> with the same cv-qualifier of <code class="computeroutput">ClassType</code> (<code class="computeroutput">*</code>, <code class="computeroutput">const*</code>, <code class="computeroutput">volatile*</code>, or <code class="computeroutput">const volatile*</code>).</p></li>
+</ul></div>
+<p>
+</p>
+<p>These metaporgramming constructs are <span class="bold"><strong>not</strong></span> templates. They are internally implemented by the library using both preprocessor and template metaprogramming (in a way that is intentionally <span class="emphasis"><em>not</em></span> documented here because it is library implementation specific).</p>
+<p>The function type template parameter <code class="computeroutput">F</code> must be specified as follows: </p>
+<pre class="programlisting"> <span class="identifier">ResultType</span> <span class="special">(</span><span class="identifier">ClassType</span><span class="special">*</span><span class="special">,</span> <span class="identifier">ArgumentType1</span><span class="special">,</span> <span class="special">...</span><span class="special">,</span> <span class="identifier">ArgumentTypeN</span><span class="special">)</span>
+</pre>
+<p>Where: </p>
+<div class="itemizedlist"><ul class="itemizedlist" type="disc">
+<li class="listitem"><p>The <code class="computeroutput">ResultType</code> is the function result type (use <code class="computeroutput">void</code> for functions that have no return value). </p></li>
+<li class="listitem"><p>The <code class="computeroutput">ClassType</code> is the type of the class the function is member of. </p></li>
+<li class="listitem"><p>For constant member functions <code class="computeroutput">const</code> qualifies the class type. </p></li>
+<li class="listitem"><p>The class type <code class="computeroutput">ClassType</code> (together with its eventual <code class="computeroutput">const</code> qualifier) can be tagged <code class="computeroutput"><a class="link" href="copyable.html" title="Class template copyable">contract::copyable</a></code> as in <code class="computeroutput">contract::copyable&lt;ClassType __ConstIfContractMemeber__&gt;*</code> if the object old value <code class="computeroutput">CONTRACT_OLDOF(this)</code> is needed in the postconditions (in this case the class must have an accessible constant-correct copy constructor, see <code class="computeroutput"><a class="link" href="copy.html" title="Class template copy">contract::copy</a></code>). Note that <code class="computeroutput"><a class="link" href="copyable.html" title="Class template copyable">contract::copyable</a></code> does <span class="bold"><strong>not</strong></span> wrap the pointer operator (i.e., <code class="computeroutput">contract::copyable&lt;ClassType __Cons
tIfContractMemeber__*&gt;</code> is invalid). </p></li>
+<li class="listitem">
+<p>The class type must declare a (private) mutable member variable of a friend type <code class="computeroutput"><a class="link" href="state.html" title="Class state">contract::state</a></code> with the predefined name <code class="computeroutput">contract_state_</code> otherwise the library will generate a compile-time error. This member variable is mainly used by the library to keep track of when contracts are being checked so to disable assertion checking in nested member function calls that could otherwise result in infinite recursion (see the Without the Macros section). </p>
+<pre class="programlisting"> <span class="keyword">class</span> <span class="identifier">ClassType</span> <span class="special">{</span>
+
+ <span class="comment">// Optional contract compilation.</span>
+ <span class="preprocessor">#if</span> <span class="identifier">defined</span> <span class="identifier">BOOST_CONTRACT_CHECK_CLASS_INVARIANT</span> <span class="special">||</span> \
+ <span class="identifier">defined</span> <span class="identifier">BOOST_CONTRACT_CHECK_PRECONDITION</span> <span class="special">||</span> \
+ <span class="identifier">defined</span> <span class="identifier">BOOST_CONTRACT_CHECK_POSTCONDITION</span>
+ <span class="comment">// Augmented state.</span>
+ <span class="keyword">friend</span> <a class="link" href="state.html" title="Class state">contract::state</a><span class="special">;</span>
+ <span class="keyword">mutable</span> <a class="link" href="state.html" title="Class state">contract::state</a> <span class="identifier">contract_state_</span><span class="special">;</span>
+ <span class="preprocessor">#endif</span>
+
+ <span class="special">...</span> <span class="comment">// Rest of the class.</span>
+ <span class="special">}</span><span class="special">;</span>
+</pre>
+<p> Whenever possible, use the <code class="computeroutput">CONTRACT_INVARIANT()</code> macro instead of declaring <code class="computeroutput">contract_state_</code> directly. </p>
+</li>
+<li class="listitem"><p>The function argument types <code class="computeroutput">ArgumentType1</code>, ..., <code class="computeroutput">ArgumentTypeN</code> are all optional (specify none for a function with no argument, only <code class="computeroutput">ArgumentType1</code> is specified for a function with one argument, etc). </p></li>
+<li class="listitem"><p>Any of the argument type can be tagged <code class="computeroutput"><a class="link" href="copyable.html" title="Class template copyable">contract::copyable</a></code> if the old value <code class="computeroutput">CONTRACT_OLDOF(argument-name)</code> (before body execution) of the related argument is needed in postconditions. Types tagged <code class="computeroutput"><a class="link" href="copyable.html" title="Class template copyable">contract::copyable</a></code> must have an accessible constant-correct copy constructor (otherwise the library will generate a compile-time error, see <code class="computeroutput"><a class="link" href="copy.html" title="Class template copy">contract::copy</a></code>). The eventual <code class="computeroutput"><a class="link" href="copyable.html" title="Class template copyable">contract::copyable</a></code> tag must wrap the <span class="bold"><strong>entire</strong></span> argument type (including the pointer operator if present, this is different from t
he class type). </p></li>
+<li class="listitem"><p>The maximum number of supported function arguments <span class="emphasis"><em>N</em></span> is specified by the <code class="computeroutput">CONTRACT_CONFIG_MAX_FUNCTION_ARITY</code> configuration macro.</p></li>
+</ul></div>
+<p>
+<span class="bold"><strong>See:</strong></span> Without the Macros section </p>
+<div class="refsect2">
+<a name="id976006"></a><h3>
+<a name="contract.nonstatic_member_functionconstruct-copy-destruct"></a><code class="computeroutput">nonstatic_member_function</code>
+ public
+ construct/copy/destruct</h3>
+<div class="orderedlist"><ol class="orderedlist" type="1">
+<li class="listitem">
+<pre class="literallayout"><a name="id437408-bb"></a><span class="identifier">nonstatic_member_function</span><span class="special">(</span><span class="identifier">__BodyFunctionPointer__</span> body_function<span class="special">,</span>
+ <span class="identifier">__PreconditionFunctionPointer__</span> precondition_function<span class="special">,</span>
+ <span class="identifier">__PostconditionFunctionPointer__</span> postcondition_function<span class="special">)</span><span class="special">;</span></pre>
+<p>Construct this contract object using the specified body, preconditions, and postconditions functions.</p>
+<p><span class="bold"><strong>Parameters:</strong></span> </p>
+<div class="informaltable"><table class="table">
+<colgroup>
+<col>
+<col>
+</colgroup>
+<tbody>
+<tr>
+<td><span class="bold"><strong><code class="computeroutput">body_function</code></strong></span></td>
+<td>A pointer to the function executing the body. </td>
+</tr>
+<tr>
+<td><span class="bold"><strong><code class="computeroutput">precondition_function</code></strong></span></td>
+<td>A pointer to the function asserting the preconditions. </td>
+</tr>
+<tr>
+<td><span class="bold"><strong><code class="computeroutput">postcondition_function</code></strong></span></td>
+<td>A pointer to the function asserting the postconditions. </td>
+</tr>
+</tbody>
+</table></div>
+<p>
+</p>
+<p>The body function pointer type is defined as follows: </p>
+<pre class="programlisting"> typedef ResultType (__UncopyableClassType__::* __BodyFunctionPointer__)
+ ( __RemoveCopyable__&lt; ArgumentType1 &gt;,
+ ...,
+ __RemoveCopyable__&lt; ArgumentTypeN &gt;
+ ) __MaybeCV__;
+</pre>
+<p> </p>
+<div class="itemizedlist"><ul class="itemizedlist" type="disc">
+<li class="listitem"><p>The body function pointer type matches the signature of the contracted function. </p></li>
+<li class="listitem"><p>The <code class="computeroutput"><code class="computeroutput"><a class="link" href="copyable.html" title="Class template copyable">contract::copyable</a></code></code> tag is removed from the class and argument types. </p></li>
+<li class="listitem"><p>The function type is the <code class="computeroutput">const</code> only if the contracted function is a constant member.</p></li>
+</ul></div>
+<p>
+The precondition function pointer type is defined as follows: </p>
+<pre class="programlisting"> typedef void (__UncopyableClassType__::* __PreconditionFunctionPointer__)
+ ( boost::add_reference&lt;boost::add_const&lt;
+ __RemoveCopyable__&lt; ArgumentType1 &gt; &gt;::type&gt;::type,
+ ...,
+ boost::add_reference&lt;boost::add_const&lt;
+ __RemoveCopyable__&lt; ArgumentTypeN &gt; &gt;::type&gt;::type
+ ) const __MaybeVolatile__;
+</pre>
+<p> </p>
+<div class="itemizedlist"><ul class="itemizedlist" type="disc">
+<li class="listitem"><p>The precondition function pointer type always has a <code class="computeroutput">void</code> return type. </p></li>
+<li class="listitem"><p>The <code class="computeroutput"><code class="computeroutput"><a class="link" href="copyable.html" title="Class template copyable">contract::copyable</a></code></code> tag is removed from the class and argument types. </p></li>
+<li class="listitem"><p>Each function argument is passed as a contract reference. </p></li>
+<li class="listitem"><p>The function type is always <code class="computeroutput">const</code> if the contracted function is a member.</p></li>
+</ul></div>
+<p>
+The postcondition function pointer type is defined as follows: </p>
+<pre class="programlisting"> typedef void (__UncopyableClassType__::* __PreconditionFunctionPointer__)
+ ( __IfCopyable__&lt; ClassType,
+ boost::add_pointer&lt;boost::add_const&lt;
+ ClassType&gt;::type&gt;::type &gt;,
+ boost::add_reference&lt;boost::add_const&lt;
+ __RemoveCopyable__&lt; ArgumentType1 &gt; &gt;::type&gt;::type,
+ __IfCopyable__&lt; ArgumentType1,
+ boost::add_reference&lt;boost::add_const&lt;
+ __RemoveCopyable__&lt; ArgumentType1 &gt; &gt;::type&gt;::type &gt;,
+ ...,
+ boost::add_reference&lt;boost::add_const&lt;
+ __RemoveCopyable__&lt; ArgumentTypeN &gt; &gt;::type&gt;::type,
+ __IfCopyable__&lt; ArgumentTypeN,
+ boost::add_reference&lt;boost::add_const&lt;
+ __RemoveCopyable__&lt; ArgumentTypeN &gt; &gt;::type&gt;::type &gt;,
+ __IfNonVoid__&lt; boost::add_reference&lt;boost::add_const&lt;
+ ResultType&gt;::type&gt;::type &gt;
+ ) const __MaybeVolatile__;
+</pre>
+<p> </p>
+<div class="itemizedlist"><ul class="itemizedlist" type="disc">
+<li class="listitem"><p>The postcondition function pointer type always has a <code class="computeroutput">void</code> return type. </p></li>
+<li class="listitem"><p>The <code class="computeroutput"><code class="computeroutput"><a class="link" href="copyable.html" title="Class template copyable">contract::copyable</a></code></code> tag is removed from the class and argument types. </p></li>
+<li class="listitem"><p>The first argument is a constant pointer to the object old value if the class type was tagged <code class="computeroutput"><code class="computeroutput"><a class="link" href="copyable.html" title="Class template copyable">contract::copyable</a></code></code>, otherwise it is of type <code class="computeroutput">contract::noold</code> (indicating that no object old value is available because the class type was not tagged <code class="computeroutput"><code class="computeroutput"><a class="link" href="copyable.html" title="Class template copyable">contract::copyable</a></code></code>). </p></li>
+<li class="listitem"><p>Each function argument is passed as contract reference and it is followed by its old value. Each old value is a constant reference to the argument old value if the argument type was tagged <code class="computeroutput">contract::copayble</code>, otherwise it is of type <code class="computeroutput">contract::noold</code> (indicating that no object old value is available because the argument type was not tagged <code class="computeroutput"><code class="computeroutput"><a class="link" href="copyable.html" title="Class template copyable">contract::copyable</a></code></code>). </p></li>
+<li class="listitem"><p>The function type is always <code class="computeroutput">const</code> if the contracted function is a member. </p></li>
+</ul></div>
+<p>
+</p>
+</li>
+<li class="listitem">
+<pre class="literallayout"><a name="id437722-bb"></a><span class="special">~</span><span class="identifier">nonstatic_member_function</span><span class="special">(</span><span class="special">)</span><span class="special">;</span></pre>
+<p>Destroy this contract object. </p>
+</li>
+</ol></div>
+</div>
+<div class="refsect2">
+<a name="id976528"></a><h3>
+<a name="id437202-bb"></a><code class="computeroutput">nonstatic_member_function</code> public member functions</h3>
+<div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem">
+<pre class="literallayout"><span class="identifier">ResultType</span> <a name="id437206-bb"></a><span class="identifier">call</span><span class="special">(</span><span class="identifier">__MaybeCVClassPointer__</span> object<span class="special">,</span> <span class="identifier">ArgumentType1</span> argument1<span class="special">,</span> <span class="special">...</span><span class="special">,</span>
+ <span class="identifier">ArgumetnTypeN</span> argumentN<span class="special">)</span><span class="special">;</span></pre>
+<p>Check the contract and execute the member function body.</p>
+<p>This function implements the correct contract checking semantics for the function call (see the Tutorial section). In summary: </p>
+<div class="itemizedlist"><ul class="itemizedlist" type="disc">
+<li class="listitem"><p>It checks class invariants and preconditions (also of overridden contracts when subcontracting), it executes the member function body, then it checks class invariants and postconditions (also of overridden contracts when subcontracting). </p></li>
+<li class="listitem"><p>If the body throws an exception, only class invariants (and not postconditions) are checked on function exit. </p></li>
+<li class="listitem"><p>Non-member functions do not check class invariants and they do not subcontract.</p></li>
+</ul></div>
+<p>
+<span class="bold"><strong>Parameters:</strong></span> </p>
+<div class="informaltable"><table class="table">
+<colgroup>
+<col>
+<col>
+</colgroup>
+<tbody>
+<tr>
+<td><span class="bold"><strong><code class="computeroutput">object</code></strong></span></td>
+<td>A pointer to the object (present only if <code class="computeroutput">F</code> is a member function pointer type). The object pointer is <code class="computeroutput">const</code> only if <code class="computeroutput">F</code> is a constant member function pointer type (to handle constant member functions). </td>
+</tr>
+<tr>
+<td><span class="bold"><strong><code class="computeroutput">argument1, ..., argumentN</code></strong></span></td>
+<td>The function arguments. </td>
+</tr>
+</tbody>
+</table></div>
+<p>
+</p>
+<p><span class="bold"><strong>Returns:</strong></span> The function return value but only when <code class="computeroutput">F</code> is a non-void function pointer type.</p>
+<p><span class="bold"><strong>Note:</strong></span> When <code class="computeroutput">F</code> is a member function pointer type, the <code class="computeroutput">call()</code> function checks class invariants by calling a constant member function with the <code class="computeroutput">contract_invariant_</code> predefined name and it also checks static class invariants by calling a static member function with the <code class="computeroutput">contract_static_invariant_</code> predefined name (see the Without the Macros section for more information): </p>
+<pre class="programlisting"> class ClassType {
+
+ #if defined BOOST_CONTRACT_CHECK_INVARIANT
+ void contract_static_invariant_(void) {
+ ... // Assert static class invariants.
+ }
+ void contract_invariant_ (void) const {
+ ... // Assert class invariants.
+ }
+ #endif
+
+ ... // Rest of the class.
+ };
+</pre>
+<p> Note the #if guard to declare the function only when invariant compilation and checking is turned on. Such function must be defined and accessible otherwise the library will generate a compile-time error. Whenever possible, use the <code class="computeroutput">CONTRACT_INVARIANT()</code> macro instead of programming the <code class="computeroutput">contract_invariant_</code> and <code class="computeroutput">contract_static_invariant_</code> functions directly. </p>
+</li></ol></div>
+</div>
+</div>
+</div>
+<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
+<td align="left"></td>
+<td align="right"><div class="copyright-footer">Copyright &#169; 2009, 2010 Lorenzo Caminiti<p>
+ Distributed under the Contract++ Software License, Version 1.0 (see accompanying
+ file LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="nonmember_function.html"><img src="../images/prev.png" alt="Prev"></a><a accesskey="u" href="../reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.nonstatic_member_function_hpp"><img src="../images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../images/home.png" alt="Home"></a><a accesskey="n" href="copyable.html"><img src="../images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>

Added: sandbox/contract/libs/contract/doc/html/contract/postcondition_failed.html
==============================================================================
--- (empty file)
+++ sandbox/contract/libs/contract/doc/html/contract/postcondition_failed.html 2011-06-28 20:54:41 EDT (Tue, 28 Jun 2011)
@@ -0,0 +1,61 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
+<title>Function postcondition_failed</title>
+<link rel="stylesheet" href="../doc/html/boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
+<link rel="home" href="../index.html" title="Contract++ 0.3.490">
+<link rel="up" href="../reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.assert_hpp" title="Header &lt;E:/sandbox/contractpp/trunk/doc/qbk/src/contract/assert.hpp&gt;">
+<link rel="prev" href="set_postcondition_failed.html" title="Function set_postcondition_failed">
+<link rel="next" href="../CONTRACT_ASSERT.html" title="Macro CONTRACT_ASSERT">
+</head>
+<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
+<table cellpadding="2" width="100%"><tr><td valign="top"></td></tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="set_postcondition_failed.html"><img src="../images/prev.png" alt="Prev"></a><a accesskey="u" href="../reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.assert_hpp"><img src="../images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../images/home.png" alt="Home"></a><a accesskey="n" href="../CONTRACT_ASSERT.html"><img src="../images/next.png" alt="Next"></a>
+</div>
+<div class="refentry">
+<a name="contract.postcondition_failed"></a><div class="titlepage"></div>
+<div class="refnamediv">
+<h2><span class="refentrytitle">Function postcondition_failed</span></h2>
+<p>contract::postcondition_failed</p>
+</div>
+<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
+<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="comment">// In header: &lt;<a class="link" href="../reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.assert_hpp" title="Header &lt;E:/sandbox/contractpp/trunk/doc/qbk/src/contract/assert.hpp&gt;">E:/sandbox/contractpp/trunk/doc/qbk/src/contract/assert.hpp</a>&gt;
+
+</span>
+<span class="keyword">void</span> <span class="identifier">postcondition_failed</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">from</span> <span class="special">&amp;</span> where<span class="special">)</span><span class="special">;</span></pre></div>
+<div class="refsect1">
+<a name="id961430"></a><h2>Description</h2>
+<p>Automatically invoked by this library when a postcondition fails.</p>
+<p>It calls <code class="computeroutput">std::terminate()</code> by default but it can be redefined using <code class="computeroutput">contract::set_postcondition_failed()</code>. When this function is called, the exception raised by the contract failure is the active unhandled exception (which can be re-thrown using <code class="computeroutput">throw</code> and then caught, see Throw on Failure annex).</p>
+<p><span class="bold"><strong>Parameters:</strong></span> </p>
+<div class="informaltable"><table class="table">
+<colgroup>
+<col>
+<col>
+</colgroup>
+<tbody><tr>
+<td><span class="bold"><strong><code class="computeroutput">where</code></strong></span></td>
+<td>The source that found the the invariant failure. </td>
+</tr></tbody>
+</table></div>
+<p>
+</p>
+</div>
+</div>
+<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
+<td align="left"></td>
+<td align="right"><div class="copyright-footer">Copyright &#169; 2009, 2010 Lorenzo Caminiti<p>
+ Distributed under the Contract++ Software License, Version 1.0 (see accompanying
+ file LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="set_postcondition_failed.html"><img src="../images/prev.png" alt="Prev"></a><a accesskey="u" href="../reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.assert_hpp"><img src="../images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../images/home.png" alt="Home"></a><a accesskey="n" href="../CONTRACT_ASSERT.html"><img src="../images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>

Added: sandbox/contract/libs/contract/doc/html/contract/precondition_failed.html
==============================================================================
--- (empty file)
+++ sandbox/contract/libs/contract/doc/html/contract/precondition_failed.html 2011-06-28 20:54:41 EDT (Tue, 28 Jun 2011)
@@ -0,0 +1,61 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
+<title>Function precondition_failed</title>
+<link rel="stylesheet" href="../doc/html/boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
+<link rel="home" href="../index.html" title="Contract++ 0.3.490">
+<link rel="up" href="../reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.assert_hpp" title="Header &lt;E:/sandbox/contractpp/trunk/doc/qbk/src/contract/assert.hpp&gt;">
+<link rel="prev" href="set_precondition_failed.html" title="Function set_precondition_failed">
+<link rel="next" href="set_postcondition_failed.html" title="Function set_postcondition_failed">
+</head>
+<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
+<table cellpadding="2" width="100%"><tr><td valign="top"></td></tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="set_precondition_failed.html"><img src="../images/prev.png" alt="Prev"></a><a accesskey="u" href="../reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.assert_hpp"><img src="../images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../images/home.png" alt="Home"></a><a accesskey="n" href="set_postcondition_failed.html"><img src="../images/next.png" alt="Next"></a>
+</div>
+<div class="refentry">
+<a name="contract.precondition_failed"></a><div class="titlepage"></div>
+<div class="refnamediv">
+<h2><span class="refentrytitle">Function precondition_failed</span></h2>
+<p>contract::precondition_failed</p>
+</div>
+<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
+<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="comment">// In header: &lt;<a class="link" href="../reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.assert_hpp" title="Header &lt;E:/sandbox/contractpp/trunk/doc/qbk/src/contract/assert.hpp&gt;">E:/sandbox/contractpp/trunk/doc/qbk/src/contract/assert.hpp</a>&gt;
+
+</span>
+<span class="keyword">void</span> <span class="identifier">precondition_failed</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">from</span> <span class="special">&amp;</span> where<span class="special">)</span><span class="special">;</span></pre></div>
+<div class="refsect1">
+<a name="id961139"></a><h2>Description</h2>
+<p>Automatically invoked by this library when a precondition fails.</p>
+<p>It calls <code class="computeroutput">std::terminate()</code> by default but it can be redefined using <code class="computeroutput">contract::set_precondition_failed()</code>. When this function is called, the exception raised by the contract failure is the active unhandled exception (which can be re-thrown using <code class="computeroutput">throw</code> and then caught, see Throw on Failure annex).</p>
+<p><span class="bold"><strong>Parameters:</strong></span> </p>
+<div class="informaltable"><table class="table">
+<colgroup>
+<col>
+<col>
+</colgroup>
+<tbody><tr>
+<td><span class="bold"><strong><code class="computeroutput">where</code></strong></span></td>
+<td>The source that found the the invariant failure. </td>
+</tr></tbody>
+</table></div>
+<p>
+</p>
+</div>
+</div>
+<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
+<td align="left"></td>
+<td align="right"><div class="copyright-footer">Copyright &#169; 2009, 2010 Lorenzo Caminiti<p>
+ Distributed under the Contract++ Software License, Version 1.0 (see accompanying
+ file LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="set_precondition_failed.html"><img src="../images/prev.png" alt="Prev"></a><a accesskey="u" href="../reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.assert_hpp"><img src="../images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../images/home.png" alt="Home"></a><a accesskey="n" href="set_postcondition_failed.html"><img src="../images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>

Added: sandbox/contract/libs/contract/doc/html/contract/set_block_invariant_failed.html
==============================================================================
--- (empty file)
+++ sandbox/contract/libs/contract/doc/html/contract/set_block_invariant_failed.html 2011-06-28 20:54:41 EDT (Tue, 28 Jun 2011)
@@ -0,0 +1,64 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
+<title>Function set_block_invariant_failed</title>
+<link rel="stylesheet" href="../doc/html/boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
+<link rel="home" href="../index.html" title="Contract++ 0.3.490">
+<link rel="up" href="../reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.assert_hpp" title="Header &lt;E:/sandbox/contractpp/trunk/doc/qbk/src/contract/assert.hpp&gt;">
+<link rel="prev" href="contract_failed_handler.html" title="Type definition contract_failed_handler">
+<link rel="next" href="block_invariant_failed.html" title="Function block_invariant_failed">
+</head>
+<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
+<table cellpadding="2" width="100%"><tr><td valign="top"></td></tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="contract_failed_handler.html"><img src="../images/prev.png" alt="Prev"></a><a accesskey="u" href="../reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.assert_hpp"><img src="../images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../images/home.png" alt="Home"></a><a accesskey="n" href="block_invariant_failed.html"><img src="../images/next.png" alt="Next"></a>
+</div>
+<div class="refentry">
+<a name="contract.set_block_invariant_failed"></a><div class="titlepage"></div>
+<div class="refnamediv">
+<h2><span class="refentrytitle">Function set_block_invariant_failed</span></h2>
+<p>contract::set_block_invariant_failed</p>
+</div>
+<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
+<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="comment">// In header: &lt;<a class="link" href="../reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.assert_hpp" title="Header &lt;E:/sandbox/contractpp/trunk/doc/qbk/src/contract/assert.hpp&gt;">E:/sandbox/contractpp/trunk/doc/qbk/src/contract/assert.hpp</a>&gt;
+
+</span>
+<span class="identifier">contract_failed_handler</span>
+<span class="identifier">set_block_invariant_failed</span><span class="special">(</span><span class="identifier">contract_failed_handler</span> handler<span class="special">)</span><span class="special">;</span></pre></div>
+<div class="refsect1">
+<a name="id960403"></a><h2>Description</h2>
+<p>Set the specified user defined handler function to call on block invariant failure.</p>
+<p>This function can be used by programmers to specify an action to take in case of block invariant failure different from the default to terminate the program.</p>
+<p><span class="bold"><strong>Parameters:</strong></span> </p>
+<div class="informaltable"><table class="table">
+<colgroup>
+<col>
+<col>
+</colgroup>
+<tbody><tr>
+<td><span class="bold"><strong><code class="computeroutput">handler</code></strong></span></td>
+<td>A pointer to the new handler function. Passing an invalid pointer, including 0, has undefined behaviour and it will likely result in a segmentation fault. </td>
+</tr></tbody>
+</table></div>
+<p>
+</p>
+<p><span class="bold"><strong>Returns:</strong></span> The previously set handler function pointer.</p>
+<p><span class="bold"><strong>See:</strong></span> Throw on Failure annex for an example. </p>
+</div>
+</div>
+<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
+<td align="left"></td>
+<td align="right"><div class="copyright-footer">Copyright &#169; 2009, 2010 Lorenzo Caminiti<p>
+ Distributed under the Contract++ Software License, Version 1.0 (see accompanying
+ file LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="contract_failed_handler.html"><img src="../images/prev.png" alt="Prev"></a><a accesskey="u" href="../reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.assert_hpp"><img src="../images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../images/home.png" alt="Home"></a><a accesskey="n" href="block_invariant_failed.html"><img src="../images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>

Added: sandbox/contract/libs/contract/doc/html/contract/set_class_invariant_failed.html
==============================================================================
--- (empty file)
+++ sandbox/contract/libs/contract/doc/html/contract/set_class_invariant_failed.html 2011-06-28 20:54:41 EDT (Tue, 28 Jun 2011)
@@ -0,0 +1,64 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
+<title>Function set_class_invariant_failed</title>
+<link rel="stylesheet" href="../doc/html/boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
+<link rel="home" href="../index.html" title="Contract++ 0.3.490">
+<link rel="up" href="../reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.assert_hpp" title="Header &lt;E:/sandbox/contractpp/trunk/doc/qbk/src/contract/assert.hpp&gt;">
+<link rel="prev" href="block_invariant_failed.html" title="Function block_invariant_failed">
+<link rel="next" href="class_invariant_failed.html" title="Function class_invariant_failed">
+</head>
+<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
+<table cellpadding="2" width="100%"><tr><td valign="top"></td></tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="block_invariant_failed.html"><img src="../images/prev.png" alt="Prev"></a><a accesskey="u" href="../reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.assert_hpp"><img src="../images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../images/home.png" alt="Home"></a><a accesskey="n" href="class_invariant_failed.html"><img src="../images/next.png" alt="Next"></a>
+</div>
+<div class="refentry">
+<a name="contract.set_class_invariant_failed"></a><div class="titlepage"></div>
+<div class="refnamediv">
+<h2><span class="refentrytitle">Function set_class_invariant_failed</span></h2>
+<p>contract::set_class_invariant_failed</p>
+</div>
+<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
+<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="comment">// In header: &lt;<a class="link" href="../reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.assert_hpp" title="Header &lt;E:/sandbox/contractpp/trunk/doc/qbk/src/contract/assert.hpp&gt;">E:/sandbox/contractpp/trunk/doc/qbk/src/contract/assert.hpp</a>&gt;
+
+</span>
+<span class="identifier">contract_failed_handler</span>
+<span class="identifier">set_class_invariant_failed</span><span class="special">(</span><span class="identifier">contract_failed_handler</span> handler<span class="special">)</span><span class="special">;</span></pre></div>
+<div class="refsect1">
+<a name="id960695"></a><h2>Description</h2>
+<p>Set the specified user defined handler function to call on class invariant failure.</p>
+<p>This function can be used by programmers to specify an action to take in case of class invariant failure different from the default to terminate the program.</p>
+<p><span class="bold"><strong>Parameters:</strong></span> </p>
+<div class="informaltable"><table class="table">
+<colgroup>
+<col>
+<col>
+</colgroup>
+<tbody><tr>
+<td><span class="bold"><strong><code class="computeroutput">handler</code></strong></span></td>
+<td>A pointer to the new handler function. Passing an invalid pointer, including 0, has undefined behaviour and it will likely result in a segmentation fault. </td>
+</tr></tbody>
+</table></div>
+<p>
+</p>
+<p><span class="bold"><strong>Returns:</strong></span> The previously set handler function pointer.</p>
+<p><span class="bold"><strong>See:</strong></span> Throw on Failure annex for an example. </p>
+</div>
+</div>
+<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
+<td align="left"></td>
+<td align="right"><div class="copyright-footer">Copyright &#169; 2009, 2010 Lorenzo Caminiti<p>
+ Distributed under the Contract++ Software License, Version 1.0 (see accompanying
+ file LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="block_invariant_failed.html"><img src="../images/prev.png" alt="Prev"></a><a accesskey="u" href="../reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.assert_hpp"><img src="../images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../images/home.png" alt="Home"></a><a accesskey="n" href="class_invariant_failed.html"><img src="../images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>

Added: sandbox/contract/libs/contract/doc/html/contract/set_postcondition_failed.html
==============================================================================
--- (empty file)
+++ sandbox/contract/libs/contract/doc/html/contract/set_postcondition_failed.html 2011-06-28 20:54:41 EDT (Tue, 28 Jun 2011)
@@ -0,0 +1,64 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
+<title>Function set_postcondition_failed</title>
+<link rel="stylesheet" href="../doc/html/boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
+<link rel="home" href="../index.html" title="Contract++ 0.3.490">
+<link rel="up" href="../reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.assert_hpp" title="Header &lt;E:/sandbox/contractpp/trunk/doc/qbk/src/contract/assert.hpp&gt;">
+<link rel="prev" href="precondition_failed.html" title="Function precondition_failed">
+<link rel="next" href="postcondition_failed.html" title="Function postcondition_failed">
+</head>
+<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
+<table cellpadding="2" width="100%"><tr><td valign="top"></td></tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="precondition_failed.html"><img src="../images/prev.png" alt="Prev"></a><a accesskey="u" href="../reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.assert_hpp"><img src="../images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../images/home.png" alt="Home"></a><a accesskey="n" href="postcondition_failed.html"><img src="../images/next.png" alt="Next"></a>
+</div>
+<div class="refentry">
+<a name="contract.set_postcondition_failed"></a><div class="titlepage"></div>
+<div class="refnamediv">
+<h2><span class="refentrytitle">Function set_postcondition_failed</span></h2>
+<p>contract::set_postcondition_failed</p>
+</div>
+<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
+<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="comment">// In header: &lt;<a class="link" href="../reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.assert_hpp" title="Header &lt;E:/sandbox/contractpp/trunk/doc/qbk/src/contract/assert.hpp&gt;">E:/sandbox/contractpp/trunk/doc/qbk/src/contract/assert.hpp</a>&gt;
+
+</span>
+<span class="identifier">contract_failed_handler</span>
+<span class="identifier">set_postcondition_failed</span><span class="special">(</span><span class="identifier">contract_failed_handler</span> handler<span class="special">)</span><span class="special">;</span></pre></div>
+<div class="refsect1">
+<a name="id961279"></a><h2>Description</h2>
+<p>Set the specified user defined handler function to call on postcondition failure.</p>
+<p>This function can be used by programmers to specify an action to take in case of postcondition failure different from the default to terminate the program.</p>
+<p><span class="bold"><strong>Parameters:</strong></span> </p>
+<div class="informaltable"><table class="table">
+<colgroup>
+<col>
+<col>
+</colgroup>
+<tbody><tr>
+<td><span class="bold"><strong><code class="computeroutput">handler</code></strong></span></td>
+<td>A pointer to the new handler function. Passing an invalid pointer, including 0, has undefined behaviour and it will likely result in a segmentation fault. </td>
+</tr></tbody>
+</table></div>
+<p>
+</p>
+<p><span class="bold"><strong>Returns:</strong></span> The previously set handler function pointer.</p>
+<p><span class="bold"><strong>See:</strong></span> Throw on Failure annex for an example. </p>
+</div>
+</div>
+<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
+<td align="left"></td>
+<td align="right"><div class="copyright-footer">Copyright &#169; 2009, 2010 Lorenzo Caminiti<p>
+ Distributed under the Contract++ Software License, Version 1.0 (see accompanying
+ file LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="precondition_failed.html"><img src="../images/prev.png" alt="Prev"></a><a accesskey="u" href="../reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.assert_hpp"><img src="../images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../images/home.png" alt="Home"></a><a accesskey="n" href="postcondition_failed.html"><img src="../images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>

Added: sandbox/contract/libs/contract/doc/html/contract/set_precondition_failed.html
==============================================================================
--- (empty file)
+++ sandbox/contract/libs/contract/doc/html/contract/set_precondition_failed.html 2011-06-28 20:54:41 EDT (Tue, 28 Jun 2011)
@@ -0,0 +1,64 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
+<title>Function set_precondition_failed</title>
+<link rel="stylesheet" href="../doc/html/boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
+<link rel="home" href="../index.html" title="Contract++ 0.3.490">
+<link rel="up" href="../reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.assert_hpp" title="Header &lt;E:/sandbox/contractpp/trunk/doc/qbk/src/contract/assert.hpp&gt;">
+<link rel="prev" href="class_invariant_failed.html" title="Function class_invariant_failed">
+<link rel="next" href="precondition_failed.html" title="Function precondition_failed">
+</head>
+<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
+<table cellpadding="2" width="100%"><tr><td valign="top"></td></tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="class_invariant_failed.html"><img src="../images/prev.png" alt="Prev"></a><a accesskey="u" href="../reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.assert_hpp"><img src="../images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../images/home.png" alt="Home"></a><a accesskey="n" href="precondition_failed.html"><img src="../images/next.png" alt="Next"></a>
+</div>
+<div class="refentry">
+<a name="contract.set_precondition_failed"></a><div class="titlepage"></div>
+<div class="refnamediv">
+<h2><span class="refentrytitle">Function set_precondition_failed</span></h2>
+<p>contract::set_precondition_failed</p>
+</div>
+<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
+<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="comment">// In header: &lt;<a class="link" href="../reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.assert_hpp" title="Header &lt;E:/sandbox/contractpp/trunk/doc/qbk/src/contract/assert.hpp&gt;">E:/sandbox/contractpp/trunk/doc/qbk/src/contract/assert.hpp</a>&gt;
+
+</span>
+<span class="identifier">contract_failed_handler</span>
+<span class="identifier">set_precondition_failed</span><span class="special">(</span><span class="identifier">contract_failed_handler</span> handler<span class="special">)</span><span class="special">;</span></pre></div>
+<div class="refsect1">
+<a name="id960987"></a><h2>Description</h2>
+<p>Set the specified user defined handler function to call on precondition failure.</p>
+<p>This function can be used by programmers to specify an action to take in case of precondition failure different from the default to terminate the program.</p>
+<p><span class="bold"><strong>Parameters:</strong></span> </p>
+<div class="informaltable"><table class="table">
+<colgroup>
+<col>
+<col>
+</colgroup>
+<tbody><tr>
+<td><span class="bold"><strong><code class="computeroutput">handler</code></strong></span></td>
+<td>A pointer to the new handler function. Passing an invalid pointer, including 0, has undefined behaviour and it will likely result in a segmentation fault. </td>
+</tr></tbody>
+</table></div>
+<p>
+</p>
+<p><span class="bold"><strong>Returns:</strong></span> The previously set handler function pointer.</p>
+<p><span class="bold"><strong>See:</strong></span> Throw on Failure annex for an example. </p>
+</div>
+</div>
+<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
+<td align="left"></td>
+<td align="right"><div class="copyright-footer">Copyright &#169; 2009, 2010 Lorenzo Caminiti<p>
+ Distributed under the Contract++ Software License, Version 1.0 (see accompanying
+ file LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="class_invariant_failed.html"><img src="../images/prev.png" alt="Prev"></a><a accesskey="u" href="../reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.assert_hpp"><img src="../images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../images/home.png" alt="Home"></a><a accesskey="n" href="precondition_failed.html"><img src="../images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>

Added: sandbox/contract/libs/contract/doc/html/contract/state.html
==============================================================================
--- (empty file)
+++ sandbox/contract/libs/contract/doc/html/contract/state.html 2011-06-28 20:54:41 EDT (Tue, 28 Jun 2011)
@@ -0,0 +1,52 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
+<title>Class state</title>
+<link rel="stylesheet" href="../doc/html/boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
+<link rel="home" href="../index.html" title="Contract++ 0.3.490">
+<link rel="up" href="../reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.state_hpp" title="Header &lt;E:/sandbox/contractpp/trunk/doc/qbk/src/contract/state.hpp&gt;">
+<link rel="prev" href="../CONTRACT_OLDOF.html" title="Macro CONTRACT_OLDOF">
+<link rel="next" href="static_member_function.html" title="Class template static_member_function">
+</head>
+<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
+<table cellpadding="2" width="100%"><tr><td valign="top"></td></tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="../CONTRACT_OLDOF.html"><img src="../images/prev.png" alt="Prev"></a><a accesskey="u" href="../reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.state_hpp"><img src="../images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../images/home.png" alt="Home"></a><a accesskey="n" href="static_member_function.html"><img src="../images/next.png" alt="Next"></a>
+</div>
+<div class="refentry">
+<a name="contract.state"></a><div class="titlepage"></div>
+<div class="refnamediv">
+<h2><span class="refentrytitle">Class state</span></h2>
+<p>contract::state</p>
+</div>
+<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
+<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="comment">// In header: &lt;<a class="link" href="../reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.state_hpp" title="Header &lt;E:/sandbox/contractpp/trunk/doc/qbk/src/contract/state.hpp&gt;">E:/sandbox/contractpp/trunk/doc/qbk/src/contract/state.hpp</a>&gt;
+
+</span>
+<span class="keyword">class</span> <a class="link" href="state.html" title="Class state">state</a> <span class="special">{</span>
+<span class="special">}</span><span class="special">;</span></pre></div>
+<div class="refsect1">
+<a name="id979661"></a><h2>Description</h2>
+<p>Augmented object state internally used by the library.</p>
+<p>As illustrated by the <code class="computeroutput"><a class="link" href="nonstatic_member_function.html" title="Class template nonstatic_member_function">contract::nonstatic_member_function</a></code> documentation, the class being contracted must declare a (private) member variable named <code class="computeroutput">contract_state_</code> of <code class="computeroutput">mutable</code> type <code class="computeroutput"><a class="link" href="state.html" title="Class state">contract::state</a></code> (see <code class="computeroutput"><a class="link" href="nonstatic_member_function.html" title="Class template nonstatic_member_function">contract::nonstatic_member_function</a></code> for example code). The type <code class="computeroutput"><a class="link" href="state.html" title="Class state">contract::state</a></code> must be declared a friend of the class. This member variable is automatically declared when the <code class="computeroutput">CONTRACT_INVARIANT()</code> macro is used (recommended).</p>
+<p>This library will generate a compile-time error if this state variable is not declared and accessible to the contracts.</p>
+<p><span class="bold"><strong>Note:</strong></span> This member variable is used internally by this library mainly to track when assertions are being checked so to disable assertion checking in nested function calls that could otherwise lead to infinite recursion (this is a common requirement for Contract Programming). The friendship is requires so the library internally has access to the entire user class including non public members.</p>
+<p><span class="bold"><strong>See:</strong></span> <code class="computeroutput"><a class="link" href="nonstatic_member_function.html" title="Class template nonstatic_member_function">contract::nonstatic_member_function</a></code>, Without the Macros section </p>
+</div>
+</div>
+<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
+<td align="left"></td>
+<td align="right"><div class="copyright-footer">Copyright &#169; 2009, 2010 Lorenzo Caminiti<p>
+ Distributed under the Contract++ Software License, Version 1.0 (see accompanying
+ file LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="../CONTRACT_OLDOF.html"><img src="../images/prev.png" alt="Prev"></a><a accesskey="u" href="../reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.state_hpp"><img src="../images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../images/home.png" alt="Home"></a><a accesskey="n" href="static_member_function.html"><img src="../images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>

Added: sandbox/contract/libs/contract/doc/html/contract/static_member_function.html
==============================================================================
--- (empty file)
+++ sandbox/contract/libs/contract/doc/html/contract/static_member_function.html 2011-06-28 20:54:41 EDT (Tue, 28 Jun 2011)
@@ -0,0 +1,176 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
+<title>Class template static_member_function</title>
+<link rel="stylesheet" href="../doc/html/boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
+<link rel="home" href="../index.html" title="Contract++ 0.3.490">
+<link rel="up" href="../reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.static_member_function_hpp" title="Header &lt;E:/sandbox/contractpp/trunk/doc/qbk/src/contract/static_member_function.hpp&gt;">
+<link rel="prev" href="state.html" title="Class state">
+<link rel="next" href="wrap.html" title="Struct template wrap">
+</head>
+<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
+<table cellpadding="2" width="100%"><tr><td valign="top"></td></tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="state.html"><img src="../images/prev.png" alt="Prev"></a><a accesskey="u" href="../reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.static_member_function_hpp"><img src="../images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../images/home.png" alt="Home"></a><a accesskey="n" href="wrap.html"><img src="../images/next.png" alt="Next"></a>
+</div>
+<div class="refentry">
+<a name="contract.static_member_function"></a><div class="titlepage"></div>
+<div class="refnamediv">
+<h2><span class="refentrytitle">Class template static_member_function</span></h2>
+<p>contract::static_member_function</p>
+</div>
+<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
+<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="comment">// In header: &lt;<a class="link" href="../reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.static_member_function_hpp" title="Header &lt;E:/sandbox/contractpp/trunk/doc/qbk/src/contract/static_member_function.hpp&gt;">E:/sandbox/contractpp/trunk/doc/qbk/src/contract/static_member_function.hpp</a>&gt;
+
+</span><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> F<span class="special">&gt;</span>
+<span class="keyword">class</span> <a class="link" href="static_member_function.html" title="Class template static_member_function">static_member_function</a> <span class="special">{</span>
+<span class="keyword">public</span><span class="special">:</span>
+ <span class="comment">// <a class="link" href="static_member_function.html#contract.static_member_functionconstruct-copy-destruct">construct/copy/destruct</a></span>
+ <a class="link" href="static_member_function.html#id438808-bb"><span class="identifier">static_member_function</span></a><span class="special">(</span><span class="identifier">__BodyFunctionPointer__</span><span class="special">,</span>
+ <span class="identifier">__PreconditionFunctionPointer__</span><span class="special">,</span>
+ <span class="identifier">__PostconditionFunctionPointer__</span><span class="special">)</span><span class="special">;</span>
+ <a class="link" href="static_member_function.html#id439005-bb"><span class="special">~</span><span class="identifier">static_member_function</span></a><span class="special">(</span><span class="special">)</span><span class="special">;</span>
+
+ <span class="comment">// <a class="link" href="static_member_function.html#id438752-bb">public member functions</a></span>
+ <span class="identifier">ResultType</span> <a class="link" href="static_member_function.html#id438756-bb"><span class="identifier">call</span></a><span class="special">(</span><span class="identifier">ArgumentType1</span><span class="special">,</span> <span class="special">...</span><span class="special">,</span> <span class="identifier">ArgumetnTypeN</span><span class="special">)</span><span class="special">;</span>
+<span class="special">}</span><span class="special">;</span></pre></div>
+<div class="refsect1">
+<a name="id980167"></a><h2>Description</h2>
+<p>Class template used to write contracts for static member functions.</p>
+<p><span class="bold"><strong>Note:</strong></span> Only the differences between this class and the <code class="computeroutput"><a class="link" href="nonstatic_member_function.html" title="Class template nonstatic_member_function">contract::nonstatic_member_function</a></code> class are documented here. Read the <code class="computeroutput"><a class="link" href="nonstatic_member_function.html" title="Class template nonstatic_member_function">contract::nonstatic_member_function</a></code> documentation first.</p>
+<p>The <code class="computeroutput">CONTRACT_FUNCTION()</code> macro expands to code that uses this class template (when <code class="computeroutput">(static)</code> is specified in the function signature sequence, see the Without the Macros section) -- whenever possible, use the macro instead of using this class template directly. Rarely, it might be needed to use this template class directly to implement workarounds for compilers that do not fully comply with the ISO C++ standard.</p>
+<p><span class="bold"><strong>Parameters:</strong></span> </p>
+<div class="informaltable"><table class="table">
+<colgroup>
+<col>
+<col>
+</colgroup>
+<tbody><tr>
+<td><span class="bold"><strong><code class="computeroutput">F</code></strong></span></td>
+<td>The function type of the static member function being contracted. </td>
+</tr></tbody>
+</table></div>
+<p>
+</p>
+<p>Base contract classes cannot be specified because static member functions cannot be virtual and they cannot override base virtual functions so they cannot subcontract.</p>
+<p>The function type <code class="computeroutput">F</code> must be specified as follows: </p>
+<pre class="programlisting"> <span class="identifier">ResultType</span> <span class="special">(</span><span class="identifier">ClassType</span><span class="special">*</span><span class="special">,</span> <span class="identifier">ArgumentType1</span><span class="special">,</span> <span class="special">...</span><span class="special">,</span> <span class="identifier">ArgumentTypeN</span><span class="special">)</span>
+</pre>
+<p> Note: </p>
+<div class="itemizedlist"><ul class="itemizedlist" type="disc">
+<li class="listitem"><p><code class="computeroutput">ClassType</code> is never <code class="computeroutput">const</code> because static member functions cannot be constant member functions (there is no object to not modify). </p></li>
+<li class="listitem"><p><code class="computeroutput">ClassType</code> cannot be tagged <code class="computeroutput"><a class="link" href="copyable.html" title="Class template copyable">contract::copyable</a></code> because there is no object for static member functions -- the library will generate a compile-time error otherwise.</p></li>
+</ul></div>
+<p>
+<span class="bold"><strong>See:</strong></span> Without the Macros section, <code class="computeroutput"><a class="link" href="nonstatic_member_function.html" title="Class template nonstatic_member_function">contract::nonstatic_member_function</a></code> </p>
+<div class="refsect2">
+<a name="id980412"></a><h3>
+<a name="contract.static_member_functionconstruct-copy-destruct"></a><code class="computeroutput">static_member_function</code>
+ public
+ construct/copy/destruct</h3>
+<div class="orderedlist"><ol class="orderedlist" type="1">
+<li class="listitem">
+<pre class="literallayout"><a name="id438808-bb"></a><span class="identifier">static_member_function</span><span class="special">(</span><span class="identifier">__BodyFunctionPointer__</span> body_function<span class="special">,</span>
+ <span class="identifier">__PreconditionFunctionPointer__</span> precondition_function<span class="special">,</span>
+ <span class="identifier">__PostconditionFunctionPointer__</span> postcondition_function<span class="special">)</span><span class="special">;</span></pre>
+<p>Construct this contract object using the specified body, preconditions, and postconditions functions.</p>
+<p><span class="bold"><strong>Parameters:</strong></span> </p>
+<div class="informaltable"><table class="table">
+<colgroup>
+<col>
+<col>
+</colgroup>
+<tbody>
+<tr>
+<td><span class="bold"><strong><code class="computeroutput">body_function</code></strong></span></td>
+<td>A pointer to the function executing the body. </td>
+</tr>
+<tr>
+<td><span class="bold"><strong><code class="computeroutput">precondition_function</code></strong></span></td>
+<td>A pointer to the function asserting the preconditions. </td>
+</tr>
+<tr>
+<td><span class="bold"><strong><code class="computeroutput">postcondition_function</code></strong></span></td>
+<td>A pointer to the function asserting the postconditions. </td>
+</tr>
+</tbody>
+</table></div>
+<p>
+</p>
+<p>Refer to the <code class="computeroutput"><code class="computeroutput"><a class="link" href="nonstatic_member_function.html" title="Class template nonstatic_member_function">contract::nonstatic_member_function</a></code></code> documentation for the definition of metaprogramming constructs used below (<code class="computeroutput">__IfCopyable__</code>, etc).</p>
+<p>Note the followings for the function pointer types defined below: </p>
+<div class="itemizedlist"><ul class="itemizedlist" type="disc">
+<li class="listitem"><p>They are static member functions (they do not specify the class type as in <code class="computeroutput">(ClassType::*)</code> but only the function pointer <code class="computeroutput">(*)</code>). </p></li>
+<li class="listitem"><p>They are never <code class="computeroutput">const</code> member functions because they are <code class="computeroutput">static</code>. </p></li>
+<li class="listitem"><p>There is no old object value in postconditions, not even <code class="computeroutput">contract::noold</code> (because static member functions have no object).</p></li>
+</ul></div>
+<p>
+The body function pointer type is defined as follows: </p>
+<pre class="programlisting"> typedef ResultType (* __BodyFunctionPointer__)
+ ( __RemoveCopyable__&lt; ArgumentType1 &gt;,
+ ...,
+ __RemoveCopyable__&lt; ArgumentTypeN &gt;
+ );
+</pre>
+<p>The precondition function pointer type is defined as follows: </p>
+<pre class="programlisting"> typedef ResultType (* __PreconditionFunctionPointer__)
+ ( boost::add_reference&lt;boost::add_const&lt;
+ __RemoveCopyable__&lt; ArgumentType1 &gt; &gt;::type&gt;::type,
+ ...,
+ boost::add_reference&lt;boost::add_const&lt;
+ __RemoveCopyable__&lt; ArgumentTypeN &gt; &gt;::type&gt;::type
+ );
+</pre>
+<p>The postcondition function pointer type is defined as follows: </p>
+<pre class="programlisting"> typedef ResultType (* __PreconditionFunctionPointer__)
+ ( boost::add_reference&lt;boost::add_const&lt;
+ __RemoveCopyable&lt; ArgumentType1 &gt; &gt;::type&gt;::type,
+ __IfCopyable__&lt; ArgumentType1,
+ boost::add_reference&lt;boost::add_const&lt;
+ __RemoveCopyable__&lt; ArgumentType1 &gt; &gt;::type&gt;::type &gt;,
+ ...,
+ boost::add_reference&lt;boost::add_const&lt;
+ __RemoveCopyable__&lt; ArgumentTypeN &gt; &gt;::type&gt;::type,
+ __IfCopyable__&lt; ArgumentTypeN,
+ boost::add_reference&lt;boost::add_const&lt;
+ __RemoveCopyable&lt; ArgumentTypeN &gt; &gt;::type&gt;::type &gt;,
+ __IfNonVoid__&lt; boost::add_reference&lt;boost::add_const&lt;
+ ResultType&gt;::type&gt;::type &gt;
+ );
+</pre>
+<p> </p>
+</li>
+<li class="listitem">
+<pre class="literallayout"><a name="id439005-bb"></a><span class="special">~</span><span class="identifier">static_member_function</span><span class="special">(</span><span class="special">)</span><span class="special">;</span></pre>
+<p>Destroy this contract object. </p>
+</li>
+</ol></div>
+</div>
+<div class="refsect2">
+<a name="id980759"></a><h3>
+<a name="id438752-bb"></a><code class="computeroutput">static_member_function</code> public member functions</h3>
+<div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem">
+<pre class="literallayout"><span class="identifier">ResultType</span> <a name="id438756-bb"></a><span class="identifier">call</span><span class="special">(</span><span class="identifier">ArgumentType1</span> argument1<span class="special">,</span> <span class="special">...</span><span class="special">,</span> <span class="identifier">ArgumetnTypeN</span> argumentN<span class="special">)</span><span class="special">;</span></pre>
+<p>Check the contract and executes the member function body.</p>
+<p>Refer to the <code class="computeroutput"><code class="computeroutput"><a class="link" href="nonstatic_member_function.html" title="Class template nonstatic_member_function">contract::nonstatic_member_function</a></code></code> documentation.</p>
+<p>The <code class="computeroutput">call()</code> function takes no object (because the contracted function is static). </p>
+</li></ol></div>
+</div>
+</div>
+</div>
+<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
+<td align="left"></td>
+<td align="right"><div class="copyright-footer">Copyright &#169; 2009, 2010 Lorenzo Caminiti<p>
+ Distributed under the Contract++ Software License, Version 1.0 (see accompanying
+ file LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="state.html"><img src="../images/prev.png" alt="Prev"></a><a accesskey="u" href="../reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.static_member_function_hpp"><img src="../images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../images/home.png" alt="Home"></a><a accesskey="n" href="wrap.html"><img src="../images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>

Added: sandbox/contract/libs/contract/doc/html/contract/wrap.html
==============================================================================
--- (empty file)
+++ sandbox/contract/libs/contract/doc/html/contract/wrap.html 2011-06-28 20:54:41 EDT (Tue, 28 Jun 2011)
@@ -0,0 +1,50 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
+<title>Struct template wrap</title>
+<link rel="stylesheet" href="../doc/html/boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
+<link rel="home" href="../index.html" title="Contract++ 0.3.490">
+<link rel="up" href="../reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.wrap_hpp" title="Header &lt;E:/sandbox/contractpp/trunk/doc/qbk/src/contract/wrap.hpp&gt;">
+<link rel="prev" href="static_member_function.html" title="Class template static_member_function">
+<link rel="next" href="wrap_void_T__id439081.html" title="Struct template wrap&lt;void(T)&gt;">
+</head>
+<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
+<table cellpadding="2" width="100%"><tr><td valign="top"></td></tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="static_member_function.html"><img src="../images/prev.png" alt="Prev"></a><a accesskey="u" href="../reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.wrap_hpp"><img src="../images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../images/home.png" alt="Home"></a><a accesskey="n" href="wrap_void_T__id439081.html"><img src="../images/next.png" alt="Next"></a>
+</div>
+<div class="refentry">
+<a name="contract.wrap"></a><div class="titlepage"></div>
+<div class="refnamediv">
+<h2><span class="refentrytitle">Struct template wrap</span></h2>
+<p>contract::wrap</p>
+</div>
+<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
+<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="comment">// In header: &lt;<a class="link" href="../reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.wrap_hpp" title="Header &lt;E:/sandbox/contractpp/trunk/doc/qbk/src/contract/wrap.hpp&gt;">E:/sandbox/contractpp/trunk/doc/qbk/src/contract/wrap.hpp</a>&gt;
+
+</span><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> T<span class="special">&gt;</span>
+<span class="keyword">struct</span> <a class="link" href="wrap.html" title="Struct template wrap">wrap</a> <span class="special">{</span>
+<span class="special">}</span><span class="special">;</span></pre></div>
+<div class="refsect1">
+<a name="id981160"></a><h2>Description</h2>
+<p>Metafunction used to wrap type expressions containing commas so they can be passed as macro parameters.</p>
+<p><span class="bold"><strong>Warning:</strong></span> Attempting to use this template directly will generate a compile-time error. Only the template specialization <code class="computeroutput"><a class="link" href="wrap.html" title="Struct template wrap">contract::wrap</a>&lt;void(T)&gt;</code> can be used.</p>
+<p><span class="bold"><strong>See:</strong></span> <code class="computeroutput"><a class="link" href="wrap.html" title="Struct template wrap">contract::wrap</a>&lt;void(T)&gt;</code> specialization, <code class="computeroutput">CONTRACT_WRAP_TYPE()</code> </p>
+</div>
+</div>
+<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
+<td align="left"></td>
+<td align="right"><div class="copyright-footer">Copyright &#169; 2009, 2010 Lorenzo Caminiti<p>
+ Distributed under the Contract++ Software License, Version 1.0 (see accompanying
+ file LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="static_member_function.html"><img src="../images/prev.png" alt="Prev"></a><a accesskey="u" href="../reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.wrap_hpp"><img src="../images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../images/home.png" alt="Home"></a><a accesskey="n" href="wrap_void_T__id439081.html"><img src="../images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>

Added: sandbox/contract/libs/contract/doc/html/contract/wrap_void_T__id2358596.html
==============================================================================
--- (empty file)
+++ sandbox/contract/libs/contract/doc/html/contract/wrap_void_T__id2358596.html 2011-06-28 20:54:41 EDT (Tue, 28 Jun 2011)
@@ -0,0 +1,75 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>Struct template wrap&lt;void(T)&gt;</title>
+<link rel="stylesheet" href="../doc/html/boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.73.2">
+<link rel="start" href="../index.html" title="Contract++ 0.3.490">
+<link rel="up" href="../reference.html#header..home.lcaminiti.sandbox.dbcpp_sourceforge.boost-quickbook.doc.qbk.src.contract.wrap_hpp" title="Header &lt;contract/wrap.hpp&gt;">
+<link rel="prev" href="wrap.html" title="Struct template wrap">
+<link rel="next" href="../CONTRACT_WRAP_TYPE.html" title="Macro CONTRACT_WRAP_TYPE">
+</head>
+<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
+<div class="spirit-nav">
+<a accesskey="p" href="wrap.html"><img src=".././doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../reference.html#header..home.lcaminiti.sandbox.dbcpp_sourceforge.boost-quickbook.doc.qbk.src.contract.wrap_hpp"><img src=".././doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src=".././doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="../CONTRACT_WRAP_TYPE.html"><img src=".././doc/html/images/next.png" alt="Next"></a>
+</div>
+<hr>
+<div class="refentry" lang="en">
+<a name="contract.wrap_void(T)_id2358596"></a><div class="titlepage"></div>
+<div class="refnamediv">
+<h2><span class="refentrytitle">Struct template wrap&lt;void(T)&gt;</span></h2>
+<p>contract::wrap&lt;void(T)&gt;</p>
+</div>
+<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
+<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="emphasis"><em>// In header: &lt;<a class="link" href="../reference.html#header..home.lcaminiti.sandbox.dbcpp_sourceforge.boost-quickbook.doc.qbk.src.contract.wrap_hpp" title="Header &lt;contract/wrap.hpp&gt;">contract/wrap.hpp</a>&gt;
+
+</em></span><span class="bold"><strong>template</strong></span>&lt;<span class="bold"><strong>typename</strong></span> T&gt;
+<span class="bold"><strong>struct</strong></span> <a class="link" href="wrap_void_T__id2358596.html" title="Struct template wrap&lt;void(T)&gt;">wrap</a>&lt;<span class="bold"><strong>void</strong></span>(T)&gt; {
+ <span class="emphasis"><em>// <a class="link" href="wrap_void_T__id2358596.html#contract.wrap_void(T)_id2358596types">types</a></em></span>
+ <span class="bold"><strong>typedef</strong></span> T <a class="link" href="wrap_void_T__id2358596.html#contract.wrap_void(T)_id2358596.type">type</a>;
+};</pre></div>
+<div class="refsect1" lang="en">
+<a name="id2670329"></a><h2>Description</h2>
+<p>Metafunction used to wrap type expressions containing commas so they can be passed as macro parameters.</p>
+<p>This metafunction first wrap the specified type <code class="computeroutput">T</code> within parenthesis <code class="computeroutput"></code>() (so <code class="computeroutput">T</code> can be passed as a single macro parameter even if it contains commas) forming a void-function type with one argument of type <code class="computeroutput">T</code>. Then the application of the metafunction via its member <code class="computeroutput">type</code> returns the wrapped type <code class="computeroutput">T</code>.</p>
+<p><span class="bold"><strong>Parameters:</strong></span> </p>
+<div class="informaltable"><table class="table">
+<colgroup>
+<col>
+<col>
+</colgroup>
+<tbody><tr>
+<td><span class="bold"><strong><code class="computeroutput">T</code></strong></span></td>
+<td>Type to be wrapped so it can be passed within a macro parameter even if it contains commas. </td>
+</tr></tbody>
+</table></div>
+<p>
+</p>
+<p><span class="bold"><strong>See:</strong></span> CONTRACT_WRAP_TYPE() for more explanation and examples </p>
+<div class="refsect2" lang="en">
+<a name="id2670413"></a><h3>
+<a name="contract.wrap_void(T)_id2358596types"></a><code class="computeroutput">wrap</code>
+ public
+ types</h3>
+<div class="orderedlist"><ol type="1"><li>
+<p>
+<span class="bold"><strong>typedef</strong></span> T <a name="contract.wrap_void(T)_id2358596.type"></a>type;</p>
+<p>The type T. </p>
+</li></ol></div>
+</div>
+</div>
+</div>
+<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
+<td align="left"></td>
+<td align="right"><div class="copyright-footer">Copyright © 2009 -2010 Lorenzo Caminiti<p>
+ Distributed under the Contract++ Software License, Version 1.0 (see accompanying
+ file LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="wrap.html"><img src=".././doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../reference.html#header..home.lcaminiti.sandbox.dbcpp_sourceforge.boost-quickbook.doc.qbk.src.contract.wrap_hpp"><img src=".././doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src=".././doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="../CONTRACT_WRAP_TYPE.html"><img src=".././doc/html/images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>

Added: sandbox/contract/libs/contract/doc/html/contract/wrap_void_T__id437056.html
==============================================================================
--- (empty file)
+++ sandbox/contract/libs/contract/doc/html/contract/wrap_void_T__id437056.html 2011-06-28 20:54:41 EDT (Tue, 28 Jun 2011)
@@ -0,0 +1,76 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
+<title>Struct template wrap&lt;void(T)&gt;</title>
+<link rel="stylesheet" href="../doc/html/boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
+<link rel="home" href="../index.html" title="Contract++ 0.3.490">
+<link rel="up" href="../reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.wrap_hpp" title="Header &lt;E:/sandbox/contractpp/trunk/doc/qbk/src/contract/wrap.hpp&gt;">
+<link rel="prev" href="wrap.html" title="Struct template wrap">
+<link rel="next" href="../CONTRACT_WRAP_TYPE.html" title="Macro CONTRACT_WRAP_TYPE">
+</head>
+<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
+<table cellpadding="2" width="100%"><tr><td valign="top"></td></tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="wrap.html"><img src="../images/prev.png" alt="Prev"></a><a accesskey="u" href="../reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.wrap_hpp"><img src="../images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../images/home.png" alt="Home"></a><a accesskey="n" href="../CONTRACT_WRAP_TYPE.html"><img src="../images/next.png" alt="Next"></a>
+</div>
+<div class="refentry">
+<a name="contract.wrap_void(T)_id437056"></a><div class="titlepage"></div>
+<div class="refnamediv">
+<h2><span class="refentrytitle">Struct template wrap&lt;void(T)&gt;</span></h2>
+<p>contract::wrap&lt;void(T)&gt;</p>
+</div>
+<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
+<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="comment">// In header: &lt;<a class="link" href="../reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.wrap_hpp" title="Header &lt;E:/sandbox/contractpp/trunk/doc/qbk/src/contract/wrap.hpp&gt;">E:/sandbox/contractpp/trunk/doc/qbk/src/contract/wrap.hpp</a>&gt;
+
+</span><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> T<span class="special">&gt;</span>
+<span class="keyword">struct</span> <a class="link" href="wrap_void_T__id437056.html" title="Struct template wrap&lt;void(T)&gt;">wrap</a><span class="special">&lt;</span><span class="keyword">void</span><span class="special">(</span><span class="identifier">T</span><span class="special">)</span><span class="special">&gt;</span> <span class="special">{</span>
+ <span class="comment">// <a class="link" href="wrap_void_T__id437056.html#contract.wrap_void(T)_id437056types">types</a></span>
+ <span class="keyword">typedef</span> <span class="identifier">T</span> <a class="link" href="wrap_void_T__id437056.html#contract.wrap_void(T)_id437056.type"><span class="identifier">type</span></a><span class="special">;</span>
+<span class="special">}</span><span class="special">;</span></pre></div>
+<div class="refsect1">
+<a name="id980612"></a><h2>Description</h2>
+<p>Metafunction used to wrap type expressions containing commas so they can be passed as macro parameters.</p>
+<p>This metafunction first wrap the specified type <code class="computeroutput">T</code> within parenthesis <code class="computeroutput"></code>() (so <code class="computeroutput">T</code> can be passed as a single macro parameter even if it contains commas) forming a void-function type with one argument of type <code class="computeroutput">T</code>. Then the application of the metafunction via its member <code class="computeroutput">type</code> returns the wrapped type <code class="computeroutput">T</code>.</p>
+<p><span class="bold"><strong>Parameters:</strong></span> </p>
+<div class="informaltable"><table class="table">
+<colgroup>
+<col>
+<col>
+</colgroup>
+<tbody><tr>
+<td><span class="bold"><strong><code class="computeroutput">T</code></strong></span></td>
+<td>Type to be wrapped so it can be passed within a macro parameter even if it contains commas. </td>
+</tr></tbody>
+</table></div>
+<p>
+</p>
+<p><span class="bold"><strong>See:</strong></span> CONTRACT_WRAP_TYPE() for more explanation and examples </p>
+<div class="refsect2">
+<a name="id980704"></a><h3>
+<a name="contract.wrap_void(T)_id437056types"></a><code class="computeroutput">wrap</code>
+ public
+ types</h3>
+<div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem">
+<p>
+<span class="keyword">typedef</span> <span class="identifier">T</span> <a name="contract.wrap_void(T)_id437056.type"></a><span class="identifier">type</span><span class="special">;</span></p>
+<p>The type T. </p>
+</li></ol></div>
+</div>
+</div>
+</div>
+<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
+<td align="left"></td>
+<td align="right"><div class="copyright-footer">Copyright &#169; 2009, 2010 Lorenzo Caminiti<p>
+ Distributed under the Contract++ Software License, Version 1.0 (see accompanying
+ file LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="wrap.html"><img src="../images/prev.png" alt="Prev"></a><a accesskey="u" href="../reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.wrap_hpp"><img src="../images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../images/home.png" alt="Home"></a><a accesskey="n" href="../CONTRACT_WRAP_TYPE.html"><img src="../images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>

Added: sandbox/contract/libs/contract/doc/html/contract/wrap_void_T__id437106.html
==============================================================================
--- (empty file)
+++ sandbox/contract/libs/contract/doc/html/contract/wrap_void_T__id437106.html 2011-06-28 20:54:41 EDT (Tue, 28 Jun 2011)
@@ -0,0 +1,76 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
+<title>Struct template wrap&lt;void(T)&gt;</title>
+<link rel="stylesheet" href="../doc/html/boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
+<link rel="home" href="../index.html" title="Contract++ 0.3.490">
+<link rel="up" href="../reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.wrap_hpp" title="Header &lt;E:/sandbox/contractpp/trunk/doc/qbk/src/contract/wrap.hpp&gt;">
+<link rel="prev" href="wrap.html" title="Struct template wrap">
+<link rel="next" href="../CONTRACT_WRAP_TYPE.html" title="Macro CONTRACT_WRAP_TYPE">
+</head>
+<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
+<table cellpadding="2" width="100%"><tr><td valign="top"></td></tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="wrap.html"><img src="../images/prev.png" alt="Prev"></a><a accesskey="u" href="../reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.wrap_hpp"><img src="../images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../images/home.png" alt="Home"></a><a accesskey="n" href="../CONTRACT_WRAP_TYPE.html"><img src="../images/next.png" alt="Next"></a>
+</div>
+<div class="refentry">
+<a name="contract.wrap_void(T)_id437106"></a><div class="titlepage"></div>
+<div class="refnamediv">
+<h2><span class="refentrytitle">Struct template wrap&lt;void(T)&gt;</span></h2>
+<p>contract::wrap&lt;void(T)&gt;</p>
+</div>
+<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
+<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="comment">// In header: &lt;<a class="link" href="../reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.wrap_hpp" title="Header &lt;E:/sandbox/contractpp/trunk/doc/qbk/src/contract/wrap.hpp&gt;">E:/sandbox/contractpp/trunk/doc/qbk/src/contract/wrap.hpp</a>&gt;
+
+</span><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> T<span class="special">&gt;</span>
+<span class="keyword">struct</span> <a class="link" href="wrap_void_T__id437106.html" title="Struct template wrap&lt;void(T)&gt;">wrap</a><span class="special">&lt;</span><span class="keyword">void</span><span class="special">(</span><span class="identifier">T</span><span class="special">)</span><span class="special">&gt;</span> <span class="special">{</span>
+ <span class="comment">// <a class="link" href="wrap_void_T__id437106.html#contract.wrap_void(T)_id437106types">types</a></span>
+ <span class="keyword">typedef</span> <span class="identifier">T</span> <a class="link" href="wrap_void_T__id437106.html#contract.wrap_void(T)_id437106.type"><span class="identifier">type</span></a><span class="special">;</span>
+<span class="special">}</span><span class="special">;</span></pre></div>
+<div class="refsect1">
+<a name="id980573"></a><h2>Description</h2>
+<p>Metafunction used to wrap type expressions containing commas so they can be passed as macro parameters.</p>
+<p>This metafunction first wrap the specified type <code class="computeroutput">T</code> within parenthesis <code class="computeroutput"></code>() (so <code class="computeroutput">T</code> can be passed as a single macro parameter even if it contains commas) forming a void-function type with one argument of type <code class="computeroutput">T</code>. Then the application of the metafunction via its member <code class="computeroutput">type</code> returns the wrapped type <code class="computeroutput">T</code>.</p>
+<p><span class="bold"><strong>Parameters:</strong></span> </p>
+<div class="informaltable"><table class="table">
+<colgroup>
+<col>
+<col>
+</colgroup>
+<tbody><tr>
+<td><span class="bold"><strong><code class="computeroutput">T</code></strong></span></td>
+<td>Type to be wrapped so it can be passed within a macro parameter even if it contains commas. </td>
+</tr></tbody>
+</table></div>
+<p>
+</p>
+<p><span class="bold"><strong>See:</strong></span> CONTRACT_WRAP_TYPE() for more explanation and examples </p>
+<div class="refsect2">
+<a name="id980665"></a><h3>
+<a name="contract.wrap_void(T)_id437106types"></a><code class="computeroutput">wrap</code>
+ public
+ types</h3>
+<div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem">
+<p>
+<span class="keyword">typedef</span> <span class="identifier">T</span> <a name="contract.wrap_void(T)_id437106.type"></a><span class="identifier">type</span><span class="special">;</span></p>
+<p>The type T. </p>
+</li></ol></div>
+</div>
+</div>
+</div>
+<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
+<td align="left"></td>
+<td align="right"><div class="copyright-footer">Copyright &#169; 2009, 2010 Lorenzo Caminiti<p>
+ Distributed under the Contract++ Software License, Version 1.0 (see accompanying
+ file LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="wrap.html"><img src="../images/prev.png" alt="Prev"></a><a accesskey="u" href="../reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.wrap_hpp"><img src="../images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../images/home.png" alt="Home"></a><a accesskey="n" href="../CONTRACT_WRAP_TYPE.html"><img src="../images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>

Added: sandbox/contract/libs/contract/doc/html/contract/wrap_void_T__id437174.html
==============================================================================
--- (empty file)
+++ sandbox/contract/libs/contract/doc/html/contract/wrap_void_T__id437174.html 2011-06-28 20:54:41 EDT (Tue, 28 Jun 2011)
@@ -0,0 +1,76 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
+<title>Struct template wrap&lt;void(T)&gt;</title>
+<link rel="stylesheet" href="../doc/html/boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
+<link rel="home" href="../index.html" title="Contract++ 0.3.490">
+<link rel="up" href="../reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.wrap_hpp" title="Header &lt;E:/sandbox/contractpp/trunk/doc/qbk/src/contract/wrap.hpp&gt;">
+<link rel="prev" href="wrap.html" title="Struct template wrap">
+<link rel="next" href="../CONTRACT_WRAP_TYPE.html" title="Macro CONTRACT_WRAP_TYPE">
+</head>
+<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
+<table cellpadding="2" width="100%"><tr><td valign="top"></td></tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="wrap.html"><img src="../images/prev.png" alt="Prev"></a><a accesskey="u" href="../reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.wrap_hpp"><img src="../images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../images/home.png" alt="Home"></a><a accesskey="n" href="../CONTRACT_WRAP_TYPE.html"><img src="../images/next.png" alt="Next"></a>
+</div>
+<div class="refentry">
+<a name="contract.wrap_void(T)_id437174"></a><div class="titlepage"></div>
+<div class="refnamediv">
+<h2><span class="refentrytitle">Struct template wrap&lt;void(T)&gt;</span></h2>
+<p>contract::wrap&lt;void(T)&gt;</p>
+</div>
+<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
+<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="comment">// In header: &lt;<a class="link" href="../reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.wrap_hpp" title="Header &lt;E:/sandbox/contractpp/trunk/doc/qbk/src/contract/wrap.hpp&gt;">E:/sandbox/contractpp/trunk/doc/qbk/src/contract/wrap.hpp</a>&gt;
+
+</span><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> T<span class="special">&gt;</span>
+<span class="keyword">struct</span> <a class="link" href="wrap_void_T__id437174.html" title="Struct template wrap&lt;void(T)&gt;">wrap</a><span class="special">&lt;</span><span class="keyword">void</span><span class="special">(</span><span class="identifier">T</span><span class="special">)</span><span class="special">&gt;</span> <span class="special">{</span>
+ <span class="comment">// <a class="link" href="wrap_void_T__id437174.html#contract.wrap_void(T)_id437174types">types</a></span>
+ <span class="keyword">typedef</span> <span class="identifier">T</span> <a class="link" href="wrap_void_T__id437174.html#contract.wrap_void(T)_id437174.type"><span class="identifier">type</span></a><span class="special">;</span>
+<span class="special">}</span><span class="special">;</span></pre></div>
+<div class="refsect1">
+<a name="id980590"></a><h2>Description</h2>
+<p>Metafunction used to wrap type expressions containing commas so they can be passed as macro parameters.</p>
+<p>This metafunction first wrap the specified type <code class="computeroutput">T</code> within parenthesis <code class="computeroutput"></code>() (so <code class="computeroutput">T</code> can be passed as a single macro parameter even if it contains commas) forming a void-function type with one argument of type <code class="computeroutput">T</code>. Then the application of the metafunction via its member <code class="computeroutput">type</code> returns the wrapped type <code class="computeroutput">T</code>.</p>
+<p><span class="bold"><strong>Parameters:</strong></span> </p>
+<div class="informaltable"><table class="table">
+<colgroup>
+<col>
+<col>
+</colgroup>
+<tbody><tr>
+<td><span class="bold"><strong><code class="computeroutput">T</code></strong></span></td>
+<td>Type to be wrapped so it can be passed within a macro parameter even if it contains commas. </td>
+</tr></tbody>
+</table></div>
+<p>
+</p>
+<p><span class="bold"><strong>See:</strong></span> CONTRACT_WRAP_TYPE() for more explanation and examples </p>
+<div class="refsect2">
+<a name="id980681"></a><h3>
+<a name="contract.wrap_void(T)_id437174types"></a><code class="computeroutput">wrap</code>
+ public
+ types</h3>
+<div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem">
+<p>
+<span class="keyword">typedef</span> <span class="identifier">T</span> <a name="contract.wrap_void(T)_id437174.type"></a><span class="identifier">type</span><span class="special">;</span></p>
+<p>The type T. </p>
+</li></ol></div>
+</div>
+</div>
+</div>
+<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
+<td align="left"></td>
+<td align="right"><div class="copyright-footer">Copyright &#169; 2009, 2010 Lorenzo Caminiti<p>
+ Distributed under the Contract++ Software License, Version 1.0 (see accompanying
+ file LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="wrap.html"><img src="../images/prev.png" alt="Prev"></a><a accesskey="u" href="../reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.wrap_hpp"><img src="../images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../images/home.png" alt="Home"></a><a accesskey="n" href="../CONTRACT_WRAP_TYPE.html"><img src="../images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>

Added: sandbox/contract/libs/contract/doc/html/contract/wrap_void_T__id437179.html
==============================================================================
--- (empty file)
+++ sandbox/contract/libs/contract/doc/html/contract/wrap_void_T__id437179.html 2011-06-28 20:54:41 EDT (Tue, 28 Jun 2011)
@@ -0,0 +1,76 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
+<title>Struct template wrap&lt;void(T)&gt;</title>
+<link rel="stylesheet" href="../doc/html/boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
+<link rel="home" href="../index.html" title="Contract++ 0.3.490">
+<link rel="up" href="../reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.wrap_hpp" title="Header &lt;E:/sandbox/contractpp/trunk/doc/qbk/src/contract/wrap.hpp&gt;">
+<link rel="prev" href="wrap.html" title="Struct template wrap">
+<link rel="next" href="../CONTRACT_WRAP_TYPE.html" title="Macro CONTRACT_WRAP_TYPE">
+</head>
+<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
+<table cellpadding="2" width="100%"><tr><td valign="top"></td></tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="wrap.html"><img src="../images/prev.png" alt="Prev"></a><a accesskey="u" href="../reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.wrap_hpp"><img src="../images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../images/home.png" alt="Home"></a><a accesskey="n" href="../CONTRACT_WRAP_TYPE.html"><img src="../images/next.png" alt="Next"></a>
+</div>
+<div class="refentry">
+<a name="contract.wrap_void(T)_id437179"></a><div class="titlepage"></div>
+<div class="refnamediv">
+<h2><span class="refentrytitle">Struct template wrap&lt;void(T)&gt;</span></h2>
+<p>contract::wrap&lt;void(T)&gt;</p>
+</div>
+<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
+<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="comment">// In header: &lt;<a class="link" href="../reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.wrap_hpp" title="Header &lt;E:/sandbox/contractpp/trunk/doc/qbk/src/contract/wrap.hpp&gt;">E:/sandbox/contractpp/trunk/doc/qbk/src/contract/wrap.hpp</a>&gt;
+
+</span><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> T<span class="special">&gt;</span>
+<span class="keyword">struct</span> <a class="link" href="wrap_void_T__id437179.html" title="Struct template wrap&lt;void(T)&gt;">wrap</a><span class="special">&lt;</span><span class="keyword">void</span><span class="special">(</span><span class="identifier">T</span><span class="special">)</span><span class="special">&gt;</span> <span class="special">{</span>
+ <span class="comment">// <a class="link" href="wrap_void_T__id437179.html#contract.wrap_void(T)_id437179types">types</a></span>
+ <span class="keyword">typedef</span> <span class="identifier">T</span> <a class="link" href="wrap_void_T__id437179.html#contract.wrap_void(T)_id437179.type"><span class="identifier">type</span></a><span class="special">;</span>
+<span class="special">}</span><span class="special">;</span></pre></div>
+<div class="refsect1">
+<a name="id980590"></a><h2>Description</h2>
+<p>Metafunction used to wrap type expressions containing commas so they can be passed as macro parameters.</p>
+<p>This metafunction first wrap the specified type <code class="computeroutput">T</code> within parenthesis <code class="computeroutput"></code>() (so <code class="computeroutput">T</code> can be passed as a single macro parameter even if it contains commas) forming a void-function type with one argument of type <code class="computeroutput">T</code>. Then the application of the metafunction via its member <code class="computeroutput">type</code> returns the wrapped type <code class="computeroutput">T</code>.</p>
+<p><span class="bold"><strong>Parameters:</strong></span> </p>
+<div class="informaltable"><table class="table">
+<colgroup>
+<col>
+<col>
+</colgroup>
+<tbody><tr>
+<td><span class="bold"><strong><code class="computeroutput">T</code></strong></span></td>
+<td>Type to be wrapped so it can be passed within a macro parameter even if it contains commas. </td>
+</tr></tbody>
+</table></div>
+<p>
+</p>
+<p><span class="bold"><strong>See:</strong></span> CONTRACT_WRAP_TYPE() for more explanation and examples </p>
+<div class="refsect2">
+<a name="id980682"></a><h3>
+<a name="contract.wrap_void(T)_id437179types"></a><code class="computeroutput">wrap</code>
+ public
+ types</h3>
+<div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem">
+<p>
+<span class="keyword">typedef</span> <span class="identifier">T</span> <a name="contract.wrap_void(T)_id437179.type"></a><span class="identifier">type</span><span class="special">;</span></p>
+<p>The type T. </p>
+</li></ol></div>
+</div>
+</div>
+</div>
+<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
+<td align="left"></td>
+<td align="right"><div class="copyright-footer">Copyright &#169; 2009, 2010 Lorenzo Caminiti<p>
+ Distributed under the Contract++ Software License, Version 1.0 (see accompanying
+ file LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="wrap.html"><img src="../images/prev.png" alt="Prev"></a><a accesskey="u" href="../reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.wrap_hpp"><img src="../images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../images/home.png" alt="Home"></a><a accesskey="n" href="../CONTRACT_WRAP_TYPE.html"><img src="../images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>

Added: sandbox/contract/libs/contract/doc/html/contract/wrap_void_T__id437181.html
==============================================================================
--- (empty file)
+++ sandbox/contract/libs/contract/doc/html/contract/wrap_void_T__id437181.html 2011-06-28 20:54:41 EDT (Tue, 28 Jun 2011)
@@ -0,0 +1,76 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
+<title>Struct template wrap&lt;void(T)&gt;</title>
+<link rel="stylesheet" href="../doc/html/boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
+<link rel="home" href="../index.html" title="Contract++ 0.3.490">
+<link rel="up" href="../reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.wrap_hpp" title="Header &lt;E:/sandbox/contractpp/trunk/doc/qbk/src/contract/wrap.hpp&gt;">
+<link rel="prev" href="wrap.html" title="Struct template wrap">
+<link rel="next" href="../CONTRACT_WRAP_TYPE.html" title="Macro CONTRACT_WRAP_TYPE">
+</head>
+<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
+<table cellpadding="2" width="100%"><tr><td valign="top"></td></tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="wrap.html"><img src="../images/prev.png" alt="Prev"></a><a accesskey="u" href="../reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.wrap_hpp"><img src="../images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../images/home.png" alt="Home"></a><a accesskey="n" href="../CONTRACT_WRAP_TYPE.html"><img src="../images/next.png" alt="Next"></a>
+</div>
+<div class="refentry">
+<a name="contract.wrap_void(T)_id437181"></a><div class="titlepage"></div>
+<div class="refnamediv">
+<h2><span class="refentrytitle">Struct template wrap&lt;void(T)&gt;</span></h2>
+<p>contract::wrap&lt;void(T)&gt;</p>
+</div>
+<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
+<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="comment">// In header: &lt;<a class="link" href="../reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.wrap_hpp" title="Header &lt;E:/sandbox/contractpp/trunk/doc/qbk/src/contract/wrap.hpp&gt;">E:/sandbox/contractpp/trunk/doc/qbk/src/contract/wrap.hpp</a>&gt;
+
+</span><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> T<span class="special">&gt;</span>
+<span class="keyword">struct</span> <a class="link" href="wrap_void_T__id437181.html" title="Struct template wrap&lt;void(T)&gt;">wrap</a><span class="special">&lt;</span><span class="keyword">void</span><span class="special">(</span><span class="identifier">T</span><span class="special">)</span><span class="special">&gt;</span> <span class="special">{</span>
+ <span class="comment">// <a class="link" href="wrap_void_T__id437181.html#contract.wrap_void(T)_id437181types">types</a></span>
+ <span class="keyword">typedef</span> <span class="identifier">T</span> <a class="link" href="wrap_void_T__id437181.html#contract.wrap_void(T)_id437181.type"><span class="identifier">type</span></a><span class="special">;</span>
+<span class="special">}</span><span class="special">;</span></pre></div>
+<div class="refsect1">
+<a name="id980590"></a><h2>Description</h2>
+<p>Metafunction used to wrap type expressions containing commas so they can be passed as macro parameters.</p>
+<p>This metafunction first wrap the specified type <code class="computeroutput">T</code> within parenthesis <code class="computeroutput"></code>() (so <code class="computeroutput">T</code> can be passed as a single macro parameter even if it contains commas) forming a void-function type with one argument of type <code class="computeroutput">T</code>. Then the application of the metafunction via its member <code class="computeroutput">type</code> returns the wrapped type <code class="computeroutput">T</code>.</p>
+<p><span class="bold"><strong>Parameters:</strong></span> </p>
+<div class="informaltable"><table class="table">
+<colgroup>
+<col>
+<col>
+</colgroup>
+<tbody><tr>
+<td><span class="bold"><strong><code class="computeroutput">T</code></strong></span></td>
+<td>Type to be wrapped so it can be passed within a macro parameter even if it contains commas. </td>
+</tr></tbody>
+</table></div>
+<p>
+</p>
+<p><span class="bold"><strong>See:</strong></span> CONTRACT_WRAP_TYPE() for more explanation and examples </p>
+<div class="refsect2">
+<a name="id980681"></a><h3>
+<a name="contract.wrap_void(T)_id437181types"></a><code class="computeroutput">wrap</code>
+ public
+ types</h3>
+<div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem">
+<p>
+<span class="keyword">typedef</span> <span class="identifier">T</span> <a name="contract.wrap_void(T)_id437181.type"></a><span class="identifier">type</span><span class="special">;</span></p>
+<p>The type T. </p>
+</li></ol></div>
+</div>
+</div>
+</div>
+<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
+<td align="left"></td>
+<td align="right"><div class="copyright-footer">Copyright &#169; 2009, 2010 Lorenzo Caminiti<p>
+ Distributed under the Contract++ Software License, Version 1.0 (see accompanying
+ file LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="wrap.html"><img src="../images/prev.png" alt="Prev"></a><a accesskey="u" href="../reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.wrap_hpp"><img src="../images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../images/home.png" alt="Home"></a><a accesskey="n" href="../CONTRACT_WRAP_TYPE.html"><img src="../images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>

Added: sandbox/contract/libs/contract/doc/html/contract/wrap_void_T__id437240.html
==============================================================================
--- (empty file)
+++ sandbox/contract/libs/contract/doc/html/contract/wrap_void_T__id437240.html 2011-06-28 20:54:41 EDT (Tue, 28 Jun 2011)
@@ -0,0 +1,76 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
+<title>Struct template wrap&lt;void(T)&gt;</title>
+<link rel="stylesheet" href="../doc/html/boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
+<link rel="home" href="../index.html" title="Contract++ 0.3.490">
+<link rel="up" href="../reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.wrap_hpp" title="Header &lt;E:/sandbox/contractpp/trunk/doc/qbk/src/contract/wrap.hpp&gt;">
+<link rel="prev" href="wrap.html" title="Struct template wrap">
+<link rel="next" href="../CONTRACT_WRAP_TYPE.html" title="Macro CONTRACT_WRAP_TYPE">
+</head>
+<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
+<table cellpadding="2" width="100%"><tr><td valign="top"></td></tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="wrap.html"><img src="../images/prev.png" alt="Prev"></a><a accesskey="u" href="../reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.wrap_hpp"><img src="../images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../images/home.png" alt="Home"></a><a accesskey="n" href="../CONTRACT_WRAP_TYPE.html"><img src="../images/next.png" alt="Next"></a>
+</div>
+<div class="refentry">
+<a name="contract.wrap_void(T)_id437240"></a><div class="titlepage"></div>
+<div class="refnamediv">
+<h2><span class="refentrytitle">Struct template wrap&lt;void(T)&gt;</span></h2>
+<p>contract::wrap&lt;void(T)&gt;</p>
+</div>
+<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
+<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="comment">// In header: &lt;<a class="link" href="../reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.wrap_hpp" title="Header &lt;E:/sandbox/contractpp/trunk/doc/qbk/src/contract/wrap.hpp&gt;">E:/sandbox/contractpp/trunk/doc/qbk/src/contract/wrap.hpp</a>&gt;
+
+</span><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> T<span class="special">&gt;</span>
+<span class="keyword">struct</span> <a class="link" href="wrap_void_T__id437240.html" title="Struct template wrap&lt;void(T)&gt;">wrap</a><span class="special">&lt;</span><span class="keyword">void</span><span class="special">(</span><span class="identifier">T</span><span class="special">)</span><span class="special">&gt;</span> <span class="special">{</span>
+ <span class="comment">// <a class="link" href="wrap_void_T__id437240.html#contract.wrap_void(T)_id437240types">types</a></span>
+ <span class="keyword">typedef</span> <span class="identifier">T</span> <a class="link" href="wrap_void_T__id437240.html#contract.wrap_void(T)_id437240.type"><span class="identifier">type</span></a><span class="special">;</span>
+<span class="special">}</span><span class="special">;</span></pre></div>
+<div class="refsect1">
+<a name="id980593"></a><h2>Description</h2>
+<p>Metafunction used to wrap type expressions containing commas so they can be passed as macro parameters.</p>
+<p>This metafunction first wrap the specified type <code class="computeroutput">T</code> within parenthesis <code class="computeroutput"></code>() (so <code class="computeroutput">T</code> can be passed as a single macro parameter even if it contains commas) forming a void-function type with one argument of type <code class="computeroutput">T</code>. Then the application of the metafunction via its member <code class="computeroutput">type</code> returns the wrapped type <code class="computeroutput">T</code>.</p>
+<p><span class="bold"><strong>Parameters:</strong></span> </p>
+<div class="informaltable"><table class="table">
+<colgroup>
+<col>
+<col>
+</colgroup>
+<tbody><tr>
+<td><span class="bold"><strong><code class="computeroutput">T</code></strong></span></td>
+<td>Type to be wrapped so it can be passed within a macro parameter even if it contains commas. </td>
+</tr></tbody>
+</table></div>
+<p>
+</p>
+<p><span class="bold"><strong>See:</strong></span> CONTRACT_WRAP_TYPE() for more explanation and examples </p>
+<div class="refsect2">
+<a name="id980684"></a><h3>
+<a name="contract.wrap_void(T)_id437240types"></a><code class="computeroutput">wrap</code>
+ public
+ types</h3>
+<div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem">
+<p>
+<span class="keyword">typedef</span> <span class="identifier">T</span> <a name="contract.wrap_void(T)_id437240.type"></a><span class="identifier">type</span><span class="special">;</span></p>
+<p>The type T. </p>
+</li></ol></div>
+</div>
+</div>
+</div>
+<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
+<td align="left"></td>
+<td align="right"><div class="copyright-footer">Copyright &#169; 2009, 2010 Lorenzo Caminiti<p>
+ Distributed under the Contract++ Software License, Version 1.0 (see accompanying
+ file LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="wrap.html"><img src="../images/prev.png" alt="Prev"></a><a accesskey="u" href="../reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.wrap_hpp"><img src="../images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../images/home.png" alt="Home"></a><a accesskey="n" href="../CONTRACT_WRAP_TYPE.html"><img src="../images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>

Added: sandbox/contract/libs/contract/doc/html/contract/wrap_void_T__id437311.html
==============================================================================
--- (empty file)
+++ sandbox/contract/libs/contract/doc/html/contract/wrap_void_T__id437311.html 2011-06-28 20:54:41 EDT (Tue, 28 Jun 2011)
@@ -0,0 +1,76 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
+<title>Struct template wrap&lt;void(T)&gt;</title>
+<link rel="stylesheet" href="../doc/html/boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
+<link rel="home" href="../index.html" title="Contract++ 0.3.490">
+<link rel="up" href="../reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.wrap_hpp" title="Header &lt;E:/sandbox/contractpp/trunk/doc/qbk/src/contract/wrap.hpp&gt;">
+<link rel="prev" href="wrap.html" title="Struct template wrap">
+<link rel="next" href="../CONTRACT_WRAP_TYPE.html" title="Macro CONTRACT_WRAP_TYPE">
+</head>
+<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
+<table cellpadding="2" width="100%"><tr><td valign="top"></td></tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="wrap.html"><img src="../images/prev.png" alt="Prev"></a><a accesskey="u" href="../reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.wrap_hpp"><img src="../images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../images/home.png" alt="Home"></a><a accesskey="n" href="../CONTRACT_WRAP_TYPE.html"><img src="../images/next.png" alt="Next"></a>
+</div>
+<div class="refentry">
+<a name="contract.wrap_void(T)_id437311"></a><div class="titlepage"></div>
+<div class="refnamediv">
+<h2><span class="refentrytitle">Struct template wrap&lt;void(T)&gt;</span></h2>
+<p>contract::wrap&lt;void(T)&gt;</p>
+</div>
+<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
+<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="comment">// In header: &lt;<a class="link" href="../reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.wrap_hpp" title="Header &lt;E:/sandbox/contractpp/trunk/doc/qbk/src/contract/wrap.hpp&gt;">E:/sandbox/contractpp/trunk/doc/qbk/src/contract/wrap.hpp</a>&gt;
+
+</span><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> T<span class="special">&gt;</span>
+<span class="keyword">struct</span> <a class="link" href="wrap_void_T__id437311.html" title="Struct template wrap&lt;void(T)&gt;">wrap</a><span class="special">&lt;</span><span class="keyword">void</span><span class="special">(</span><span class="identifier">T</span><span class="special">)</span><span class="special">&gt;</span> <span class="special">{</span>
+ <span class="comment">// <a class="link" href="wrap_void_T__id437311.html#contract.wrap_void(T)_id437311types">types</a></span>
+ <span class="keyword">typedef</span> <span class="identifier">T</span> <a class="link" href="wrap_void_T__id437311.html#contract.wrap_void(T)_id437311.type"><span class="identifier">type</span></a><span class="special">;</span>
+<span class="special">}</span><span class="special">;</span></pre></div>
+<div class="refsect1">
+<a name="id980570"></a><h2>Description</h2>
+<p>Metafunction used to wrap type expressions containing commas so they can be passed as macro parameters.</p>
+<p>This metafunction first wrap the specified type <code class="computeroutput">T</code> within parenthesis <code class="computeroutput"></code>() (so <code class="computeroutput">T</code> can be passed as a single macro parameter even if it contains commas) forming a void-function type with one argument of type <code class="computeroutput">T</code>. Then the application of the metafunction via its member <code class="computeroutput">type</code> returns the wrapped type <code class="computeroutput">T</code>.</p>
+<p><span class="bold"><strong>Parameters:</strong></span> </p>
+<div class="informaltable"><table class="table">
+<colgroup>
+<col>
+<col>
+</colgroup>
+<tbody><tr>
+<td><span class="bold"><strong><code class="computeroutput">T</code></strong></span></td>
+<td>Type to be wrapped so it can be passed within a macro parameter even if it contains commas. </td>
+</tr></tbody>
+</table></div>
+<p>
+</p>
+<p><span class="bold"><strong>See:</strong></span> CONTRACT_WRAP_TYPE() for more explanation and examples </p>
+<div class="refsect2">
+<a name="id980661"></a><h3>
+<a name="contract.wrap_void(T)_id437311types"></a><code class="computeroutput">wrap</code>
+ public
+ types</h3>
+<div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem">
+<p>
+<span class="keyword">typedef</span> <span class="identifier">T</span> <a name="contract.wrap_void(T)_id437311.type"></a><span class="identifier">type</span><span class="special">;</span></p>
+<p>The type T. </p>
+</li></ol></div>
+</div>
+</div>
+</div>
+<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
+<td align="left"></td>
+<td align="right"><div class="copyright-footer">Copyright &#169; 2009, 2010 Lorenzo Caminiti<p>
+ Distributed under the Contract++ Software License, Version 1.0 (see accompanying
+ file LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="wrap.html"><img src="../images/prev.png" alt="Prev"></a><a accesskey="u" href="../reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.wrap_hpp"><img src="../images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../images/home.png" alt="Home"></a><a accesskey="n" href="../CONTRACT_WRAP_TYPE.html"><img src="../images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>

Added: sandbox/contract/libs/contract/doc/html/contract/wrap_void_T__id437312.html
==============================================================================
--- (empty file)
+++ sandbox/contract/libs/contract/doc/html/contract/wrap_void_T__id437312.html 2011-06-28 20:54:41 EDT (Tue, 28 Jun 2011)
@@ -0,0 +1,76 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
+<title>Struct template wrap&lt;void(T)&gt;</title>
+<link rel="stylesheet" href="../doc/html/boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
+<link rel="home" href="../index.html" title="Contract++ 0.3.490">
+<link rel="up" href="../reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.wrap_hpp" title="Header &lt;E:/sandbox/contractpp/trunk/doc/qbk/src/contract/wrap.hpp&gt;">
+<link rel="prev" href="wrap.html" title="Struct template wrap">
+<link rel="next" href="../CONTRACT_WRAP_TYPE.html" title="Macro CONTRACT_WRAP_TYPE">
+</head>
+<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
+<table cellpadding="2" width="100%"><tr><td valign="top"></td></tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="wrap.html"><img src="../images/prev.png" alt="Prev"></a><a accesskey="u" href="../reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.wrap_hpp"><img src="../images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../images/home.png" alt="Home"></a><a accesskey="n" href="../CONTRACT_WRAP_TYPE.html"><img src="../images/next.png" alt="Next"></a>
+</div>
+<div class="refentry">
+<a name="contract.wrap_void(T)_id437312"></a><div class="titlepage"></div>
+<div class="refnamediv">
+<h2><span class="refentrytitle">Struct template wrap&lt;void(T)&gt;</span></h2>
+<p>contract::wrap&lt;void(T)&gt;</p>
+</div>
+<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
+<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="comment">// In header: &lt;<a class="link" href="../reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.wrap_hpp" title="Header &lt;E:/sandbox/contractpp/trunk/doc/qbk/src/contract/wrap.hpp&gt;">E:/sandbox/contractpp/trunk/doc/qbk/src/contract/wrap.hpp</a>&gt;
+
+</span><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> T<span class="special">&gt;</span>
+<span class="keyword">struct</span> <a class="link" href="wrap_void_T__id437312.html" title="Struct template wrap&lt;void(T)&gt;">wrap</a><span class="special">&lt;</span><span class="keyword">void</span><span class="special">(</span><span class="identifier">T</span><span class="special">)</span><span class="special">&gt;</span> <span class="special">{</span>
+ <span class="comment">// <a class="link" href="wrap_void_T__id437312.html#contract.wrap_void(T)_id437312types">types</a></span>
+ <span class="keyword">typedef</span> <span class="identifier">T</span> <a class="link" href="wrap_void_T__id437312.html#contract.wrap_void(T)_id437312.type"><span class="identifier">type</span></a><span class="special">;</span>
+<span class="special">}</span><span class="special">;</span></pre></div>
+<div class="refsect1">
+<a name="id980590"></a><h2>Description</h2>
+<p>Metafunction used to wrap type expressions containing commas so they can be passed as macro parameters.</p>
+<p>This metafunction first wrap the specified type <code class="computeroutput">T</code> within parenthesis <code class="computeroutput"></code>() (so <code class="computeroutput">T</code> can be passed as a single macro parameter even if it contains commas) forming a void-function type with one argument of type <code class="computeroutput">T</code>. Then the application of the metafunction via its member <code class="computeroutput">type</code> returns the wrapped type <code class="computeroutput">T</code>.</p>
+<p><span class="bold"><strong>Parameters:</strong></span> </p>
+<div class="informaltable"><table class="table">
+<colgroup>
+<col>
+<col>
+</colgroup>
+<tbody><tr>
+<td><span class="bold"><strong><code class="computeroutput">T</code></strong></span></td>
+<td>Type to be wrapped so it can be passed within a macro parameter even if it contains commas. </td>
+</tr></tbody>
+</table></div>
+<p>
+</p>
+<p><span class="bold"><strong>See:</strong></span> CONTRACT_WRAP_TYPE() for more explanation and examples </p>
+<div class="refsect2">
+<a name="id980681"></a><h3>
+<a name="contract.wrap_void(T)_id437312types"></a><code class="computeroutput">wrap</code>
+ public
+ types</h3>
+<div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem">
+<p>
+<span class="keyword">typedef</span> <span class="identifier">T</span> <a name="contract.wrap_void(T)_id437312.type"></a><span class="identifier">type</span><span class="special">;</span></p>
+<p>The type T. </p>
+</li></ol></div>
+</div>
+</div>
+</div>
+<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
+<td align="left"></td>
+<td align="right"><div class="copyright-footer">Copyright &#169; 2009, 2010 Lorenzo Caminiti<p>
+ Distributed under the Contract++ Software License, Version 1.0 (see accompanying
+ file LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="wrap.html"><img src="../images/prev.png" alt="Prev"></a><a accesskey="u" href="../reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.wrap_hpp"><img src="../images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../images/home.png" alt="Home"></a><a accesskey="n" href="../CONTRACT_WRAP_TYPE.html"><img src="../images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>

Added: sandbox/contract/libs/contract/doc/html/contract/wrap_void_T__id437380.html
==============================================================================
--- (empty file)
+++ sandbox/contract/libs/contract/doc/html/contract/wrap_void_T__id437380.html 2011-06-28 20:54:41 EDT (Tue, 28 Jun 2011)
@@ -0,0 +1,76 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
+<title>Struct template wrap&lt;void(T)&gt;</title>
+<link rel="stylesheet" href="../doc/html/boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
+<link rel="home" href="../index.html" title="Contract++ 0.3.490">
+<link rel="up" href="../reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.wrap_hpp" title="Header &lt;E:/sandbox/contractpp/trunk/doc/qbk/src/contract/wrap.hpp&gt;">
+<link rel="prev" href="wrap.html" title="Struct template wrap">
+<link rel="next" href="../CONTRACT_WRAP_TYPE.html" title="Macro CONTRACT_WRAP_TYPE">
+</head>
+<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
+<table cellpadding="2" width="100%"><tr><td valign="top"></td></tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="wrap.html"><img src="../images/prev.png" alt="Prev"></a><a accesskey="u" href="../reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.wrap_hpp"><img src="../images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../images/home.png" alt="Home"></a><a accesskey="n" href="../CONTRACT_WRAP_TYPE.html"><img src="../images/next.png" alt="Next"></a>
+</div>
+<div class="refentry">
+<a name="contract.wrap_void(T)_id437380"></a><div class="titlepage"></div>
+<div class="refnamediv">
+<h2><span class="refentrytitle">Struct template wrap&lt;void(T)&gt;</span></h2>
+<p>contract::wrap&lt;void(T)&gt;</p>
+</div>
+<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
+<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="comment">// In header: &lt;<a class="link" href="../reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.wrap_hpp" title="Header &lt;E:/sandbox/contractpp/trunk/doc/qbk/src/contract/wrap.hpp&gt;">E:/sandbox/contractpp/trunk/doc/qbk/src/contract/wrap.hpp</a>&gt;
+
+</span><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> T<span class="special">&gt;</span>
+<span class="keyword">struct</span> <a class="link" href="wrap_void_T__id437380.html" title="Struct template wrap&lt;void(T)&gt;">wrap</a><span class="special">&lt;</span><span class="keyword">void</span><span class="special">(</span><span class="identifier">T</span><span class="special">)</span><span class="special">&gt;</span> <span class="special">{</span>
+ <span class="comment">// <a class="link" href="wrap_void_T__id437380.html#contract.wrap_void(T)_id437380types">types</a></span>
+ <span class="keyword">typedef</span> <span class="identifier">T</span> <a class="link" href="wrap_void_T__id437380.html#contract.wrap_void(T)_id437380.type"><span class="identifier">type</span></a><span class="special">;</span>
+<span class="special">}</span><span class="special">;</span></pre></div>
+<div class="refsect1">
+<a name="id980586"></a><h2>Description</h2>
+<p>Metafunction used to wrap type expressions containing commas so they can be passed as macro parameters.</p>
+<p>This metafunction first wrap the specified type <code class="computeroutput">T</code> within parenthesis <code class="computeroutput"></code>() (so <code class="computeroutput">T</code> can be passed as a single macro parameter even if it contains commas) forming a void-function type with one argument of type <code class="computeroutput">T</code>. Then the application of the metafunction via its member <code class="computeroutput">type</code> returns the wrapped type <code class="computeroutput">T</code>.</p>
+<p><span class="bold"><strong>Parameters:</strong></span> </p>
+<div class="informaltable"><table class="table">
+<colgroup>
+<col>
+<col>
+</colgroup>
+<tbody><tr>
+<td><span class="bold"><strong><code class="computeroutput">T</code></strong></span></td>
+<td>Type to be wrapped so it can be passed within a macro parameter even if it contains commas. </td>
+</tr></tbody>
+</table></div>
+<p>
+</p>
+<p><span class="bold"><strong>See:</strong></span> CONTRACT_WRAP_TYPE() for more explanation and examples </p>
+<div class="refsect2">
+<a name="id980678"></a><h3>
+<a name="contract.wrap_void(T)_id437380types"></a><code class="computeroutput">wrap</code>
+ public
+ types</h3>
+<div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem">
+<p>
+<span class="keyword">typedef</span> <span class="identifier">T</span> <a name="contract.wrap_void(T)_id437380.type"></a><span class="identifier">type</span><span class="special">;</span></p>
+<p>The type T. </p>
+</li></ol></div>
+</div>
+</div>
+</div>
+<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
+<td align="left"></td>
+<td align="right"><div class="copyright-footer">Copyright &#169; 2009, 2010 Lorenzo Caminiti<p>
+ Distributed under the Contract++ Software License, Version 1.0 (see accompanying
+ file LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="wrap.html"><img src="../images/prev.png" alt="Prev"></a><a accesskey="u" href="../reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.wrap_hpp"><img src="../images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../images/home.png" alt="Home"></a><a accesskey="n" href="../CONTRACT_WRAP_TYPE.html"><img src="../images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>

Added: sandbox/contract/libs/contract/doc/html/contract/wrap_void_T__id437384.html
==============================================================================
--- (empty file)
+++ sandbox/contract/libs/contract/doc/html/contract/wrap_void_T__id437384.html 2011-06-28 20:54:41 EDT (Tue, 28 Jun 2011)
@@ -0,0 +1,76 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
+<title>Struct template wrap&lt;void(T)&gt;</title>
+<link rel="stylesheet" href="../doc/html/boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
+<link rel="home" href="../index.html" title="Contract++ 0.3.490">
+<link rel="up" href="../reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.wrap_hpp" title="Header &lt;E:/sandbox/contractpp/trunk/doc/qbk/src/contract/wrap.hpp&gt;">
+<link rel="prev" href="wrap.html" title="Struct template wrap">
+<link rel="next" href="../CONTRACT_WRAP_TYPE.html" title="Macro CONTRACT_WRAP_TYPE">
+</head>
+<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
+<table cellpadding="2" width="100%"><tr><td valign="top"></td></tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="wrap.html"><img src="../images/prev.png" alt="Prev"></a><a accesskey="u" href="../reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.wrap_hpp"><img src="../images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../images/home.png" alt="Home"></a><a accesskey="n" href="../CONTRACT_WRAP_TYPE.html"><img src="../images/next.png" alt="Next"></a>
+</div>
+<div class="refentry">
+<a name="contract.wrap_void(T)_id437384"></a><div class="titlepage"></div>
+<div class="refnamediv">
+<h2><span class="refentrytitle">Struct template wrap&lt;void(T)&gt;</span></h2>
+<p>contract::wrap&lt;void(T)&gt;</p>
+</div>
+<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
+<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="comment">// In header: &lt;<a class="link" href="../reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.wrap_hpp" title="Header &lt;E:/sandbox/contractpp/trunk/doc/qbk/src/contract/wrap.hpp&gt;">E:/sandbox/contractpp/trunk/doc/qbk/src/contract/wrap.hpp</a>&gt;
+
+</span><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> T<span class="special">&gt;</span>
+<span class="keyword">struct</span> <a class="link" href="wrap_void_T__id437384.html" title="Struct template wrap&lt;void(T)&gt;">wrap</a><span class="special">&lt;</span><span class="keyword">void</span><span class="special">(</span><span class="identifier">T</span><span class="special">)</span><span class="special">&gt;</span> <span class="special">{</span>
+ <span class="comment">// <a class="link" href="wrap_void_T__id437384.html#contract.wrap_void(T)_id437384types">types</a></span>
+ <span class="keyword">typedef</span> <span class="identifier">T</span> <a class="link" href="wrap_void_T__id437384.html#contract.wrap_void(T)_id437384.type"><span class="identifier">type</span></a><span class="special">;</span>
+<span class="special">}</span><span class="special">;</span></pre></div>
+<div class="refsect1">
+<a name="id980573"></a><h2>Description</h2>
+<p>Metafunction used to wrap type expressions containing commas so they can be passed as macro parameters.</p>
+<p>This metafunction first wrap the specified type <code class="computeroutput">T</code> within parenthesis <code class="computeroutput"></code>() (so <code class="computeroutput">T</code> can be passed as a single macro parameter even if it contains commas) forming a void-function type with one argument of type <code class="computeroutput">T</code>. Then the application of the metafunction via its member <code class="computeroutput">type</code> returns the wrapped type <code class="computeroutput">T</code>.</p>
+<p><span class="bold"><strong>Parameters:</strong></span> </p>
+<div class="informaltable"><table class="table">
+<colgroup>
+<col>
+<col>
+</colgroup>
+<tbody><tr>
+<td><span class="bold"><strong><code class="computeroutput">T</code></strong></span></td>
+<td>Type to be wrapped so it can be passed within a macro parameter even if it contains commas. </td>
+</tr></tbody>
+</table></div>
+<p>
+</p>
+<p><span class="bold"><strong>See:</strong></span> CONTRACT_WRAP_TYPE() for more explanation and examples </p>
+<div class="refsect2">
+<a name="id980665"></a><h3>
+<a name="contract.wrap_void(T)_id437384types"></a><code class="computeroutput">wrap</code>
+ public
+ types</h3>
+<div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem">
+<p>
+<span class="keyword">typedef</span> <span class="identifier">T</span> <a name="contract.wrap_void(T)_id437384.type"></a><span class="identifier">type</span><span class="special">;</span></p>
+<p>The type T. </p>
+</li></ol></div>
+</div>
+</div>
+</div>
+<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
+<td align="left"></td>
+<td align="right"><div class="copyright-footer">Copyright &#169; 2009, 2010 Lorenzo Caminiti<p>
+ Distributed under the Contract++ Software License, Version 1.0 (see accompanying
+ file LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="wrap.html"><img src="../images/prev.png" alt="Prev"></a><a accesskey="u" href="../reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.wrap_hpp"><img src="../images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../images/home.png" alt="Home"></a><a accesskey="n" href="../CONTRACT_WRAP_TYPE.html"><img src="../images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>

Added: sandbox/contract/libs/contract/doc/html/contract/wrap_void_T__id437445.html
==============================================================================
--- (empty file)
+++ sandbox/contract/libs/contract/doc/html/contract/wrap_void_T__id437445.html 2011-06-28 20:54:41 EDT (Tue, 28 Jun 2011)
@@ -0,0 +1,76 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
+<title>Struct template wrap&lt;void(T)&gt;</title>
+<link rel="stylesheet" href="../doc/html/boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
+<link rel="home" href="../index.html" title="Contract++ 0.3.490">
+<link rel="up" href="../reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.wrap_hpp" title="Header &lt;E:/sandbox/contractpp/trunk/doc/qbk/src/contract/wrap.hpp&gt;">
+<link rel="prev" href="wrap.html" title="Struct template wrap">
+<link rel="next" href="../CONTRACT_WRAP_TYPE.html" title="Macro CONTRACT_WRAP_TYPE">
+</head>
+<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
+<table cellpadding="2" width="100%"><tr><td valign="top"></td></tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="wrap.html"><img src="../images/prev.png" alt="Prev"></a><a accesskey="u" href="../reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.wrap_hpp"><img src="../images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../images/home.png" alt="Home"></a><a accesskey="n" href="../CONTRACT_WRAP_TYPE.html"><img src="../images/next.png" alt="Next"></a>
+</div>
+<div class="refentry">
+<a name="contract.wrap_void(T)_id437445"></a><div class="titlepage"></div>
+<div class="refnamediv">
+<h2><span class="refentrytitle">Struct template wrap&lt;void(T)&gt;</span></h2>
+<p>contract::wrap&lt;void(T)&gt;</p>
+</div>
+<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
+<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="comment">// In header: &lt;<a class="link" href="../reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.wrap_hpp" title="Header &lt;E:/sandbox/contractpp/trunk/doc/qbk/src/contract/wrap.hpp&gt;">E:/sandbox/contractpp/trunk/doc/qbk/src/contract/wrap.hpp</a>&gt;
+
+</span><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> T<span class="special">&gt;</span>
+<span class="keyword">struct</span> <a class="link" href="wrap_void_T__id437445.html" title="Struct template wrap&lt;void(T)&gt;">wrap</a><span class="special">&lt;</span><span class="keyword">void</span><span class="special">(</span><span class="identifier">T</span><span class="special">)</span><span class="special">&gt;</span> <span class="special">{</span>
+ <span class="comment">// <a class="link" href="wrap_void_T__id437445.html#contract.wrap_void(T)_id437445types">types</a></span>
+ <span class="keyword">typedef</span> <span class="identifier">T</span> <a class="link" href="wrap_void_T__id437445.html#contract.wrap_void(T)_id437445.type"><span class="identifier">type</span></a><span class="special">;</span>
+<span class="special">}</span><span class="special">;</span></pre></div>
+<div class="refsect1">
+<a name="id980589"></a><h2>Description</h2>
+<p>Metafunction used to wrap type expressions containing commas so they can be passed as macro parameters.</p>
+<p>This metafunction first wrap the specified type <code class="computeroutput">T</code> within parenthesis <code class="computeroutput"></code>() (so <code class="computeroutput">T</code> can be passed as a single macro parameter even if it contains commas) forming a void-function type with one argument of type <code class="computeroutput">T</code>. Then the application of the metafunction via its member <code class="computeroutput">type</code> returns the wrapped type <code class="computeroutput">T</code>.</p>
+<p><span class="bold"><strong>Parameters:</strong></span> </p>
+<div class="informaltable"><table class="table">
+<colgroup>
+<col>
+<col>
+</colgroup>
+<tbody><tr>
+<td><span class="bold"><strong><code class="computeroutput">T</code></strong></span></td>
+<td>Type to be wrapped so it can be passed within a macro parameter even if it contains commas. </td>
+</tr></tbody>
+</table></div>
+<p>
+</p>
+<p><span class="bold"><strong>See:</strong></span> CONTRACT_WRAP_TYPE() for more explanation and examples </p>
+<div class="refsect2">
+<a name="id980681"></a><h3>
+<a name="contract.wrap_void(T)_id437445types"></a><code class="computeroutput">wrap</code>
+ public
+ types</h3>
+<div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem">
+<p>
+<span class="keyword">typedef</span> <span class="identifier">T</span> <a name="contract.wrap_void(T)_id437445.type"></a><span class="identifier">type</span><span class="special">;</span></p>
+<p>The type T. </p>
+</li></ol></div>
+</div>
+</div>
+</div>
+<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
+<td align="left"></td>
+<td align="right"><div class="copyright-footer">Copyright &#169; 2009, 2010 Lorenzo Caminiti<p>
+ Distributed under the Contract++ Software License, Version 1.0 (see accompanying
+ file LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="wrap.html"><img src="../images/prev.png" alt="Prev"></a><a accesskey="u" href="../reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.wrap_hpp"><img src="../images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../images/home.png" alt="Home"></a><a accesskey="n" href="../CONTRACT_WRAP_TYPE.html"><img src="../images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>

Added: sandbox/contract/libs/contract/doc/html/contract/wrap_void_T__id437465.html
==============================================================================
--- (empty file)
+++ sandbox/contract/libs/contract/doc/html/contract/wrap_void_T__id437465.html 2011-06-28 20:54:41 EDT (Tue, 28 Jun 2011)
@@ -0,0 +1,76 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
+<title>Struct template wrap&lt;void(T)&gt;</title>
+<link rel="stylesheet" href="../doc/html/boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
+<link rel="home" href="../index.html" title="Contract++ 0.3.490">
+<link rel="up" href="../reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.wrap_hpp" title="Header &lt;E:/sandbox/contractpp/trunk/doc/qbk/src/contract/wrap.hpp&gt;">
+<link rel="prev" href="wrap.html" title="Struct template wrap">
+<link rel="next" href="../CONTRACT_WRAP_TYPE.html" title="Macro CONTRACT_WRAP_TYPE">
+</head>
+<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
+<table cellpadding="2" width="100%"><tr><td valign="top"></td></tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="wrap.html"><img src="../images/prev.png" alt="Prev"></a><a accesskey="u" href="../reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.wrap_hpp"><img src="../images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../images/home.png" alt="Home"></a><a accesskey="n" href="../CONTRACT_WRAP_TYPE.html"><img src="../images/next.png" alt="Next"></a>
+</div>
+<div class="refentry">
+<a name="contract.wrap_void(T)_id437465"></a><div class="titlepage"></div>
+<div class="refnamediv">
+<h2><span class="refentrytitle">Struct template wrap&lt;void(T)&gt;</span></h2>
+<p>contract::wrap&lt;void(T)&gt;</p>
+</div>
+<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
+<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="comment">// In header: &lt;<a class="link" href="../reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.wrap_hpp" title="Header &lt;E:/sandbox/contractpp/trunk/doc/qbk/src/contract/wrap.hpp&gt;">E:/sandbox/contractpp/trunk/doc/qbk/src/contract/wrap.hpp</a>&gt;
+
+</span><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> T<span class="special">&gt;</span>
+<span class="keyword">struct</span> <a class="link" href="wrap_void_T__id437465.html" title="Struct template wrap&lt;void(T)&gt;">wrap</a><span class="special">&lt;</span><span class="keyword">void</span><span class="special">(</span><span class="identifier">T</span><span class="special">)</span><span class="special">&gt;</span> <span class="special">{</span>
+ <span class="comment">// <a class="link" href="wrap_void_T__id437465.html#contract.wrap_void(T)_id437465types">types</a></span>
+ <span class="keyword">typedef</span> <span class="identifier">T</span> <a class="link" href="wrap_void_T__id437465.html#contract.wrap_void(T)_id437465.type"><span class="identifier">type</span></a><span class="special">;</span>
+<span class="special">}</span><span class="special">;</span></pre></div>
+<div class="refsect1">
+<a name="id980592"></a><h2>Description</h2>
+<p>Metafunction used to wrap type expressions containing commas so they can be passed as macro parameters.</p>
+<p>This metafunction first wrap the specified type <code class="computeroutput">T</code> within parenthesis <code class="computeroutput"></code>() (so <code class="computeroutput">T</code> can be passed as a single macro parameter even if it contains commas) forming a void-function type with one argument of type <code class="computeroutput">T</code>. Then the application of the metafunction via its member <code class="computeroutput">type</code> returns the wrapped type <code class="computeroutput">T</code>.</p>
+<p><span class="bold"><strong>Parameters:</strong></span> </p>
+<div class="informaltable"><table class="table">
+<colgroup>
+<col>
+<col>
+</colgroup>
+<tbody><tr>
+<td><span class="bold"><strong><code class="computeroutput">T</code></strong></span></td>
+<td>Type to be wrapped so it can be passed within a macro parameter even if it contains commas. </td>
+</tr></tbody>
+</table></div>
+<p>
+</p>
+<p><span class="bold"><strong>See:</strong></span> CONTRACT_WRAP_TYPE() for more explanation and examples </p>
+<div class="refsect2">
+<a name="id980684"></a><h3>
+<a name="contract.wrap_void(T)_id437465types"></a><code class="computeroutput">wrap</code>
+ public
+ types</h3>
+<div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem">
+<p>
+<span class="keyword">typedef</span> <span class="identifier">T</span> <a name="contract.wrap_void(T)_id437465.type"></a><span class="identifier">type</span><span class="special">;</span></p>
+<p>The type T. </p>
+</li></ol></div>
+</div>
+</div>
+</div>
+<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
+<td align="left"></td>
+<td align="right"><div class="copyright-footer">Copyright &#169; 2009, 2010 Lorenzo Caminiti<p>
+ Distributed under the Contract++ Software License, Version 1.0 (see accompanying
+ file LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="wrap.html"><img src="../images/prev.png" alt="Prev"></a><a accesskey="u" href="../reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.wrap_hpp"><img src="../images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../images/home.png" alt="Home"></a><a accesskey="n" href="../CONTRACT_WRAP_TYPE.html"><img src="../images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>

Added: sandbox/contract/libs/contract/doc/html/contract/wrap_void_T__id437506.html
==============================================================================
--- (empty file)
+++ sandbox/contract/libs/contract/doc/html/contract/wrap_void_T__id437506.html 2011-06-28 20:54:41 EDT (Tue, 28 Jun 2011)
@@ -0,0 +1,76 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
+<title>Struct template wrap&lt;void(T)&gt;</title>
+<link rel="stylesheet" href="../doc/html/boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
+<link rel="home" href="../index.html" title="Contract++ 0.3.490">
+<link rel="up" href="../reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.wrap_hpp" title="Header &lt;E:/sandbox/contractpp/trunk/doc/qbk/src/contract/wrap.hpp&gt;">
+<link rel="prev" href="wrap.html" title="Struct template wrap">
+<link rel="next" href="../CONTRACT_WRAP_TYPE.html" title="Macro CONTRACT_WRAP_TYPE">
+</head>
+<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
+<table cellpadding="2" width="100%"><tr><td valign="top"></td></tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="wrap.html"><img src="../images/prev.png" alt="Prev"></a><a accesskey="u" href="../reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.wrap_hpp"><img src="../images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../images/home.png" alt="Home"></a><a accesskey="n" href="../CONTRACT_WRAP_TYPE.html"><img src="../images/next.png" alt="Next"></a>
+</div>
+<div class="refentry">
+<a name="contract.wrap_void(T)_id437506"></a><div class="titlepage"></div>
+<div class="refnamediv">
+<h2><span class="refentrytitle">Struct template wrap&lt;void(T)&gt;</span></h2>
+<p>contract::wrap&lt;void(T)&gt;</p>
+</div>
+<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
+<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="comment">// In header: &lt;<a class="link" href="../reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.wrap_hpp" title="Header &lt;E:/sandbox/contractpp/trunk/doc/qbk/src/contract/wrap.hpp&gt;">E:/sandbox/contractpp/trunk/doc/qbk/src/contract/wrap.hpp</a>&gt;
+
+</span><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> T<span class="special">&gt;</span>
+<span class="keyword">struct</span> <a class="link" href="wrap_void_T__id437506.html" title="Struct template wrap&lt;void(T)&gt;">wrap</a><span class="special">&lt;</span><span class="keyword">void</span><span class="special">(</span><span class="identifier">T</span><span class="special">)</span><span class="special">&gt;</span> <span class="special">{</span>
+ <span class="comment">// <a class="link" href="wrap_void_T__id437506.html#contract.wrap_void(T)_id437506types">types</a></span>
+ <span class="keyword">typedef</span> <span class="identifier">T</span> <a class="link" href="wrap_void_T__id437506.html#contract.wrap_void(T)_id437506.type"><span class="identifier">type</span></a><span class="special">;</span>
+<span class="special">}</span><span class="special">;</span></pre></div>
+<div class="refsect1">
+<a name="id980592"></a><h2>Description</h2>
+<p>Metafunction used to wrap type expressions containing commas so they can be passed as macro parameters.</p>
+<p>This metafunction first wrap the specified type <code class="computeroutput">T</code> within parenthesis <code class="computeroutput"></code>() (so <code class="computeroutput">T</code> can be passed as a single macro parameter even if it contains commas) forming a void-function type with one argument of type <code class="computeroutput">T</code>. Then the application of the metafunction via its member <code class="computeroutput">type</code> returns the wrapped type <code class="computeroutput">T</code>.</p>
+<p><span class="bold"><strong>Parameters:</strong></span> </p>
+<div class="informaltable"><table class="table">
+<colgroup>
+<col>
+<col>
+</colgroup>
+<tbody><tr>
+<td><span class="bold"><strong><code class="computeroutput">T</code></strong></span></td>
+<td>Type to be wrapped so it can be passed within a macro parameter even if it contains commas. </td>
+</tr></tbody>
+</table></div>
+<p>
+</p>
+<p><span class="bold"><strong>See:</strong></span> CONTRACT_WRAP_TYPE() for more explanation and examples </p>
+<div class="refsect2">
+<a name="id980683"></a><h3>
+<a name="contract.wrap_void(T)_id437506types"></a><code class="computeroutput">wrap</code>
+ public
+ types</h3>
+<div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem">
+<p>
+<span class="keyword">typedef</span> <span class="identifier">T</span> <a name="contract.wrap_void(T)_id437506.type"></a><span class="identifier">type</span><span class="special">;</span></p>
+<p>The type T. </p>
+</li></ol></div>
+</div>
+</div>
+</div>
+<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
+<td align="left"></td>
+<td align="right"><div class="copyright-footer">Copyright &#169; 2009, 2010 Lorenzo Caminiti<p>
+ Distributed under the Contract++ Software License, Version 1.0 (see accompanying
+ file LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="wrap.html"><img src="../images/prev.png" alt="Prev"></a><a accesskey="u" href="../reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.wrap_hpp"><img src="../images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../images/home.png" alt="Home"></a><a accesskey="n" href="../CONTRACT_WRAP_TYPE.html"><img src="../images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>

Added: sandbox/contract/libs/contract/doc/html/contract/wrap_void_T__id437513.html
==============================================================================
--- (empty file)
+++ sandbox/contract/libs/contract/doc/html/contract/wrap_void_T__id437513.html 2011-06-28 20:54:41 EDT (Tue, 28 Jun 2011)
@@ -0,0 +1,76 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
+<title>Struct template wrap&lt;void(T)&gt;</title>
+<link rel="stylesheet" href="../doc/html/boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
+<link rel="home" href="../index.html" title="Contract++ 0.3.490">
+<link rel="up" href="../reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.wrap_hpp" title="Header &lt;E:/sandbox/contractpp/trunk/doc/qbk/src/contract/wrap.hpp&gt;">
+<link rel="prev" href="wrap.html" title="Struct template wrap">
+<link rel="next" href="../CONTRACT_WRAP_TYPE.html" title="Macro CONTRACT_WRAP_TYPE">
+</head>
+<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
+<table cellpadding="2" width="100%"><tr><td valign="top"></td></tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="wrap.html"><img src="../images/prev.png" alt="Prev"></a><a accesskey="u" href="../reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.wrap_hpp"><img src="../images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../images/home.png" alt="Home"></a><a accesskey="n" href="../CONTRACT_WRAP_TYPE.html"><img src="../images/next.png" alt="Next"></a>
+</div>
+<div class="refentry">
+<a name="contract.wrap_void(T)_id437513"></a><div class="titlepage"></div>
+<div class="refnamediv">
+<h2><span class="refentrytitle">Struct template wrap&lt;void(T)&gt;</span></h2>
+<p>contract::wrap&lt;void(T)&gt;</p>
+</div>
+<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
+<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="comment">// In header: &lt;<a class="link" href="../reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.wrap_hpp" title="Header &lt;E:/sandbox/contractpp/trunk/doc/qbk/src/contract/wrap.hpp&gt;">E:/sandbox/contractpp/trunk/doc/qbk/src/contract/wrap.hpp</a>&gt;
+
+</span><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> T<span class="special">&gt;</span>
+<span class="keyword">struct</span> <a class="link" href="wrap_void_T__id437513.html" title="Struct template wrap&lt;void(T)&gt;">wrap</a><span class="special">&lt;</span><span class="keyword">void</span><span class="special">(</span><span class="identifier">T</span><span class="special">)</span><span class="special">&gt;</span> <span class="special">{</span>
+ <span class="comment">// <a class="link" href="wrap_void_T__id437513.html#contract.wrap_void(T)_id437513types">types</a></span>
+ <span class="keyword">typedef</span> <span class="identifier">T</span> <a class="link" href="wrap_void_T__id437513.html#contract.wrap_void(T)_id437513.type"><span class="identifier">type</span></a><span class="special">;</span>
+<span class="special">}</span><span class="special">;</span></pre></div>
+<div class="refsect1">
+<a name="id980589"></a><h2>Description</h2>
+<p>Metafunction used to wrap type expressions containing commas so they can be passed as macro parameters.</p>
+<p>This metafunction first wrap the specified type <code class="computeroutput">T</code> within parenthesis <code class="computeroutput"></code>() (so <code class="computeroutput">T</code> can be passed as a single macro parameter even if it contains commas) forming a void-function type with one argument of type <code class="computeroutput">T</code>. Then the application of the metafunction via its member <code class="computeroutput">type</code> returns the wrapped type <code class="computeroutput">T</code>.</p>
+<p><span class="bold"><strong>Parameters:</strong></span> </p>
+<div class="informaltable"><table class="table">
+<colgroup>
+<col>
+<col>
+</colgroup>
+<tbody><tr>
+<td><span class="bold"><strong><code class="computeroutput">T</code></strong></span></td>
+<td>Type to be wrapped so it can be passed within a macro parameter even if it contains commas. </td>
+</tr></tbody>
+</table></div>
+<p>
+</p>
+<p><span class="bold"><strong>See:</strong></span> CONTRACT_WRAP_TYPE() for more explanation and examples </p>
+<div class="refsect2">
+<a name="id980681"></a><h3>
+<a name="contract.wrap_void(T)_id437513types"></a><code class="computeroutput">wrap</code>
+ public
+ types</h3>
+<div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem">
+<p>
+<span class="keyword">typedef</span> <span class="identifier">T</span> <a name="contract.wrap_void(T)_id437513.type"></a><span class="identifier">type</span><span class="special">;</span></p>
+<p>The type T. </p>
+</li></ol></div>
+</div>
+</div>
+</div>
+<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
+<td align="left"></td>
+<td align="right"><div class="copyright-footer">Copyright &#169; 2009, 2010 Lorenzo Caminiti<p>
+ Distributed under the Contract++ Software License, Version 1.0 (see accompanying
+ file LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="wrap.html"><img src="../images/prev.png" alt="Prev"></a><a accesskey="u" href="../reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.wrap_hpp"><img src="../images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../images/home.png" alt="Home"></a><a accesskey="n" href="../CONTRACT_WRAP_TYPE.html"><img src="../images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>

Added: sandbox/contract/libs/contract/doc/html/contract/wrap_void_T__id437516.html
==============================================================================
--- (empty file)
+++ sandbox/contract/libs/contract/doc/html/contract/wrap_void_T__id437516.html 2011-06-28 20:54:41 EDT (Tue, 28 Jun 2011)
@@ -0,0 +1,76 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
+<title>Struct template wrap&lt;void(T)&gt;</title>
+<link rel="stylesheet" href="../doc/html/boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
+<link rel="home" href="../index.html" title="Contract++ 0.3.490">
+<link rel="up" href="../reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.wrap_hpp" title="Header &lt;E:/sandbox/contractpp/trunk/doc/qbk/src/contract/wrap.hpp&gt;">
+<link rel="prev" href="wrap.html" title="Struct template wrap">
+<link rel="next" href="../CONTRACT_WRAP_TYPE.html" title="Macro CONTRACT_WRAP_TYPE">
+</head>
+<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
+<table cellpadding="2" width="100%"><tr><td valign="top"></td></tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="wrap.html"><img src="../images/prev.png" alt="Prev"></a><a accesskey="u" href="../reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.wrap_hpp"><img src="../images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../images/home.png" alt="Home"></a><a accesskey="n" href="../CONTRACT_WRAP_TYPE.html"><img src="../images/next.png" alt="Next"></a>
+</div>
+<div class="refentry">
+<a name="contract.wrap_void(T)_id437516"></a><div class="titlepage"></div>
+<div class="refnamediv">
+<h2><span class="refentrytitle">Struct template wrap&lt;void(T)&gt;</span></h2>
+<p>contract::wrap&lt;void(T)&gt;</p>
+</div>
+<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
+<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="comment">// In header: &lt;<a class="link" href="../reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.wrap_hpp" title="Header &lt;E:/sandbox/contractpp/trunk/doc/qbk/src/contract/wrap.hpp&gt;">E:/sandbox/contractpp/trunk/doc/qbk/src/contract/wrap.hpp</a>&gt;
+
+</span><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> T<span class="special">&gt;</span>
+<span class="keyword">struct</span> <a class="link" href="wrap_void_T__id437516.html" title="Struct template wrap&lt;void(T)&gt;">wrap</a><span class="special">&lt;</span><span class="keyword">void</span><span class="special">(</span><span class="identifier">T</span><span class="special">)</span><span class="special">&gt;</span> <span class="special">{</span>
+ <span class="comment">// <a class="link" href="wrap_void_T__id437516.html#contract.wrap_void(T)_id437516types">types</a></span>
+ <span class="keyword">typedef</span> <span class="identifier">T</span> <a class="link" href="wrap_void_T__id437516.html#contract.wrap_void(T)_id437516.type"><span class="identifier">type</span></a><span class="special">;</span>
+<span class="special">}</span><span class="special">;</span></pre></div>
+<div class="refsect1">
+<a name="id980590"></a><h2>Description</h2>
+<p>Metafunction used to wrap type expressions containing commas so they can be passed as macro parameters.</p>
+<p>This metafunction first wrap the specified type <code class="computeroutput">T</code> within parenthesis <code class="computeroutput"></code>() (so <code class="computeroutput">T</code> can be passed as a single macro parameter even if it contains commas) forming a void-function type with one argument of type <code class="computeroutput">T</code>. Then the application of the metafunction via its member <code class="computeroutput">type</code> returns the wrapped type <code class="computeroutput">T</code>.</p>
+<p><span class="bold"><strong>Parameters:</strong></span> </p>
+<div class="informaltable"><table class="table">
+<colgroup>
+<col>
+<col>
+</colgroup>
+<tbody><tr>
+<td><span class="bold"><strong><code class="computeroutput">T</code></strong></span></td>
+<td>Type to be wrapped so it can be passed within a macro parameter even if it contains commas. </td>
+</tr></tbody>
+</table></div>
+<p>
+</p>
+<p><span class="bold"><strong>See:</strong></span> CONTRACT_WRAP_TYPE() for more explanation and examples </p>
+<div class="refsect2">
+<a name="id980682"></a><h3>
+<a name="contract.wrap_void(T)_id437516types"></a><code class="computeroutput">wrap</code>
+ public
+ types</h3>
+<div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem">
+<p>
+<span class="keyword">typedef</span> <span class="identifier">T</span> <a name="contract.wrap_void(T)_id437516.type"></a><span class="identifier">type</span><span class="special">;</span></p>
+<p>The type T. </p>
+</li></ol></div>
+</div>
+</div>
+</div>
+<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
+<td align="left"></td>
+<td align="right"><div class="copyright-footer">Copyright &#169; 2009, 2010 Lorenzo Caminiti<p>
+ Distributed under the Contract++ Software License, Version 1.0 (see accompanying
+ file LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="wrap.html"><img src="../images/prev.png" alt="Prev"></a><a accesskey="u" href="../reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.wrap_hpp"><img src="../images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../images/home.png" alt="Home"></a><a accesskey="n" href="../CONTRACT_WRAP_TYPE.html"><img src="../images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>

Added: sandbox/contract/libs/contract/doc/html/contract/wrap_void_T__id437520.html
==============================================================================
--- (empty file)
+++ sandbox/contract/libs/contract/doc/html/contract/wrap_void_T__id437520.html 2011-06-28 20:54:41 EDT (Tue, 28 Jun 2011)
@@ -0,0 +1,76 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
+<title>Struct template wrap&lt;void(T)&gt;</title>
+<link rel="stylesheet" href="../doc/html/boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
+<link rel="home" href="../index.html" title="Contract++ 0.3.490">
+<link rel="up" href="../reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.wrap_hpp" title="Header &lt;E:/sandbox/contractpp/trunk/doc/qbk/src/contract/wrap.hpp&gt;">
+<link rel="prev" href="wrap.html" title="Struct template wrap">
+<link rel="next" href="../CONTRACT_WRAP_TYPE.html" title="Macro CONTRACT_WRAP_TYPE">
+</head>
+<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
+<table cellpadding="2" width="100%"><tr><td valign="top"></td></tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="wrap.html"><img src="../images/prev.png" alt="Prev"></a><a accesskey="u" href="../reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.wrap_hpp"><img src="../images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../images/home.png" alt="Home"></a><a accesskey="n" href="../CONTRACT_WRAP_TYPE.html"><img src="../images/next.png" alt="Next"></a>
+</div>
+<div class="refentry">
+<a name="contract.wrap_void(T)_id437520"></a><div class="titlepage"></div>
+<div class="refnamediv">
+<h2><span class="refentrytitle">Struct template wrap&lt;void(T)&gt;</span></h2>
+<p>contract::wrap&lt;void(T)&gt;</p>
+</div>
+<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
+<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="comment">// In header: &lt;<a class="link" href="../reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.wrap_hpp" title="Header &lt;E:/sandbox/contractpp/trunk/doc/qbk/src/contract/wrap.hpp&gt;">E:/sandbox/contractpp/trunk/doc/qbk/src/contract/wrap.hpp</a>&gt;
+
+</span><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> T<span class="special">&gt;</span>
+<span class="keyword">struct</span> <a class="link" href="wrap_void_T__id437520.html" title="Struct template wrap&lt;void(T)&gt;">wrap</a><span class="special">&lt;</span><span class="keyword">void</span><span class="special">(</span><span class="identifier">T</span><span class="special">)</span><span class="special">&gt;</span> <span class="special">{</span>
+ <span class="comment">// <a class="link" href="wrap_void_T__id437520.html#contract.wrap_void(T)_id437520types">types</a></span>
+ <span class="keyword">typedef</span> <span class="identifier">T</span> <a class="link" href="wrap_void_T__id437520.html#contract.wrap_void(T)_id437520.type"><span class="identifier">type</span></a><span class="special">;</span>
+<span class="special">}</span><span class="special">;</span></pre></div>
+<div class="refsect1">
+<a name="id980588"></a><h2>Description</h2>
+<p>Metafunction used to wrap type expressions containing commas so they can be passed as macro parameters.</p>
+<p>This metafunction first wrap the specified type <code class="computeroutput">T</code> within parenthesis <code class="computeroutput"></code>() (so <code class="computeroutput">T</code> can be passed as a single macro parameter even if it contains commas) forming a void-function type with one argument of type <code class="computeroutput">T</code>. Then the application of the metafunction via its member <code class="computeroutput">type</code> returns the wrapped type <code class="computeroutput">T</code>.</p>
+<p><span class="bold"><strong>Parameters:</strong></span> </p>
+<div class="informaltable"><table class="table">
+<colgroup>
+<col>
+<col>
+</colgroup>
+<tbody><tr>
+<td><span class="bold"><strong><code class="computeroutput">T</code></strong></span></td>
+<td>Type to be wrapped so it can be passed within a macro parameter even if it contains commas. </td>
+</tr></tbody>
+</table></div>
+<p>
+</p>
+<p><span class="bold"><strong>See:</strong></span> CONTRACT_WRAP_TYPE() for more explanation and examples </p>
+<div class="refsect2">
+<a name="id980679"></a><h3>
+<a name="contract.wrap_void(T)_id437520types"></a><code class="computeroutput">wrap</code>
+ public
+ types</h3>
+<div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem">
+<p>
+<span class="keyword">typedef</span> <span class="identifier">T</span> <a name="contract.wrap_void(T)_id437520.type"></a><span class="identifier">type</span><span class="special">;</span></p>
+<p>The type T. </p>
+</li></ol></div>
+</div>
+</div>
+</div>
+<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
+<td align="left"></td>
+<td align="right"><div class="copyright-footer">Copyright &#169; 2009, 2010 Lorenzo Caminiti<p>
+ Distributed under the Contract++ Software License, Version 1.0 (see accompanying
+ file LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="wrap.html"><img src="../images/prev.png" alt="Prev"></a><a accesskey="u" href="../reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.wrap_hpp"><img src="../images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../images/home.png" alt="Home"></a><a accesskey="n" href="../CONTRACT_WRAP_TYPE.html"><img src="../images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>

Added: sandbox/contract/libs/contract/doc/html/contract/wrap_void_T__id437556.html
==============================================================================
--- (empty file)
+++ sandbox/contract/libs/contract/doc/html/contract/wrap_void_T__id437556.html 2011-06-28 20:54:41 EDT (Tue, 28 Jun 2011)
@@ -0,0 +1,76 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
+<title>Struct template wrap&lt;void(T)&gt;</title>
+<link rel="stylesheet" href="../doc/html/boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
+<link rel="home" href="../index.html" title="Contract++ 0.3.490">
+<link rel="up" href="../reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.wrap_hpp" title="Header &lt;E:/sandbox/contractpp/trunk/doc/qbk/src/contract/wrap.hpp&gt;">
+<link rel="prev" href="wrap.html" title="Struct template wrap">
+<link rel="next" href="../CONTRACT_WRAP_TYPE.html" title="Macro CONTRACT_WRAP_TYPE">
+</head>
+<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
+<table cellpadding="2" width="100%"><tr><td valign="top"></td></tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="wrap.html"><img src="../images/prev.png" alt="Prev"></a><a accesskey="u" href="../reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.wrap_hpp"><img src="../images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../images/home.png" alt="Home"></a><a accesskey="n" href="../CONTRACT_WRAP_TYPE.html"><img src="../images/next.png" alt="Next"></a>
+</div>
+<div class="refentry">
+<a name="contract.wrap_void(T)_id437556"></a><div class="titlepage"></div>
+<div class="refnamediv">
+<h2><span class="refentrytitle">Struct template wrap&lt;void(T)&gt;</span></h2>
+<p>contract::wrap&lt;void(T)&gt;</p>
+</div>
+<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
+<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="comment">// In header: &lt;<a class="link" href="../reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.wrap_hpp" title="Header &lt;E:/sandbox/contractpp/trunk/doc/qbk/src/contract/wrap.hpp&gt;">E:/sandbox/contractpp/trunk/doc/qbk/src/contract/wrap.hpp</a>&gt;
+
+</span><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> T<span class="special">&gt;</span>
+<span class="keyword">struct</span> <a class="link" href="wrap_void_T__id437556.html" title="Struct template wrap&lt;void(T)&gt;">wrap</a><span class="special">&lt;</span><span class="keyword">void</span><span class="special">(</span><span class="identifier">T</span><span class="special">)</span><span class="special">&gt;</span> <span class="special">{</span>
+ <span class="comment">// <a class="link" href="wrap_void_T__id437556.html#contract.wrap_void(T)_id437556types">types</a></span>
+ <span class="keyword">typedef</span> <span class="identifier">T</span> <a class="link" href="wrap_void_T__id437556.html#contract.wrap_void(T)_id437556.type"><span class="identifier">type</span></a><span class="special">;</span>
+<span class="special">}</span><span class="special">;</span></pre></div>
+<div class="refsect1">
+<a name="id980583"></a><h2>Description</h2>
+<p>Metafunction used to wrap type expressions containing commas so they can be passed as macro parameters.</p>
+<p>This metafunction first wrap the specified type <code class="computeroutput">T</code> within parenthesis <code class="computeroutput"></code>() (so <code class="computeroutput">T</code> can be passed as a single macro parameter even if it contains commas) forming a void-function type with one argument of type <code class="computeroutput">T</code>. Then the application of the metafunction via its member <code class="computeroutput">type</code> returns the wrapped type <code class="computeroutput">T</code>.</p>
+<p><span class="bold"><strong>Parameters:</strong></span> </p>
+<div class="informaltable"><table class="table">
+<colgroup>
+<col>
+<col>
+</colgroup>
+<tbody><tr>
+<td><span class="bold"><strong><code class="computeroutput">T</code></strong></span></td>
+<td>Type to be wrapped so it can be passed within a macro parameter even if it contains commas. </td>
+</tr></tbody>
+</table></div>
+<p>
+</p>
+<p><span class="bold"><strong>See:</strong></span> CONTRACT_WRAP_TYPE() for more explanation and examples </p>
+<div class="refsect2">
+<a name="id980674"></a><h3>
+<a name="contract.wrap_void(T)_id437556types"></a><code class="computeroutput">wrap</code>
+ public
+ types</h3>
+<div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem">
+<p>
+<span class="keyword">typedef</span> <span class="identifier">T</span> <a name="contract.wrap_void(T)_id437556.type"></a><span class="identifier">type</span><span class="special">;</span></p>
+<p>The type T. </p>
+</li></ol></div>
+</div>
+</div>
+</div>
+<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
+<td align="left"></td>
+<td align="right"><div class="copyright-footer">Copyright &#169; 2009, 2010 Lorenzo Caminiti<p>
+ Distributed under the Contract++ Software License, Version 1.0 (see accompanying
+ file LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="wrap.html"><img src="../images/prev.png" alt="Prev"></a><a accesskey="u" href="../reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.wrap_hpp"><img src="../images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../images/home.png" alt="Home"></a><a accesskey="n" href="../CONTRACT_WRAP_TYPE.html"><img src="../images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>

Added: sandbox/contract/libs/contract/doc/html/contract/wrap_void_T__id437585.html
==============================================================================
--- (empty file)
+++ sandbox/contract/libs/contract/doc/html/contract/wrap_void_T__id437585.html 2011-06-28 20:54:41 EDT (Tue, 28 Jun 2011)
@@ -0,0 +1,76 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
+<title>Struct template wrap&lt;void(T)&gt;</title>
+<link rel="stylesheet" href="../doc/html/boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
+<link rel="home" href="../index.html" title="Contract++ 0.3.490">
+<link rel="up" href="../reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.wrap_hpp" title="Header &lt;E:/sandbox/contractpp/trunk/doc/qbk/src/contract/wrap.hpp&gt;">
+<link rel="prev" href="wrap.html" title="Struct template wrap">
+<link rel="next" href="../CONTRACT_WRAP_TYPE.html" title="Macro CONTRACT_WRAP_TYPE">
+</head>
+<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
+<table cellpadding="2" width="100%"><tr><td valign="top"></td></tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="wrap.html"><img src="../images/prev.png" alt="Prev"></a><a accesskey="u" href="../reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.wrap_hpp"><img src="../images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../images/home.png" alt="Home"></a><a accesskey="n" href="../CONTRACT_WRAP_TYPE.html"><img src="../images/next.png" alt="Next"></a>
+</div>
+<div class="refentry">
+<a name="contract.wrap_void(T)_id437585"></a><div class="titlepage"></div>
+<div class="refnamediv">
+<h2><span class="refentrytitle">Struct template wrap&lt;void(T)&gt;</span></h2>
+<p>contract::wrap&lt;void(T)&gt;</p>
+</div>
+<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
+<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="comment">// In header: &lt;<a class="link" href="../reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.wrap_hpp" title="Header &lt;E:/sandbox/contractpp/trunk/doc/qbk/src/contract/wrap.hpp&gt;">E:/sandbox/contractpp/trunk/doc/qbk/src/contract/wrap.hpp</a>&gt;
+
+</span><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> T<span class="special">&gt;</span>
+<span class="keyword">struct</span> <a class="link" href="wrap_void_T__id437585.html" title="Struct template wrap&lt;void(T)&gt;">wrap</a><span class="special">&lt;</span><span class="keyword">void</span><span class="special">(</span><span class="identifier">T</span><span class="special">)</span><span class="special">&gt;</span> <span class="special">{</span>
+ <span class="comment">// <a class="link" href="wrap_void_T__id437585.html#contract.wrap_void(T)_id437585types">types</a></span>
+ <span class="keyword">typedef</span> <span class="identifier">T</span> <a class="link" href="wrap_void_T__id437585.html#contract.wrap_void(T)_id437585.type"><span class="identifier">type</span></a><span class="special">;</span>
+<span class="special">}</span><span class="special">;</span></pre></div>
+<div class="refsect1">
+<a name="id980591"></a><h2>Description</h2>
+<p>Metafunction used to wrap type expressions containing commas so they can be passed as macro parameters.</p>
+<p>This metafunction first wrap the specified type <code class="computeroutput">T</code> within parenthesis <code class="computeroutput"></code>() (so <code class="computeroutput">T</code> can be passed as a single macro parameter even if it contains commas) forming a void-function type with one argument of type <code class="computeroutput">T</code>. Then the application of the metafunction via its member <code class="computeroutput">type</code> returns the wrapped type <code class="computeroutput">T</code>.</p>
+<p><span class="bold"><strong>Parameters:</strong></span> </p>
+<div class="informaltable"><table class="table">
+<colgroup>
+<col>
+<col>
+</colgroup>
+<tbody><tr>
+<td><span class="bold"><strong><code class="computeroutput">T</code></strong></span></td>
+<td>Type to be wrapped so it can be passed within a macro parameter even if it contains commas. </td>
+</tr></tbody>
+</table></div>
+<p>
+</p>
+<p><span class="bold"><strong>See:</strong></span> CONTRACT_WRAP_TYPE() for more explanation and examples </p>
+<div class="refsect2">
+<a name="id980683"></a><h3>
+<a name="contract.wrap_void(T)_id437585types"></a><code class="computeroutput">wrap</code>
+ public
+ types</h3>
+<div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem">
+<p>
+<span class="keyword">typedef</span> <span class="identifier">T</span> <a name="contract.wrap_void(T)_id437585.type"></a><span class="identifier">type</span><span class="special">;</span></p>
+<p>The type T. </p>
+</li></ol></div>
+</div>
+</div>
+</div>
+<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
+<td align="left"></td>
+<td align="right"><div class="copyright-footer">Copyright &#169; 2009, 2010 Lorenzo Caminiti<p>
+ Distributed under the Contract++ Software License, Version 1.0 (see accompanying
+ file LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="wrap.html"><img src="../images/prev.png" alt="Prev"></a><a accesskey="u" href="../reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.wrap_hpp"><img src="../images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../images/home.png" alt="Home"></a><a accesskey="n" href="../CONTRACT_WRAP_TYPE.html"><img src="../images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>

Added: sandbox/contract/libs/contract/doc/html/contract/wrap_void_T__id437653.html
==============================================================================
--- (empty file)
+++ sandbox/contract/libs/contract/doc/html/contract/wrap_void_T__id437653.html 2011-06-28 20:54:41 EDT (Tue, 28 Jun 2011)
@@ -0,0 +1,76 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
+<title>Struct template wrap&lt;void(T)&gt;</title>
+<link rel="stylesheet" href="../doc/html/boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
+<link rel="home" href="../index.html" title="Contract++ 0.3.490">
+<link rel="up" href="../reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.wrap_hpp" title="Header &lt;E:/sandbox/contractpp/trunk/doc/qbk/src/contract/wrap.hpp&gt;">
+<link rel="prev" href="wrap.html" title="Struct template wrap">
+<link rel="next" href="../CONTRACT_WRAP_TYPE.html" title="Macro CONTRACT_WRAP_TYPE">
+</head>
+<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
+<table cellpadding="2" width="100%"><tr><td valign="top"></td></tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="wrap.html"><img src="../images/prev.png" alt="Prev"></a><a accesskey="u" href="../reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.wrap_hpp"><img src="../images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../images/home.png" alt="Home"></a><a accesskey="n" href="../CONTRACT_WRAP_TYPE.html"><img src="../images/next.png" alt="Next"></a>
+</div>
+<div class="refentry">
+<a name="contract.wrap_void(T)_id437653"></a><div class="titlepage"></div>
+<div class="refnamediv">
+<h2><span class="refentrytitle">Struct template wrap&lt;void(T)&gt;</span></h2>
+<p>contract::wrap&lt;void(T)&gt;</p>
+</div>
+<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
+<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="comment">// In header: &lt;<a class="link" href="../reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.wrap_hpp" title="Header &lt;E:/sandbox/contractpp/trunk/doc/qbk/src/contract/wrap.hpp&gt;">E:/sandbox/contractpp/trunk/doc/qbk/src/contract/wrap.hpp</a>&gt;
+
+</span><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> T<span class="special">&gt;</span>
+<span class="keyword">struct</span> <a class="link" href="wrap_void_T__id437653.html" title="Struct template wrap&lt;void(T)&gt;">wrap</a><span class="special">&lt;</span><span class="keyword">void</span><span class="special">(</span><span class="identifier">T</span><span class="special">)</span><span class="special">&gt;</span> <span class="special">{</span>
+ <span class="comment">// <a class="link" href="wrap_void_T__id437653.html#contract.wrap_void(T)_id437653types">types</a></span>
+ <span class="keyword">typedef</span> <span class="identifier">T</span> <a class="link" href="wrap_void_T__id437653.html#contract.wrap_void(T)_id437653.type"><span class="identifier">type</span></a><span class="special">;</span>
+<span class="special">}</span><span class="special">;</span></pre></div>
+<div class="refsect1">
+<a name="id980582"></a><h2>Description</h2>
+<p>Metafunction used to wrap type expressions containing commas so they can be passed as macro parameters.</p>
+<p>This metafunction first wrap the specified type <code class="computeroutput">T</code> within parenthesis <code class="computeroutput"></code>() (so <code class="computeroutput">T</code> can be passed as a single macro parameter even if it contains commas) forming a void-function type with one argument of type <code class="computeroutput">T</code>. Then the application of the metafunction via its member <code class="computeroutput">type</code> returns the wrapped type <code class="computeroutput">T</code>.</p>
+<p><span class="bold"><strong>Parameters:</strong></span> </p>
+<div class="informaltable"><table class="table">
+<colgroup>
+<col>
+<col>
+</colgroup>
+<tbody><tr>
+<td><span class="bold"><strong><code class="computeroutput">T</code></strong></span></td>
+<td>Type to be wrapped so it can be passed within a macro parameter even if it contains commas. </td>
+</tr></tbody>
+</table></div>
+<p>
+</p>
+<p><span class="bold"><strong>See:</strong></span> CONTRACT_WRAP_TYPE() for more explanation and examples </p>
+<div class="refsect2">
+<a name="id980674"></a><h3>
+<a name="contract.wrap_void(T)_id437653types"></a><code class="computeroutput">wrap</code>
+ public
+ types</h3>
+<div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem">
+<p>
+<span class="keyword">typedef</span> <span class="identifier">T</span> <a name="contract.wrap_void(T)_id437653.type"></a><span class="identifier">type</span><span class="special">;</span></p>
+<p>The type T. </p>
+</li></ol></div>
+</div>
+</div>
+</div>
+<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
+<td align="left"></td>
+<td align="right"><div class="copyright-footer">Copyright &#169; 2009, 2010 Lorenzo Caminiti<p>
+ Distributed under the Contract++ Software License, Version 1.0 (see accompanying
+ file LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="wrap.html"><img src="../images/prev.png" alt="Prev"></a><a accesskey="u" href="../reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.wrap_hpp"><img src="../images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../images/home.png" alt="Home"></a><a accesskey="n" href="../CONTRACT_WRAP_TYPE.html"><img src="../images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>

Added: sandbox/contract/libs/contract/doc/html/contract/wrap_void_T__id437721.html
==============================================================================
--- (empty file)
+++ sandbox/contract/libs/contract/doc/html/contract/wrap_void_T__id437721.html 2011-06-28 20:54:41 EDT (Tue, 28 Jun 2011)
@@ -0,0 +1,76 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
+<title>Struct template wrap&lt;void(T)&gt;</title>
+<link rel="stylesheet" href="../doc/html/boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
+<link rel="home" href="../index.html" title="Contract++ 0.3.490">
+<link rel="up" href="../reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.wrap_hpp" title="Header &lt;E:/sandbox/contractpp/trunk/doc/qbk/src/contract/wrap.hpp&gt;">
+<link rel="prev" href="wrap.html" title="Struct template wrap">
+<link rel="next" href="../CONTRACT_WRAP_TYPE.html" title="Macro CONTRACT_WRAP_TYPE">
+</head>
+<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
+<table cellpadding="2" width="100%"><tr><td valign="top"></td></tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="wrap.html"><img src="../images/prev.png" alt="Prev"></a><a accesskey="u" href="../reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.wrap_hpp"><img src="../images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../images/home.png" alt="Home"></a><a accesskey="n" href="../CONTRACT_WRAP_TYPE.html"><img src="../images/next.png" alt="Next"></a>
+</div>
+<div class="refentry">
+<a name="contract.wrap_void(T)_id437721"></a><div class="titlepage"></div>
+<div class="refnamediv">
+<h2><span class="refentrytitle">Struct template wrap&lt;void(T)&gt;</span></h2>
+<p>contract::wrap&lt;void(T)&gt;</p>
+</div>
+<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
+<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="comment">// In header: &lt;<a class="link" href="../reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.wrap_hpp" title="Header &lt;E:/sandbox/contractpp/trunk/doc/qbk/src/contract/wrap.hpp&gt;">E:/sandbox/contractpp/trunk/doc/qbk/src/contract/wrap.hpp</a>&gt;
+
+</span><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> T<span class="special">&gt;</span>
+<span class="keyword">struct</span> <a class="link" href="wrap_void_T__id437721.html" title="Struct template wrap&lt;void(T)&gt;">wrap</a><span class="special">&lt;</span><span class="keyword">void</span><span class="special">(</span><span class="identifier">T</span><span class="special">)</span><span class="special">&gt;</span> <span class="special">{</span>
+ <span class="comment">// <a class="link" href="wrap_void_T__id437721.html#contract.wrap_void(T)_id437721types">types</a></span>
+ <span class="keyword">typedef</span> <span class="identifier">T</span> <a class="link" href="wrap_void_T__id437721.html#contract.wrap_void(T)_id437721.type"><span class="identifier">type</span></a><span class="special">;</span>
+<span class="special">}</span><span class="special">;</span></pre></div>
+<div class="refsect1">
+<a name="id980590"></a><h2>Description</h2>
+<p>Metafunction used to wrap type expressions containing commas so they can be passed as macro parameters.</p>
+<p>This metafunction first wrap the specified type <code class="computeroutput">T</code> within parenthesis <code class="computeroutput"></code>() (so <code class="computeroutput">T</code> can be passed as a single macro parameter even if it contains commas) forming a void-function type with one argument of type <code class="computeroutput">T</code>. Then the application of the metafunction via its member <code class="computeroutput">type</code> returns the wrapped type <code class="computeroutput">T</code>.</p>
+<p><span class="bold"><strong>Parameters:</strong></span> </p>
+<div class="informaltable"><table class="table">
+<colgroup>
+<col>
+<col>
+</colgroup>
+<tbody><tr>
+<td><span class="bold"><strong><code class="computeroutput">T</code></strong></span></td>
+<td>Type to be wrapped so it can be passed within a macro parameter even if it contains commas. </td>
+</tr></tbody>
+</table></div>
+<p>
+</p>
+<p><span class="bold"><strong>See:</strong></span> CONTRACT_WRAP_TYPE() for more explanation and examples </p>
+<div class="refsect2">
+<a name="id980680"></a><h3>
+<a name="contract.wrap_void(T)_id437721types"></a><code class="computeroutput">wrap</code>
+ public
+ types</h3>
+<div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem">
+<p>
+<span class="keyword">typedef</span> <span class="identifier">T</span> <a name="contract.wrap_void(T)_id437721.type"></a><span class="identifier">type</span><span class="special">;</span></p>
+<p>The type T. </p>
+</li></ol></div>
+</div>
+</div>
+</div>
+<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
+<td align="left"></td>
+<td align="right"><div class="copyright-footer">Copyright &#169; 2009, 2010 Lorenzo Caminiti<p>
+ Distributed under the Contract++ Software License, Version 1.0 (see accompanying
+ file LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="wrap.html"><img src="../images/prev.png" alt="Prev"></a><a accesskey="u" href="../reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.wrap_hpp"><img src="../images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../images/home.png" alt="Home"></a><a accesskey="n" href="../CONTRACT_WRAP_TYPE.html"><img src="../images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>

Added: sandbox/contract/libs/contract/doc/html/contract/wrap_void_T__id437784.html
==============================================================================
--- (empty file)
+++ sandbox/contract/libs/contract/doc/html/contract/wrap_void_T__id437784.html 2011-06-28 20:54:41 EDT (Tue, 28 Jun 2011)
@@ -0,0 +1,76 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
+<title>Struct template wrap&lt;void(T)&gt;</title>
+<link rel="stylesheet" href="../doc/html/boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
+<link rel="home" href="../index.html" title="Contract++ 0.3.490">
+<link rel="up" href="../reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.wrap_hpp" title="Header &lt;E:/sandbox/contractpp/trunk/doc/qbk/src/contract/wrap.hpp&gt;">
+<link rel="prev" href="wrap.html" title="Struct template wrap">
+<link rel="next" href="../CONTRACT_WRAP_TYPE.html" title="Macro CONTRACT_WRAP_TYPE">
+</head>
+<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
+<table cellpadding="2" width="100%"><tr><td valign="top"></td></tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="wrap.html"><img src="../images/prev.png" alt="Prev"></a><a accesskey="u" href="../reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.wrap_hpp"><img src="../images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../images/home.png" alt="Home"></a><a accesskey="n" href="../CONTRACT_WRAP_TYPE.html"><img src="../images/next.png" alt="Next"></a>
+</div>
+<div class="refentry">
+<a name="contract.wrap_void(T)_id437784"></a><div class="titlepage"></div>
+<div class="refnamediv">
+<h2><span class="refentrytitle">Struct template wrap&lt;void(T)&gt;</span></h2>
+<p>contract::wrap&lt;void(T)&gt;</p>
+</div>
+<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
+<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="comment">// In header: &lt;<a class="link" href="../reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.wrap_hpp" title="Header &lt;E:/sandbox/contractpp/trunk/doc/qbk/src/contract/wrap.hpp&gt;">E:/sandbox/contractpp/trunk/doc/qbk/src/contract/wrap.hpp</a>&gt;
+
+</span><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> T<span class="special">&gt;</span>
+<span class="keyword">struct</span> <a class="link" href="wrap_void_T__id437784.html" title="Struct template wrap&lt;void(T)&gt;">wrap</a><span class="special">&lt;</span><span class="keyword">void</span><span class="special">(</span><span class="identifier">T</span><span class="special">)</span><span class="special">&gt;</span> <span class="special">{</span>
+ <span class="comment">// <a class="link" href="wrap_void_T__id437784.html#contract.wrap_void(T)_id437784types">types</a></span>
+ <span class="keyword">typedef</span> <span class="identifier">T</span> <a class="link" href="wrap_void_T__id437784.html#contract.wrap_void(T)_id437784.type"><span class="identifier">type</span></a><span class="special">;</span>
+<span class="special">}</span><span class="special">;</span></pre></div>
+<div class="refsect1">
+<a name="id980588"></a><h2>Description</h2>
+<p>Metafunction used to wrap type expressions containing commas so they can be passed as macro parameters.</p>
+<p>This metafunction first wrap the specified type <code class="computeroutput">T</code> within parenthesis <code class="computeroutput"></code>() (so <code class="computeroutput">T</code> can be passed as a single macro parameter even if it contains commas) forming a void-function type with one argument of type <code class="computeroutput">T</code>. Then the application of the metafunction via its member <code class="computeroutput">type</code> returns the wrapped type <code class="computeroutput">T</code>.</p>
+<p><span class="bold"><strong>Parameters:</strong></span> </p>
+<div class="informaltable"><table class="table">
+<colgroup>
+<col>
+<col>
+</colgroup>
+<tbody><tr>
+<td><span class="bold"><strong><code class="computeroutput">T</code></strong></span></td>
+<td>Type to be wrapped so it can be passed within a macro parameter even if it contains commas. </td>
+</tr></tbody>
+</table></div>
+<p>
+</p>
+<p><span class="bold"><strong>See:</strong></span> CONTRACT_WRAP_TYPE() for more explanation and examples </p>
+<div class="refsect2">
+<a name="id980680"></a><h3>
+<a name="contract.wrap_void(T)_id437784types"></a><code class="computeroutput">wrap</code>
+ public
+ types</h3>
+<div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem">
+<p>
+<span class="keyword">typedef</span> <span class="identifier">T</span> <a name="contract.wrap_void(T)_id437784.type"></a><span class="identifier">type</span><span class="special">;</span></p>
+<p>The type T. </p>
+</li></ol></div>
+</div>
+</div>
+</div>
+<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
+<td align="left"></td>
+<td align="right"><div class="copyright-footer">Copyright &#169; 2009, 2010 Lorenzo Caminiti<p>
+ Distributed under the Contract++ Software License, Version 1.0 (see accompanying
+ file LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="wrap.html"><img src="../images/prev.png" alt="Prev"></a><a accesskey="u" href="../reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.wrap_hpp"><img src="../images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../images/home.png" alt="Home"></a><a accesskey="n" href="../CONTRACT_WRAP_TYPE.html"><img src="../images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>

Added: sandbox/contract/libs/contract/doc/html/contract/wrap_void_T__id437791.html
==============================================================================
--- (empty file)
+++ sandbox/contract/libs/contract/doc/html/contract/wrap_void_T__id437791.html 2011-06-28 20:54:41 EDT (Tue, 28 Jun 2011)
@@ -0,0 +1,76 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
+<title>Struct template wrap&lt;void(T)&gt;</title>
+<link rel="stylesheet" href="../doc/html/boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
+<link rel="home" href="../index.html" title="Contract++ 0.3.490">
+<link rel="up" href="../reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.wrap_hpp" title="Header &lt;E:/sandbox/contractpp/trunk/doc/qbk/src/contract/wrap.hpp&gt;">
+<link rel="prev" href="wrap.html" title="Struct template wrap">
+<link rel="next" href="../CONTRACT_WRAP_TYPE.html" title="Macro CONTRACT_WRAP_TYPE">
+</head>
+<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
+<table cellpadding="2" width="100%"><tr><td valign="top"></td></tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="wrap.html"><img src="../images/prev.png" alt="Prev"></a><a accesskey="u" href="../reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.wrap_hpp"><img src="../images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../images/home.png" alt="Home"></a><a accesskey="n" href="../CONTRACT_WRAP_TYPE.html"><img src="../images/next.png" alt="Next"></a>
+</div>
+<div class="refentry">
+<a name="contract.wrap_void(T)_id437791"></a><div class="titlepage"></div>
+<div class="refnamediv">
+<h2><span class="refentrytitle">Struct template wrap&lt;void(T)&gt;</span></h2>
+<p>contract::wrap&lt;void(T)&gt;</p>
+</div>
+<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
+<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="comment">// In header: &lt;<a class="link" href="../reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.wrap_hpp" title="Header &lt;E:/sandbox/contractpp/trunk/doc/qbk/src/contract/wrap.hpp&gt;">E:/sandbox/contractpp/trunk/doc/qbk/src/contract/wrap.hpp</a>&gt;
+
+</span><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> T<span class="special">&gt;</span>
+<span class="keyword">struct</span> <a class="link" href="wrap_void_T__id437791.html" title="Struct template wrap&lt;void(T)&gt;">wrap</a><span class="special">&lt;</span><span class="keyword">void</span><span class="special">(</span><span class="identifier">T</span><span class="special">)</span><span class="special">&gt;</span> <span class="special">{</span>
+ <span class="comment">// <a class="link" href="wrap_void_T__id437791.html#contract.wrap_void(T)_id437791types">types</a></span>
+ <span class="keyword">typedef</span> <span class="identifier">T</span> <a class="link" href="wrap_void_T__id437791.html#contract.wrap_void(T)_id437791.type"><span class="identifier">type</span></a><span class="special">;</span>
+<span class="special">}</span><span class="special">;</span></pre></div>
+<div class="refsect1">
+<a name="id980588"></a><h2>Description</h2>
+<p>Metafunction used to wrap type expressions containing commas so they can be passed as macro parameters.</p>
+<p>This metafunction first wrap the specified type <code class="computeroutput">T</code> within parenthesis <code class="computeroutput"></code>() (so <code class="computeroutput">T</code> can be passed as a single macro parameter even if it contains commas) forming a void-function type with one argument of type <code class="computeroutput">T</code>. Then the application of the metafunction via its member <code class="computeroutput">type</code> returns the wrapped type <code class="computeroutput">T</code>.</p>
+<p><span class="bold"><strong>Parameters:</strong></span> </p>
+<div class="informaltable"><table class="table">
+<colgroup>
+<col>
+<col>
+</colgroup>
+<tbody><tr>
+<td><span class="bold"><strong><code class="computeroutput">T</code></strong></span></td>
+<td>Type to be wrapped so it can be passed within a macro parameter even if it contains commas. </td>
+</tr></tbody>
+</table></div>
+<p>
+</p>
+<p><span class="bold"><strong>See:</strong></span> CONTRACT_WRAP_TYPE() for more explanation and examples </p>
+<div class="refsect2">
+<a name="id980680"></a><h3>
+<a name="contract.wrap_void(T)_id437791types"></a><code class="computeroutput">wrap</code>
+ public
+ types</h3>
+<div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem">
+<p>
+<span class="keyword">typedef</span> <span class="identifier">T</span> <a name="contract.wrap_void(T)_id437791.type"></a><span class="identifier">type</span><span class="special">;</span></p>
+<p>The type T. </p>
+</li></ol></div>
+</div>
+</div>
+</div>
+<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
+<td align="left"></td>
+<td align="right"><div class="copyright-footer">Copyright &#169; 2009, 2010 Lorenzo Caminiti<p>
+ Distributed under the Contract++ Software License, Version 1.0 (see accompanying
+ file LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="wrap.html"><img src="../images/prev.png" alt="Prev"></a><a accesskey="u" href="../reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.wrap_hpp"><img src="../images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../images/home.png" alt="Home"></a><a accesskey="n" href="../CONTRACT_WRAP_TYPE.html"><img src="../images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>

Added: sandbox/contract/libs/contract/doc/html/contract/wrap_void_T__id437854.html
==============================================================================
--- (empty file)
+++ sandbox/contract/libs/contract/doc/html/contract/wrap_void_T__id437854.html 2011-06-28 20:54:41 EDT (Tue, 28 Jun 2011)
@@ -0,0 +1,76 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
+<title>Struct template wrap&lt;void(T)&gt;</title>
+<link rel="stylesheet" href="../doc/html/boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
+<link rel="home" href="../index.html" title="Contract++ 0.3.490">
+<link rel="up" href="../reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.wrap_hpp" title="Header &lt;E:/sandbox/contractpp/trunk/doc/qbk/src/contract/wrap.hpp&gt;">
+<link rel="prev" href="wrap.html" title="Struct template wrap">
+<link rel="next" href="../CONTRACT_WRAP_TYPE.html" title="Macro CONTRACT_WRAP_TYPE">
+</head>
+<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
+<table cellpadding="2" width="100%"><tr><td valign="top"></td></tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="wrap.html"><img src="../images/prev.png" alt="Prev"></a><a accesskey="u" href="../reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.wrap_hpp"><img src="../images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../images/home.png" alt="Home"></a><a accesskey="n" href="../CONTRACT_WRAP_TYPE.html"><img src="../images/next.png" alt="Next"></a>
+</div>
+<div class="refentry">
+<a name="contract.wrap_void(T)_id437854"></a><div class="titlepage"></div>
+<div class="refnamediv">
+<h2><span class="refentrytitle">Struct template wrap&lt;void(T)&gt;</span></h2>
+<p>contract::wrap&lt;void(T)&gt;</p>
+</div>
+<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
+<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="comment">// In header: &lt;<a class="link" href="../reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.wrap_hpp" title="Header &lt;E:/sandbox/contractpp/trunk/doc/qbk/src/contract/wrap.hpp&gt;">E:/sandbox/contractpp/trunk/doc/qbk/src/contract/wrap.hpp</a>&gt;
+
+</span><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> T<span class="special">&gt;</span>
+<span class="keyword">struct</span> <a class="link" href="wrap_void_T__id437854.html" title="Struct template wrap&lt;void(T)&gt;">wrap</a><span class="special">&lt;</span><span class="keyword">void</span><span class="special">(</span><span class="identifier">T</span><span class="special">)</span><span class="special">&gt;</span> <span class="special">{</span>
+ <span class="comment">// <a class="link" href="wrap_void_T__id437854.html#contract.wrap_void(T)_id437854types">types</a></span>
+ <span class="keyword">typedef</span> <span class="identifier">T</span> <a class="link" href="wrap_void_T__id437854.html#contract.wrap_void(T)_id437854.type"><span class="identifier">type</span></a><span class="special">;</span>
+<span class="special">}</span><span class="special">;</span></pre></div>
+<div class="refsect1">
+<a name="id980586"></a><h2>Description</h2>
+<p>Metafunction used to wrap type expressions containing commas so they can be passed as macro parameters.</p>
+<p>This metafunction first wrap the specified type <code class="computeroutput">T</code> within parenthesis <code class="computeroutput"></code>() (so <code class="computeroutput">T</code> can be passed as a single macro parameter even if it contains commas) forming a void-function type with one argument of type <code class="computeroutput">T</code>. Then the application of the metafunction via its member <code class="computeroutput">type</code> returns the wrapped type <code class="computeroutput">T</code>.</p>
+<p><span class="bold"><strong>Parameters:</strong></span> </p>
+<div class="informaltable"><table class="table">
+<colgroup>
+<col>
+<col>
+</colgroup>
+<tbody><tr>
+<td><span class="bold"><strong><code class="computeroutput">T</code></strong></span></td>
+<td>Type to be wrapped so it can be passed within a macro parameter even if it contains commas. </td>
+</tr></tbody>
+</table></div>
+<p>
+</p>
+<p><span class="bold"><strong>See:</strong></span> CONTRACT_WRAP_TYPE() for more explanation and examples </p>
+<div class="refsect2">
+<a name="id980678"></a><h3>
+<a name="contract.wrap_void(T)_id437854types"></a><code class="computeroutput">wrap</code>
+ public
+ types</h3>
+<div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem">
+<p>
+<span class="keyword">typedef</span> <span class="identifier">T</span> <a name="contract.wrap_void(T)_id437854.type"></a><span class="identifier">type</span><span class="special">;</span></p>
+<p>The type T. </p>
+</li></ol></div>
+</div>
+</div>
+</div>
+<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
+<td align="left"></td>
+<td align="right"><div class="copyright-footer">Copyright &#169; 2009, 2010 Lorenzo Caminiti<p>
+ Distributed under the Contract++ Software License, Version 1.0 (see accompanying
+ file LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="wrap.html"><img src="../images/prev.png" alt="Prev"></a><a accesskey="u" href="../reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.wrap_hpp"><img src="../images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../images/home.png" alt="Home"></a><a accesskey="n" href="../CONTRACT_WRAP_TYPE.html"><img src="../images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>

Added: sandbox/contract/libs/contract/doc/html/contract/wrap_void_T__id437991.html
==============================================================================
--- (empty file)
+++ sandbox/contract/libs/contract/doc/html/contract/wrap_void_T__id437991.html 2011-06-28 20:54:41 EDT (Tue, 28 Jun 2011)
@@ -0,0 +1,76 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
+<title>Struct template wrap&lt;void(T)&gt;</title>
+<link rel="stylesheet" href="../doc/html/boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
+<link rel="home" href="../index.html" title="Contract++ 0.3.490">
+<link rel="up" href="../reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.wrap_hpp" title="Header &lt;E:/sandbox/contractpp/trunk/doc/qbk/src/contract/wrap.hpp&gt;">
+<link rel="prev" href="wrap.html" title="Struct template wrap">
+<link rel="next" href="../CONTRACT_WRAP_TYPE.html" title="Macro CONTRACT_WRAP_TYPE">
+</head>
+<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
+<table cellpadding="2" width="100%"><tr><td valign="top"></td></tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="wrap.html"><img src="../images/prev.png" alt="Prev"></a><a accesskey="u" href="../reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.wrap_hpp"><img src="../images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../images/home.png" alt="Home"></a><a accesskey="n" href="../CONTRACT_WRAP_TYPE.html"><img src="../images/next.png" alt="Next"></a>
+</div>
+<div class="refentry">
+<a name="contract.wrap_void(T)_id437991"></a><div class="titlepage"></div>
+<div class="refnamediv">
+<h2><span class="refentrytitle">Struct template wrap&lt;void(T)&gt;</span></h2>
+<p>contract::wrap&lt;void(T)&gt;</p>
+</div>
+<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
+<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="comment">// In header: &lt;<a class="link" href="../reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.wrap_hpp" title="Header &lt;E:/sandbox/contractpp/trunk/doc/qbk/src/contract/wrap.hpp&gt;">E:/sandbox/contractpp/trunk/doc/qbk/src/contract/wrap.hpp</a>&gt;
+
+</span><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> T<span class="special">&gt;</span>
+<span class="keyword">struct</span> <a class="link" href="wrap_void_T__id437991.html" title="Struct template wrap&lt;void(T)&gt;">wrap</a><span class="special">&lt;</span><span class="keyword">void</span><span class="special">(</span><span class="identifier">T</span><span class="special">)</span><span class="special">&gt;</span> <span class="special">{</span>
+ <span class="comment">// <a class="link" href="wrap_void_T__id437991.html#contract.wrap_void(T)_id437991types">types</a></span>
+ <span class="keyword">typedef</span> <span class="identifier">T</span> <a class="link" href="wrap_void_T__id437991.html#contract.wrap_void(T)_id437991.type"><span class="identifier">type</span></a><span class="special">;</span>
+<span class="special">}</span><span class="special">;</span></pre></div>
+<div class="refsect1">
+<a name="id980589"></a><h2>Description</h2>
+<p>Metafunction used to wrap type expressions containing commas so they can be passed as macro parameters.</p>
+<p>This metafunction first wrap the specified type <code class="computeroutput">T</code> within parenthesis <code class="computeroutput"></code>() (so <code class="computeroutput">T</code> can be passed as a single macro parameter even if it contains commas) forming a void-function type with one argument of type <code class="computeroutput">T</code>. Then the application of the metafunction via its member <code class="computeroutput">type</code> returns the wrapped type <code class="computeroutput">T</code>.</p>
+<p><span class="bold"><strong>Parameters:</strong></span> </p>
+<div class="informaltable"><table class="table">
+<colgroup>
+<col>
+<col>
+</colgroup>
+<tbody><tr>
+<td><span class="bold"><strong><code class="computeroutput">T</code></strong></span></td>
+<td>Type to be wrapped so it can be passed within a macro parameter even if it contains commas. </td>
+</tr></tbody>
+</table></div>
+<p>
+</p>
+<p><span class="bold"><strong>See:</strong></span> CONTRACT_WRAP_TYPE() for more explanation and examples </p>
+<div class="refsect2">
+<a name="id980680"></a><h3>
+<a name="contract.wrap_void(T)_id437991types"></a><code class="computeroutput">wrap</code>
+ public
+ types</h3>
+<div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem">
+<p>
+<span class="keyword">typedef</span> <span class="identifier">T</span> <a name="contract.wrap_void(T)_id437991.type"></a><span class="identifier">type</span><span class="special">;</span></p>
+<p>The type T. </p>
+</li></ol></div>
+</div>
+</div>
+</div>
+<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
+<td align="left"></td>
+<td align="right"><div class="copyright-footer">Copyright &#169; 2009, 2010 Lorenzo Caminiti<p>
+ Distributed under the Contract++ Software License, Version 1.0 (see accompanying
+ file LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="wrap.html"><img src="../images/prev.png" alt="Prev"></a><a accesskey="u" href="../reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.wrap_hpp"><img src="../images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../images/home.png" alt="Home"></a><a accesskey="n" href="../CONTRACT_WRAP_TYPE.html"><img src="../images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>

Added: sandbox/contract/libs/contract/doc/html/contract/wrap_void_T__id437994.html
==============================================================================
--- (empty file)
+++ sandbox/contract/libs/contract/doc/html/contract/wrap_void_T__id437994.html 2011-06-28 20:54:41 EDT (Tue, 28 Jun 2011)
@@ -0,0 +1,76 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
+<title>Struct template wrap&lt;void(T)&gt;</title>
+<link rel="stylesheet" href="../doc/html/boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
+<link rel="home" href="../index.html" title="Contract++ 0.3.490">
+<link rel="up" href="../reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.wrap_hpp" title="Header &lt;E:/sandbox/contractpp/trunk/doc/qbk/src/contract/wrap.hpp&gt;">
+<link rel="prev" href="wrap.html" title="Struct template wrap">
+<link rel="next" href="../CONTRACT_WRAP_TYPE.html" title="Macro CONTRACT_WRAP_TYPE">
+</head>
+<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
+<table cellpadding="2" width="100%"><tr><td valign="top"></td></tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="wrap.html"><img src="../images/prev.png" alt="Prev"></a><a accesskey="u" href="../reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.wrap_hpp"><img src="../images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../images/home.png" alt="Home"></a><a accesskey="n" href="../CONTRACT_WRAP_TYPE.html"><img src="../images/next.png" alt="Next"></a>
+</div>
+<div class="refentry">
+<a name="contract.wrap_void(T)_id437994"></a><div class="titlepage"></div>
+<div class="refnamediv">
+<h2><span class="refentrytitle">Struct template wrap&lt;void(T)&gt;</span></h2>
+<p>contract::wrap&lt;void(T)&gt;</p>
+</div>
+<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
+<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="comment">// In header: &lt;<a class="link" href="../reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.wrap_hpp" title="Header &lt;E:/sandbox/contractpp/trunk/doc/qbk/src/contract/wrap.hpp&gt;">E:/sandbox/contractpp/trunk/doc/qbk/src/contract/wrap.hpp</a>&gt;
+
+</span><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> T<span class="special">&gt;</span>
+<span class="keyword">struct</span> <a class="link" href="wrap_void_T__id437994.html" title="Struct template wrap&lt;void(T)&gt;">wrap</a><span class="special">&lt;</span><span class="keyword">void</span><span class="special">(</span><span class="identifier">T</span><span class="special">)</span><span class="special">&gt;</span> <span class="special">{</span>
+ <span class="comment">// <a class="link" href="wrap_void_T__id437994.html#contract.wrap_void(T)_id437994types">types</a></span>
+ <span class="keyword">typedef</span> <span class="identifier">T</span> <a class="link" href="wrap_void_T__id437994.html#contract.wrap_void(T)_id437994.type"><span class="identifier">type</span></a><span class="special">;</span>
+<span class="special">}</span><span class="special">;</span></pre></div>
+<div class="refsect1">
+<a name="id980590"></a><h2>Description</h2>
+<p>Metafunction used to wrap type expressions containing commas so they can be passed as macro parameters.</p>
+<p>This metafunction first wrap the specified type <code class="computeroutput">T</code> within parenthesis <code class="computeroutput"></code>() (so <code class="computeroutput">T</code> can be passed as a single macro parameter even if it contains commas) forming a void-function type with one argument of type <code class="computeroutput">T</code>. Then the application of the metafunction via its member <code class="computeroutput">type</code> returns the wrapped type <code class="computeroutput">T</code>.</p>
+<p><span class="bold"><strong>Parameters:</strong></span> </p>
+<div class="informaltable"><table class="table">
+<colgroup>
+<col>
+<col>
+</colgroup>
+<tbody><tr>
+<td><span class="bold"><strong><code class="computeroutput">T</code></strong></span></td>
+<td>Type to be wrapped so it can be passed within a macro parameter even if it contains commas. </td>
+</tr></tbody>
+</table></div>
+<p>
+</p>
+<p><span class="bold"><strong>See:</strong></span> CONTRACT_WRAP_TYPE() for more explanation and examples </p>
+<div class="refsect2">
+<a name="id980681"></a><h3>
+<a name="contract.wrap_void(T)_id437994types"></a><code class="computeroutput">wrap</code>
+ public
+ types</h3>
+<div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem">
+<p>
+<span class="keyword">typedef</span> <span class="identifier">T</span> <a name="contract.wrap_void(T)_id437994.type"></a><span class="identifier">type</span><span class="special">;</span></p>
+<p>The type T. </p>
+</li></ol></div>
+</div>
+</div>
+</div>
+<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
+<td align="left"></td>
+<td align="right"><div class="copyright-footer">Copyright &#169; 2009, 2010 Lorenzo Caminiti<p>
+ Distributed under the Contract++ Software License, Version 1.0 (see accompanying
+ file LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="wrap.html"><img src="../images/prev.png" alt="Prev"></a><a accesskey="u" href="../reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.wrap_hpp"><img src="../images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../images/home.png" alt="Home"></a><a accesskey="n" href="../CONTRACT_WRAP_TYPE.html"><img src="../images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>

Added: sandbox/contract/libs/contract/doc/html/contract/wrap_void_T__id438135.html
==============================================================================
--- (empty file)
+++ sandbox/contract/libs/contract/doc/html/contract/wrap_void_T__id438135.html 2011-06-28 20:54:41 EDT (Tue, 28 Jun 2011)
@@ -0,0 +1,76 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
+<title>Struct template wrap&lt;void(T)&gt;</title>
+<link rel="stylesheet" href="../doc/html/boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
+<link rel="home" href="../index.html" title="Contract++ 0.3.490">
+<link rel="up" href="../reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.wrap_hpp" title="Header &lt;E:/sandbox/contractpp/trunk/doc/qbk/src/contract/wrap.hpp&gt;">
+<link rel="prev" href="wrap.html" title="Struct template wrap">
+<link rel="next" href="../CONTRACT_WRAP_TYPE.html" title="Macro CONTRACT_WRAP_TYPE">
+</head>
+<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
+<table cellpadding="2" width="100%"><tr><td valign="top"></td></tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="wrap.html"><img src="../images/prev.png" alt="Prev"></a><a accesskey="u" href="../reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.wrap_hpp"><img src="../images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../images/home.png" alt="Home"></a><a accesskey="n" href="../CONTRACT_WRAP_TYPE.html"><img src="../images/next.png" alt="Next"></a>
+</div>
+<div class="refentry">
+<a name="contract.wrap_void(T)_id438135"></a><div class="titlepage"></div>
+<div class="refnamediv">
+<h2><span class="refentrytitle">Struct template wrap&lt;void(T)&gt;</span></h2>
+<p>contract::wrap&lt;void(T)&gt;</p>
+</div>
+<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
+<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="comment">// In header: &lt;<a class="link" href="../reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.wrap_hpp" title="Header &lt;E:/sandbox/contractpp/trunk/doc/qbk/src/contract/wrap.hpp&gt;">E:/sandbox/contractpp/trunk/doc/qbk/src/contract/wrap.hpp</a>&gt;
+
+</span><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> T<span class="special">&gt;</span>
+<span class="keyword">struct</span> <a class="link" href="wrap_void_T__id438135.html" title="Struct template wrap&lt;void(T)&gt;">wrap</a><span class="special">&lt;</span><span class="keyword">void</span><span class="special">(</span><span class="identifier">T</span><span class="special">)</span><span class="special">&gt;</span> <span class="special">{</span>
+ <span class="comment">// <a class="link" href="wrap_void_T__id438135.html#contract.wrap_void(T)_id438135types">types</a></span>
+ <span class="keyword">typedef</span> <span class="identifier">T</span> <a class="link" href="wrap_void_T__id438135.html#contract.wrap_void(T)_id438135.type"><span class="identifier">type</span></a><span class="special">;</span>
+<span class="special">}</span><span class="special">;</span></pre></div>
+<div class="refsect1">
+<a name="id980589"></a><h2>Description</h2>
+<p>Metafunction used to wrap type expressions containing commas so they can be passed as macro parameters.</p>
+<p>This metafunction first wrap the specified type <code class="computeroutput">T</code> within parenthesis <code class="computeroutput"></code>() (so <code class="computeroutput">T</code> can be passed as a single macro parameter even if it contains commas) forming a void-function type with one argument of type <code class="computeroutput">T</code>. Then the application of the metafunction via its member <code class="computeroutput">type</code> returns the wrapped type <code class="computeroutput">T</code>.</p>
+<p><span class="bold"><strong>Parameters:</strong></span> </p>
+<div class="informaltable"><table class="table">
+<colgroup>
+<col>
+<col>
+</colgroup>
+<tbody><tr>
+<td><span class="bold"><strong><code class="computeroutput">T</code></strong></span></td>
+<td>Type to be wrapped so it can be passed within a macro parameter even if it contains commas. </td>
+</tr></tbody>
+</table></div>
+<p>
+</p>
+<p><span class="bold"><strong>See:</strong></span> CONTRACT_WRAP_TYPE() for more explanation and examples </p>
+<div class="refsect2">
+<a name="id980681"></a><h3>
+<a name="contract.wrap_void(T)_id438135types"></a><code class="computeroutput">wrap</code>
+ public
+ types</h3>
+<div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem">
+<p>
+<span class="keyword">typedef</span> <span class="identifier">T</span> <a name="contract.wrap_void(T)_id438135.type"></a><span class="identifier">type</span><span class="special">;</span></p>
+<p>The type T. </p>
+</li></ol></div>
+</div>
+</div>
+</div>
+<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
+<td align="left"></td>
+<td align="right"><div class="copyright-footer">Copyright &#169; 2009, 2010 Lorenzo Caminiti<p>
+ Distributed under the Contract++ Software License, Version 1.0 (see accompanying
+ file LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="wrap.html"><img src="../images/prev.png" alt="Prev"></a><a accesskey="u" href="../reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.wrap_hpp"><img src="../images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../images/home.png" alt="Home"></a><a accesskey="n" href="../CONTRACT_WRAP_TYPE.html"><img src="../images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>

Added: sandbox/contract/libs/contract/doc/html/contract/wrap_void_T__id438205.html
==============================================================================
--- (empty file)
+++ sandbox/contract/libs/contract/doc/html/contract/wrap_void_T__id438205.html 2011-06-28 20:54:41 EDT (Tue, 28 Jun 2011)
@@ -0,0 +1,76 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
+<title>Struct template wrap&lt;void(T)&gt;</title>
+<link rel="stylesheet" href="../doc/html/boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
+<link rel="home" href="../index.html" title="Contract++ 0.3.490">
+<link rel="up" href="../reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.wrap_hpp" title="Header &lt;E:/sandbox/contractpp/trunk/doc/qbk/src/contract/wrap.hpp&gt;">
+<link rel="prev" href="wrap.html" title="Struct template wrap">
+<link rel="next" href="../CONTRACT_WRAP_TYPE.html" title="Macro CONTRACT_WRAP_TYPE">
+</head>
+<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
+<table cellpadding="2" width="100%"><tr><td valign="top"></td></tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="wrap.html"><img src="../images/prev.png" alt="Prev"></a><a accesskey="u" href="../reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.wrap_hpp"><img src="../images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../images/home.png" alt="Home"></a><a accesskey="n" href="../CONTRACT_WRAP_TYPE.html"><img src="../images/next.png" alt="Next"></a>
+</div>
+<div class="refentry">
+<a name="contract.wrap_void(T)_id438205"></a><div class="titlepage"></div>
+<div class="refnamediv">
+<h2><span class="refentrytitle">Struct template wrap&lt;void(T)&gt;</span></h2>
+<p>contract::wrap&lt;void(T)&gt;</p>
+</div>
+<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
+<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="comment">// In header: &lt;<a class="link" href="../reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.wrap_hpp" title="Header &lt;E:/sandbox/contractpp/trunk/doc/qbk/src/contract/wrap.hpp&gt;">E:/sandbox/contractpp/trunk/doc/qbk/src/contract/wrap.hpp</a>&gt;
+
+</span><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> T<span class="special">&gt;</span>
+<span class="keyword">struct</span> <a class="link" href="wrap_void_T__id438205.html" title="Struct template wrap&lt;void(T)&gt;">wrap</a><span class="special">&lt;</span><span class="keyword">void</span><span class="special">(</span><span class="identifier">T</span><span class="special">)</span><span class="special">&gt;</span> <span class="special">{</span>
+ <span class="comment">// <a class="link" href="wrap_void_T__id438205.html#contract.wrap_void(T)_id438205types">types</a></span>
+ <span class="keyword">typedef</span> <span class="identifier">T</span> <a class="link" href="wrap_void_T__id438205.html#contract.wrap_void(T)_id438205.type"><span class="identifier">type</span></a><span class="special">;</span>
+<span class="special">}</span><span class="special">;</span></pre></div>
+<div class="refsect1">
+<a name="id980582"></a><h2>Description</h2>
+<p>Metafunction used to wrap type expressions containing commas so they can be passed as macro parameters.</p>
+<p>This metafunction first wrap the specified type <code class="computeroutput">T</code> within parenthesis <code class="computeroutput"></code>() (so <code class="computeroutput">T</code> can be passed as a single macro parameter even if it contains commas) forming a void-function type with one argument of type <code class="computeroutput">T</code>. Then the application of the metafunction via its member <code class="computeroutput">type</code> returns the wrapped type <code class="computeroutput">T</code>.</p>
+<p><span class="bold"><strong>Parameters:</strong></span> </p>
+<div class="informaltable"><table class="table">
+<colgroup>
+<col>
+<col>
+</colgroup>
+<tbody><tr>
+<td><span class="bold"><strong><code class="computeroutput">T</code></strong></span></td>
+<td>Type to be wrapped so it can be passed within a macro parameter even if it contains commas. </td>
+</tr></tbody>
+</table></div>
+<p>
+</p>
+<p><span class="bold"><strong>See:</strong></span> CONTRACT_WRAP_TYPE() for more explanation and examples </p>
+<div class="refsect2">
+<a name="id980674"></a><h3>
+<a name="contract.wrap_void(T)_id438205types"></a><code class="computeroutput">wrap</code>
+ public
+ types</h3>
+<div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem">
+<p>
+<span class="keyword">typedef</span> <span class="identifier">T</span> <a name="contract.wrap_void(T)_id438205.type"></a><span class="identifier">type</span><span class="special">;</span></p>
+<p>The type T. </p>
+</li></ol></div>
+</div>
+</div>
+</div>
+<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
+<td align="left"></td>
+<td align="right"><div class="copyright-footer">Copyright &#169; 2009, 2010 Lorenzo Caminiti<p>
+ Distributed under the Contract++ Software License, Version 1.0 (see accompanying
+ file LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="wrap.html"><img src="../images/prev.png" alt="Prev"></a><a accesskey="u" href="../reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.wrap_hpp"><img src="../images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../images/home.png" alt="Home"></a><a accesskey="n" href="../CONTRACT_WRAP_TYPE.html"><img src="../images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>

Added: sandbox/contract/libs/contract/doc/html/contract/wrap_void_T__id438271.html
==============================================================================
--- (empty file)
+++ sandbox/contract/libs/contract/doc/html/contract/wrap_void_T__id438271.html 2011-06-28 20:54:41 EDT (Tue, 28 Jun 2011)
@@ -0,0 +1,76 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
+<title>Struct template wrap&lt;void(T)&gt;</title>
+<link rel="stylesheet" href="../doc/html/boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
+<link rel="home" href="../index.html" title="Contract++ 0.3.490">
+<link rel="up" href="../reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.wrap_hpp" title="Header &lt;E:/sandbox/contractpp/trunk/doc/qbk/src/contract/wrap.hpp&gt;">
+<link rel="prev" href="wrap.html" title="Struct template wrap">
+<link rel="next" href="../CONTRACT_WRAP_TYPE.html" title="Macro CONTRACT_WRAP_TYPE">
+</head>
+<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
+<table cellpadding="2" width="100%"><tr><td valign="top"></td></tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="wrap.html"><img src="../images/prev.png" alt="Prev"></a><a accesskey="u" href="../reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.wrap_hpp"><img src="../images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../images/home.png" alt="Home"></a><a accesskey="n" href="../CONTRACT_WRAP_TYPE.html"><img src="../images/next.png" alt="Next"></a>
+</div>
+<div class="refentry">
+<a name="contract.wrap_void(T)_id438271"></a><div class="titlepage"></div>
+<div class="refnamediv">
+<h2><span class="refentrytitle">Struct template wrap&lt;void(T)&gt;</span></h2>
+<p>contract::wrap&lt;void(T)&gt;</p>
+</div>
+<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
+<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="comment">// In header: &lt;<a class="link" href="../reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.wrap_hpp" title="Header &lt;E:/sandbox/contractpp/trunk/doc/qbk/src/contract/wrap.hpp&gt;">E:/sandbox/contractpp/trunk/doc/qbk/src/contract/wrap.hpp</a>&gt;
+
+</span><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> T<span class="special">&gt;</span>
+<span class="keyword">struct</span> <a class="link" href="wrap_void_T__id438271.html" title="Struct template wrap&lt;void(T)&gt;">wrap</a><span class="special">&lt;</span><span class="keyword">void</span><span class="special">(</span><span class="identifier">T</span><span class="special">)</span><span class="special">&gt;</span> <span class="special">{</span>
+ <span class="comment">// <a class="link" href="wrap_void_T__id438271.html#contract.wrap_void(T)_id438271types">types</a></span>
+ <span class="keyword">typedef</span> <span class="identifier">T</span> <a class="link" href="wrap_void_T__id438271.html#contract.wrap_void(T)_id438271.type"><span class="identifier">type</span></a><span class="special">;</span>
+<span class="special">}</span><span class="special">;</span></pre></div>
+<div class="refsect1">
+<a name="id980591"></a><h2>Description</h2>
+<p>Metafunction used to wrap type expressions containing commas so they can be passed as macro parameters.</p>
+<p>This metafunction first wrap the specified type <code class="computeroutput">T</code> within parenthesis <code class="computeroutput"></code>() (so <code class="computeroutput">T</code> can be passed as a single macro parameter even if it contains commas) forming a void-function type with one argument of type <code class="computeroutput">T</code>. Then the application of the metafunction via its member <code class="computeroutput">type</code> returns the wrapped type <code class="computeroutput">T</code>.</p>
+<p><span class="bold"><strong>Parameters:</strong></span> </p>
+<div class="informaltable"><table class="table">
+<colgroup>
+<col>
+<col>
+</colgroup>
+<tbody><tr>
+<td><span class="bold"><strong><code class="computeroutput">T</code></strong></span></td>
+<td>Type to be wrapped so it can be passed within a macro parameter even if it contains commas. </td>
+</tr></tbody>
+</table></div>
+<p>
+</p>
+<p><span class="bold"><strong>See:</strong></span> CONTRACT_WRAP_TYPE() for more explanation and examples </p>
+<div class="refsect2">
+<a name="id980682"></a><h3>
+<a name="contract.wrap_void(T)_id438271types"></a><code class="computeroutput">wrap</code>
+ public
+ types</h3>
+<div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem">
+<p>
+<span class="keyword">typedef</span> <span class="identifier">T</span> <a name="contract.wrap_void(T)_id438271.type"></a><span class="identifier">type</span><span class="special">;</span></p>
+<p>The type T. </p>
+</li></ol></div>
+</div>
+</div>
+</div>
+<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
+<td align="left"></td>
+<td align="right"><div class="copyright-footer">Copyright &#169; 2009, 2010 Lorenzo Caminiti<p>
+ Distributed under the Contract++ Software License, Version 1.0 (see accompanying
+ file LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="wrap.html"><img src="../images/prev.png" alt="Prev"></a><a accesskey="u" href="../reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.wrap_hpp"><img src="../images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../images/home.png" alt="Home"></a><a accesskey="n" href="../CONTRACT_WRAP_TYPE.html"><img src="../images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>

Added: sandbox/contract/libs/contract/doc/html/contract/wrap_void_T__id438810.html
==============================================================================
--- (empty file)
+++ sandbox/contract/libs/contract/doc/html/contract/wrap_void_T__id438810.html 2011-06-28 20:54:41 EDT (Tue, 28 Jun 2011)
@@ -0,0 +1,76 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
+<title>Struct template wrap&lt;void(T)&gt;</title>
+<link rel="stylesheet" href="../doc/html/boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
+<link rel="home" href="../index.html" title="Contract++ 0.3.490">
+<link rel="up" href="../reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.wrap_hpp" title="Header &lt;E:/sandbox/contractpp/trunk/doc/qbk/src/contract/wrap.hpp&gt;">
+<link rel="prev" href="wrap.html" title="Struct template wrap">
+<link rel="next" href="../CONTRACT_WRAP_TYPE.html" title="Macro CONTRACT_WRAP_TYPE">
+</head>
+<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
+<table cellpadding="2" width="100%"><tr><td valign="top"></td></tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="wrap.html"><img src="../images/prev.png" alt="Prev"></a><a accesskey="u" href="../reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.wrap_hpp"><img src="../images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../images/home.png" alt="Home"></a><a accesskey="n" href="../CONTRACT_WRAP_TYPE.html"><img src="../images/next.png" alt="Next"></a>
+</div>
+<div class="refentry">
+<a name="contract.wrap_void(T)_id438810"></a><div class="titlepage"></div>
+<div class="refnamediv">
+<h2><span class="refentrytitle">Struct template wrap&lt;void(T)&gt;</span></h2>
+<p>contract::wrap&lt;void(T)&gt;</p>
+</div>
+<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
+<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="comment">// In header: &lt;<a class="link" href="../reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.wrap_hpp" title="Header &lt;E:/sandbox/contractpp/trunk/doc/qbk/src/contract/wrap.hpp&gt;">E:/sandbox/contractpp/trunk/doc/qbk/src/contract/wrap.hpp</a>&gt;
+
+</span><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> T<span class="special">&gt;</span>
+<span class="keyword">struct</span> <a class="link" href="wrap_void_T__id438810.html" title="Struct template wrap&lt;void(T)&gt;">wrap</a><span class="special">&lt;</span><span class="keyword">void</span><span class="special">(</span><span class="identifier">T</span><span class="special">)</span><span class="special">&gt;</span> <span class="special">{</span>
+ <span class="comment">// <a class="link" href="wrap_void_T__id438810.html#contract.wrap_void(T)_id438810types">types</a></span>
+ <span class="keyword">typedef</span> <span class="identifier">T</span> <a class="link" href="wrap_void_T__id438810.html#contract.wrap_void(T)_id438810.type"><span class="identifier">type</span></a><span class="special">;</span>
+<span class="special">}</span><span class="special">;</span></pre></div>
+<div class="refsect1">
+<a name="id981015"></a><h2>Description</h2>
+<p>Metafunction used to wrap type expressions containing commas so they can be passed as macro parameters.</p>
+<p>This metafunction first wrap the specified type <code class="computeroutput">T</code> within parenthesis <code class="computeroutput"></code>() (so <code class="computeroutput">T</code> can be passed as a single macro parameter even if it contains commas) forming a void-function type with one argument of type <code class="computeroutput">T</code>. Then the application of the metafunction via its member <code class="computeroutput">type</code> returns the wrapped type <code class="computeroutput">T</code>.</p>
+<p><span class="bold"><strong>Parameters:</strong></span> </p>
+<div class="informaltable"><table class="table">
+<colgroup>
+<col>
+<col>
+</colgroup>
+<tbody><tr>
+<td><span class="bold"><strong><code class="computeroutput">T</code></strong></span></td>
+<td>Type to be wrapped so it can be passed within a macro parameter even if it contains commas. </td>
+</tr></tbody>
+</table></div>
+<p>
+</p>
+<p><span class="bold"><strong>See:</strong></span> CONTRACT_WRAP_TYPE() for more explanation and examples </p>
+<div class="refsect2">
+<a name="id981106"></a><h3>
+<a name="contract.wrap_void(T)_id438810types"></a><code class="computeroutput">wrap</code>
+ public
+ types</h3>
+<div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem">
+<p>
+<span class="keyword">typedef</span> <span class="identifier">T</span> <a name="contract.wrap_void(T)_id438810.type"></a><span class="identifier">type</span><span class="special">;</span></p>
+<p>The type T. </p>
+</li></ol></div>
+</div>
+</div>
+</div>
+<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
+<td align="left"></td>
+<td align="right"><div class="copyright-footer">Copyright &#169; 2009, 2010 Lorenzo Caminiti<p>
+ Distributed under the Contract++ Software License, Version 1.0 (see accompanying
+ file LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="wrap.html"><img src="../images/prev.png" alt="Prev"></a><a accesskey="u" href="../reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.wrap_hpp"><img src="../images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../images/home.png" alt="Home"></a><a accesskey="n" href="../CONTRACT_WRAP_TYPE.html"><img src="../images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>

Added: sandbox/contract/libs/contract/doc/html/contract/wrap_void_T__id439081.html
==============================================================================
--- (empty file)
+++ sandbox/contract/libs/contract/doc/html/contract/wrap_void_T__id439081.html 2011-06-28 20:54:41 EDT (Tue, 28 Jun 2011)
@@ -0,0 +1,76 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
+<title>Struct template wrap&lt;void(T)&gt;</title>
+<link rel="stylesheet" href="../doc/html/boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
+<link rel="home" href="../index.html" title="Contract++ 0.3.490">
+<link rel="up" href="../reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.wrap_hpp" title="Header &lt;E:/sandbox/contractpp/trunk/doc/qbk/src/contract/wrap.hpp&gt;">
+<link rel="prev" href="wrap.html" title="Struct template wrap">
+<link rel="next" href="../CONTRACT_WRAP_TYPE.html" title="Macro CONTRACT_WRAP_TYPE">
+</head>
+<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
+<table cellpadding="2" width="100%"><tr><td valign="top"></td></tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="wrap.html"><img src="../images/prev.png" alt="Prev"></a><a accesskey="u" href="../reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.wrap_hpp"><img src="../images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../images/home.png" alt="Home"></a><a accesskey="n" href="../CONTRACT_WRAP_TYPE.html"><img src="../images/next.png" alt="Next"></a>
+</div>
+<div class="refentry">
+<a name="contract.wrap_void(T)_id439081"></a><div class="titlepage"></div>
+<div class="refnamediv">
+<h2><span class="refentrytitle">Struct template wrap&lt;void(T)&gt;</span></h2>
+<p>contract::wrap&lt;void(T)&gt;</p>
+</div>
+<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
+<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="comment">// In header: &lt;<a class="link" href="../reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.wrap_hpp" title="Header &lt;E:/sandbox/contractpp/trunk/doc/qbk/src/contract/wrap.hpp&gt;">E:/sandbox/contractpp/trunk/doc/qbk/src/contract/wrap.hpp</a>&gt;
+
+</span><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> T<span class="special">&gt;</span>
+<span class="keyword">struct</span> <a class="link" href="wrap_void_T__id439081.html" title="Struct template wrap&lt;void(T)&gt;">wrap</a><span class="special">&lt;</span><span class="keyword">void</span><span class="special">(</span><span class="identifier">T</span><span class="special">)</span><span class="special">&gt;</span> <span class="special">{</span>
+ <span class="comment">// <a class="link" href="wrap_void_T__id439081.html#contract.wrap_void(T)_id439081types">types</a></span>
+ <span class="keyword">typedef</span> <span class="identifier">T</span> <a class="link" href="wrap_void_T__id439081.html#contract.wrap_void(T)_id439081.type"><span class="identifier">type</span></a><span class="special">;</span>
+<span class="special">}</span><span class="special">;</span></pre></div>
+<div class="refsect1">
+<a name="id981389"></a><h2>Description</h2>
+<p>Metafunction used to wrap type expressions containing commas so they can be passed as macro parameters.</p>
+<p>This metafunction first wrap the specified type <code class="computeroutput">T</code> within parenthesis <code class="computeroutput"></code>() (so <code class="computeroutput">T</code> can be passed as a single macro parameter even if it contains commas) forming a void-function type with one argument of type <code class="computeroutput">T</code>. Then the application of the metafunction via its member <code class="computeroutput">type</code> returns the wrapped type <code class="computeroutput">T</code>.</p>
+<p><span class="bold"><strong>Parameters:</strong></span> </p>
+<div class="informaltable"><table class="table">
+<colgroup>
+<col>
+<col>
+</colgroup>
+<tbody><tr>
+<td><span class="bold"><strong><code class="computeroutput">T</code></strong></span></td>
+<td>Type to be wrapped so it can be passed within a macro parameter even if it contains commas. </td>
+</tr></tbody>
+</table></div>
+<p>
+</p>
+<p><span class="bold"><strong>See:</strong></span> CONTRACT_WRAP_TYPE() for more explanation and examples </p>
+<div class="refsect2">
+<a name="id981480"></a><h3>
+<a name="contract.wrap_void(T)_id439081types"></a><code class="computeroutput">wrap</code>
+ public
+ types</h3>
+<div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem">
+<p>
+<span class="keyword">typedef</span> <span class="identifier">T</span> <a name="contract.wrap_void(T)_id439081.type"></a><span class="identifier">type</span><span class="special">;</span></p>
+<p>The type T. </p>
+</li></ol></div>
+</div>
+</div>
+</div>
+<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
+<td align="left"></td>
+<td align="right"><div class="copyright-footer">Copyright &#169; 2009, 2010 Lorenzo Caminiti<p>
+ Distributed under the Contract++ Software License, Version 1.0 (see accompanying
+ file LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="wrap.html"><img src="../images/prev.png" alt="Prev"></a><a accesskey="u" href="../reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.wrap_hpp"><img src="../images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../images/home.png" alt="Home"></a><a accesskey="n" href="../CONTRACT_WRAP_TYPE.html"><img src="../images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>

Added: sandbox/contract/libs/contract/doc/html/contract/wrap_void_T__id439083.html
==============================================================================
--- (empty file)
+++ sandbox/contract/libs/contract/doc/html/contract/wrap_void_T__id439083.html 2011-06-28 20:54:41 EDT (Tue, 28 Jun 2011)
@@ -0,0 +1,76 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
+<title>Struct template wrap&lt;void(T)&gt;</title>
+<link rel="stylesheet" href="../doc/html/boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
+<link rel="home" href="../index.html" title="Contract++ 0.3.490">
+<link rel="up" href="../reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.wrap_hpp" title="Header &lt;E:/sandbox/contractpp/trunk/doc/qbk/src/contract/wrap.hpp&gt;">
+<link rel="prev" href="wrap.html" title="Struct template wrap">
+<link rel="next" href="../CONTRACT_WRAP_TYPE.html" title="Macro CONTRACT_WRAP_TYPE">
+</head>
+<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
+<table cellpadding="2" width="100%"><tr><td valign="top"></td></tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="wrap.html"><img src="../images/prev.png" alt="Prev"></a><a accesskey="u" href="../reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.wrap_hpp"><img src="../images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../images/home.png" alt="Home"></a><a accesskey="n" href="../CONTRACT_WRAP_TYPE.html"><img src="../images/next.png" alt="Next"></a>
+</div>
+<div class="refentry">
+<a name="contract.wrap_void(T)_id439083"></a><div class="titlepage"></div>
+<div class="refnamediv">
+<h2><span class="refentrytitle">Struct template wrap&lt;void(T)&gt;</span></h2>
+<p>contract::wrap&lt;void(T)&gt;</p>
+</div>
+<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
+<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="comment">// In header: &lt;<a class="link" href="../reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.wrap_hpp" title="Header &lt;E:/sandbox/contractpp/trunk/doc/qbk/src/contract/wrap.hpp&gt;">E:/sandbox/contractpp/trunk/doc/qbk/src/contract/wrap.hpp</a>&gt;
+
+</span><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> T<span class="special">&gt;</span>
+<span class="keyword">struct</span> <a class="link" href="wrap_void_T__id439083.html" title="Struct template wrap&lt;void(T)&gt;">wrap</a><span class="special">&lt;</span><span class="keyword">void</span><span class="special">(</span><span class="identifier">T</span><span class="special">)</span><span class="special">&gt;</span> <span class="special">{</span>
+ <span class="comment">// <a class="link" href="wrap_void_T__id439083.html#contract.wrap_void(T)_id439083types">types</a></span>
+ <span class="keyword">typedef</span> <span class="identifier">T</span> <a class="link" href="wrap_void_T__id439083.html#contract.wrap_void(T)_id439083.type"><span class="identifier">type</span></a><span class="special">;</span>
+<span class="special">}</span><span class="special">;</span></pre></div>
+<div class="refsect1">
+<a name="id981361"></a><h2>Description</h2>
+<p>Metafunction used to wrap type expressions containing commas so they can be passed as macro parameters.</p>
+<p>This metafunction first wrap the specified type <code class="computeroutput">T</code> within parenthesis <code class="computeroutput"></code>() (so <code class="computeroutput">T</code> can be passed as a single macro parameter even if it contains commas) forming a void-function type with one argument of type <code class="computeroutput">T</code>. Then the application of the metafunction via its member <code class="computeroutput">type</code> returns the wrapped type <code class="computeroutput">T</code>.</p>
+<p><span class="bold"><strong>Parameters:</strong></span> </p>
+<div class="informaltable"><table class="table">
+<colgroup>
+<col>
+<col>
+</colgroup>
+<tbody><tr>
+<td><span class="bold"><strong><code class="computeroutput">T</code></strong></span></td>
+<td>Type to be wrapped so it can be passed within a macro parameter even if it contains commas. </td>
+</tr></tbody>
+</table></div>
+<p>
+</p>
+<p><span class="bold"><strong>See:</strong></span> CONTRACT_WRAP_TYPE() for more explanation and examples </p>
+<div class="refsect2">
+<a name="id981453"></a><h3>
+<a name="contract.wrap_void(T)_id439083types"></a><code class="computeroutput">wrap</code>
+ public
+ types</h3>
+<div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem">
+<p>
+<span class="keyword">typedef</span> <span class="identifier">T</span> <a name="contract.wrap_void(T)_id439083.type"></a><span class="identifier">type</span><span class="special">;</span></p>
+<p>The type T. </p>
+</li></ol></div>
+</div>
+</div>
+</div>
+<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
+<td align="left"></td>
+<td align="right"><div class="copyright-footer">Copyright &#169; 2009, 2010 Lorenzo Caminiti<p>
+ Distributed under the Contract++ Software License, Version 1.0 (see accompanying
+ file LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="wrap.html"><img src="../images/prev.png" alt="Prev"></a><a accesskey="u" href="../reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.wrap_hpp"><img src="../images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../images/home.png" alt="Home"></a><a accesskey="n" href="../CONTRACT_WRAP_TYPE.html"><img src="../images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>

Added: sandbox/contract/libs/contract/doc/html/contract/wrap_void_T__id439086.html
==============================================================================
--- (empty file)
+++ sandbox/contract/libs/contract/doc/html/contract/wrap_void_T__id439086.html 2011-06-28 20:54:41 EDT (Tue, 28 Jun 2011)
@@ -0,0 +1,76 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
+<title>Struct template wrap&lt;void(T)&gt;</title>
+<link rel="stylesheet" href="../doc/html/boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
+<link rel="home" href="../index.html" title="Contract++ 0.3.490">
+<link rel="up" href="../reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.wrap_hpp" title="Header &lt;E:/sandbox/contractpp/trunk/doc/qbk/src/contract/wrap.hpp&gt;">
+<link rel="prev" href="wrap.html" title="Struct template wrap">
+<link rel="next" href="../CONTRACT_WRAP_TYPE.html" title="Macro CONTRACT_WRAP_TYPE">
+</head>
+<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
+<table cellpadding="2" width="100%"><tr><td valign="top"></td></tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="wrap.html"><img src="../images/prev.png" alt="Prev"></a><a accesskey="u" href="../reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.wrap_hpp"><img src="../images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../images/home.png" alt="Home"></a><a accesskey="n" href="../CONTRACT_WRAP_TYPE.html"><img src="../images/next.png" alt="Next"></a>
+</div>
+<div class="refentry">
+<a name="contract.wrap_void(T)_id439086"></a><div class="titlepage"></div>
+<div class="refnamediv">
+<h2><span class="refentrytitle">Struct template wrap&lt;void(T)&gt;</span></h2>
+<p>contract::wrap&lt;void(T)&gt;</p>
+</div>
+<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
+<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="comment">// In header: &lt;<a class="link" href="../reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.wrap_hpp" title="Header &lt;E:/sandbox/contractpp/trunk/doc/qbk/src/contract/wrap.hpp&gt;">E:/sandbox/contractpp/trunk/doc/qbk/src/contract/wrap.hpp</a>&gt;
+
+</span><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> T<span class="special">&gt;</span>
+<span class="keyword">struct</span> <a class="link" href="wrap_void_T__id439086.html" title="Struct template wrap&lt;void(T)&gt;">wrap</a><span class="special">&lt;</span><span class="keyword">void</span><span class="special">(</span><span class="identifier">T</span><span class="special">)</span><span class="special">&gt;</span> <span class="special">{</span>
+ <span class="comment">// <a class="link" href="wrap_void_T__id439086.html#contract.wrap_void(T)_id439086types">types</a></span>
+ <span class="keyword">typedef</span> <span class="identifier">T</span> <a class="link" href="wrap_void_T__id439086.html#contract.wrap_void(T)_id439086.type"><span class="identifier">type</span></a><span class="special">;</span>
+<span class="special">}</span><span class="special">;</span></pre></div>
+<div class="refsect1">
+<a name="id981392"></a><h2>Description</h2>
+<p>Metafunction used to wrap type expressions containing commas so they can be passed as macro parameters.</p>
+<p>This metafunction first wrap the specified type <code class="computeroutput">T</code> within parenthesis <code class="computeroutput"></code>() (so <code class="computeroutput">T</code> can be passed as a single macro parameter even if it contains commas) forming a void-function type with one argument of type <code class="computeroutput">T</code>. Then the application of the metafunction via its member <code class="computeroutput">type</code> returns the wrapped type <code class="computeroutput">T</code>.</p>
+<p><span class="bold"><strong>Parameters:</strong></span> </p>
+<div class="informaltable"><table class="table">
+<colgroup>
+<col>
+<col>
+</colgroup>
+<tbody><tr>
+<td><span class="bold"><strong><code class="computeroutput">T</code></strong></span></td>
+<td>Type to be wrapped so it can be passed within a macro parameter even if it contains commas. </td>
+</tr></tbody>
+</table></div>
+<p>
+</p>
+<p><span class="bold"><strong>See:</strong></span> CONTRACT_WRAP_TYPE() for more explanation and examples </p>
+<div class="refsect2">
+<a name="id981484"></a><h3>
+<a name="contract.wrap_void(T)_id439086types"></a><code class="computeroutput">wrap</code>
+ public
+ types</h3>
+<div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem">
+<p>
+<span class="keyword">typedef</span> <span class="identifier">T</span> <a name="contract.wrap_void(T)_id439086.type"></a><span class="identifier">type</span><span class="special">;</span></p>
+<p>The type T. </p>
+</li></ol></div>
+</div>
+</div>
+</div>
+<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
+<td align="left"></td>
+<td align="right"><div class="copyright-footer">Copyright &#169; 2009, 2010 Lorenzo Caminiti<p>
+ Distributed under the Contract++ Software License, Version 1.0 (see accompanying
+ file LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="wrap.html"><img src="../images/prev.png" alt="Prev"></a><a accesskey="u" href="../reference.html#header.E:.sandbox.contractpp.trunk.doc.qbk.src.contract.wrap_hpp"><img src="../images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../images/home.png" alt="Home"></a><a accesskey="n" href="../CONTRACT_WRAP_TYPE.html"><img src="../images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>

Added: sandbox/contract/libs/contract/doc/html/contract__/Rationale.html
==============================================================================
--- (empty file)
+++ sandbox/contract/libs/contract/doc/html/contract__/Rationale.html 2011-06-28 20:54:41 EDT (Tue, 28 Jun 2011)
@@ -0,0 +1,149 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
+<title>Annex: Rationale</title>
+<link rel="stylesheet" href="../doc/html/boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
+<link rel="home" href="../index.html" title="Contract++ 0.3.490">
+<link rel="up" href="../index.html" title="Contract++ 0.3.490">
+<link rel="prev" href="Requirements.html" title="Annex: Requirements">
+<link rel="next" href="bibliography.html" title="Bibliography">
+</head>
+<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
+<table cellpadding="2" width="100%"><tr><td valign="top"></td></tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="Requirements.html"><img src="../images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../images/home.png" alt="Home"></a><a accesskey="n" href="bibliography.html"><img src="../images/next.png" alt="Next"></a>
+</div>
+<div class="section">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="contract__.Rationale"></a><a class="link" href="Rationale.html" title="Annex: Rationale">Annex: Rationale</a>
+</h2></div></div></div>
+<div class="toc"><dl>
+<dt><span class="section"><a href="Rationale.html#contract__.Rationale.why_is_the_body_not_passed_as_a_macro_parameter_">Why
+ is the body not passed as a macro parameter?</a></span></dt>
+<dt><span class="section"><a href="Rationale.html#contract__.Rationale.why_the_contract_macros_need_all_class_and_function_signature_elements_">Why
+ the contract macros need all class and function signature elements?</a></span></dt>
+<dt><span class="section"><a href="Rationale.html#contract__.Rationale.why_exception_specifications_are_passed_as_a_macro_parameter___throw________">Why
+ exception specifications are passed as a macro parameter <code class="computeroutput"><span class="special">(</span><span class="keyword">throw</span><span class="special">)(...)</span></code>?</a></span></dt>
+</dl></div>
+<div class="section">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="contract__.Rationale.why_is_the_body_not_passed_as_a_macro_parameter_"></a><a class="link" href="Rationale.html#contract__.Rationale.why_is_the_body_not_passed_as_a_macro_parameter_" title="Why is the body not passed as a macro parameter?">Why
+ is the body not passed as a macro parameter?</a>
+</h3></div></div></div>
+<p>
+ The function, constructor, and destructor definition body is not passed as
+ a macro parameter because macros always expand on a single line. Therefore,
+ if the body was passed as a macro parameter and part of the macro expansion,
+ it would expand on a single line and eventual compiler error referring to
+ code within the body will all have the same line number making it very difficult
+ to pinpoint the error.
+ </p>
+<p>
+ The downside of keeping the body outside the macro expansion is that the
+ additional body function defined to wrap the body will have the same access
+ level as the function being contracted. Therefore, if the function being
+ contracted is not private, the body function will also be not private. However,
+ this is an acceptable limitation because the body function, even if public
+ or protected, will have a special named prefix <code class="computeroutput"><span class="identifier">contract_body_</span><span class="special">...</span></code> indicating that it is part of this library
+ private API and should never be used directly by programmers.
+ </p>
+</div>
+<div class="section">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="contract__.Rationale.why_the_contract_macros_need_all_class_and_function_signature_elements_"></a><a class="link" href="Rationale.html#contract__.Rationale.why_the_contract_macros_need_all_class_and_function_signature_elements_" title="Why the contract macros need all class and function signature elements?">Why
+ the contract macros need all class and function signature elements?</a>
+</h3></div></div></div>
+<p>
+ Even if we do not consider implementation details of this library, a large
+ set of attributes of the declaration signature of classes and function is
+ needed to program contracts. For example: * The class is needed to access
+ the object <code class="computeroutput"><span class="keyword">this</span></code>. * Base classes
+ are needed to automatically support subcontracting. Furthermore, the base
+ class access level is needed because subcontracting could in principle be
+ relaxed for private and protected base classes (this was suggested by A++
+ but the current implementation of the library decided to follow N1962 and
+ not to relax subcontracting for non-public functions). Also to automatically
+ support subcontracting, the function contract macros needed to know if a
+ function if virtual or not (this allows to defined special types for virtual
+ function in the base classes so they can be automatically detected by derived
+ classes via introspection metaprogramming techniques using SFINAE). * The
+ member function access level is needed because class invariants are only
+ checked for public functions. * The static classifier of member functions
+ is needed because static member functions do not check non-static class invariants.
+ * Function parameter types and names are needed because they are need to
+ be passed to the functions checking the preconditions and postconditions.
+ Furthermore, the parameter type needs to be specified separately from the
+ parameter name because the <code class="computeroutput"><span class="keyword">const</span></code>
+ qualifier needs to be added to the type so preconditions and postconditions
+ access parameters only in a constant-correct context. Finally, the parameter
+ names are used to emulate function overloading (i.e., functions with same
+ name can have separate contracts as long as they have different parameter
+ names). * The function result type is needed so the result value can be accessed
+ by postconditions for non-void functions. * Template parameters are needed
+ to check contracts.
+ </p>
+<p>
+ Given the large number of signature attributes that are needed to specify
+ contracts, the parenthesized signature was used so the library has access
+ to all the attributes of the signature. Furthermore, to avoid duplicating
+ the signature attributes (which would require programmers to duplicate code
+ making both development and manteinace more tedius), all the attributes are
+ specified within the macros so the macros can also generated the class and
+ function signature automatically.
+ </p>
+</div>
+<div class="section">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="contract__.Rationale.why_exception_specifications_are_passed_as_a_macro_parameter___throw________"></a><a class="link" href="Rationale.html#contract__.Rationale.why_exception_specifications_are_passed_as_a_macro_parameter___throw________" title="Why exception specifications are passed as a macro parameter (throw)(...)?">Why
+ exception specifications are passed as a macro parameter <code class="computeroutput"><span class="special">(</span><span class="keyword">throw</span><span class="special">)(...)</span></code>?</a>
+</h3></div></div></div>
+<p>
+ Exception specifications cannot simply be programmed outside the contract
+ macros before the body is specified as:
+ </p>
+<pre class="programlisting"><span class="identifier">CONTRACT_FUNCTION</span><span class="special">(</span> <span class="special">(</span><span class="keyword">void</span><span class="special">)(</span><span class="identifier">f</span><span class="special">)(</span> <span class="special">(</span><span class="keyword">void</span><span class="special">)</span> <span class="special">)</span> <span class="special">)</span> <span class="keyword">throw</span><span class="special">()</span> <span class="special">{</span>
+ <span class="special">...</span>
+<span class="special">}</span>
+</pre>
+<p>
+ Because this way the exception specification only apply to the body function
+ and the macro expansion cannot apply them to the actual function:
+ </p>
+<pre class="programlisting"><span class="keyword">void</span> <span class="identifier">f</span><span class="special">()</span> <span class="special">{</span>
+ <span class="special">...</span> <span class="comment">// Check preconditions.</span>
+ <span class="identifier">f_body</span><span class="special">();</span> <span class="comment">// Execute body.</span>
+ <span class="special">...</span> <span class="comment">// Check postconditions.</span>
+<span class="special">}</span>
+<span class="special">...</span>
+<span class="keyword">void</span> <span class="identifier">f_body</span><span class="special">()</span> <span class="keyword">throw</span><span class="special">()</span> <span class="special">{</span>
+ <span class="special">...</span>
+<span class="special">}</span>
+</pre>
+<p>
+ So if for some reason the precondition or postcondition (or invariant, or
+ any other code of this library) throws an exception, the function <code class="computeroutput"><span class="identifier">f</span><span class="special">()</span></code> will
+ still throw that exception not complying with the exception specification.
+ </p>
+<p>
+ Therefore, the exception specification are passed as a macro parameter (complicating
+ the parenthesized syntax a bit) so they can applied by the macro expansion
+ to the outer most function <code class="computeroutput"><span class="identifier">f</span><span class="special">()</span></code> and not just to its body function.
+ </p>
+</div>
+</div>
+<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
+<td align="left"></td>
+<td align="right"><div class="copyright-footer">Copyright &#169; 2009, 2010 Lorenzo Caminiti<p>
+ Distributed under the Contract++ Software License, Version 1.0 (see accompanying
+ file LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="Requirements.html"><img src="../images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../images/home.png" alt="Home"></a><a accesskey="n" href="bibliography.html"><img src="../images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>

Added: sandbox/contract/libs/contract/doc/html/contract__/Requirements.html
==============================================================================
--- (empty file)
+++ sandbox/contract/libs/contract/doc/html/contract__/Requirements.html 2011-06-28 20:54:41 EDT (Tue, 28 Jun 2011)
@@ -0,0 +1,657 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
+<title>Annex: Requirements</title>
+<link rel="stylesheet" href="../doc/html/boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
+<link rel="home" href="../index.html" title="Contract++ 0.3.490">
+<link rel="up" href="../index.html" title="Contract++ 0.3.490">
+<link rel="prev" href="../CONTRACT_WRAP_TYPE.html" title="Macro CONTRACT_WRAP_TYPE">
+<link rel="next" href="Rationale.html" title="Annex: Rationale">
+</head>
+<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
+<table cellpadding="2" width="100%"><tr><td valign="top"></td></tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="../CONTRACT_WRAP_TYPE.html"><img src="../images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../images/home.png" alt="Home"></a><a accesskey="n" href="Rationale.html"><img src="../images/next.png" alt="Next"></a>
+</div>
+<div class="section">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="contract__.Requirements"></a><a class="link" href="Requirements.html" title="Annex: Requirements">Annex: Requirements</a>
+</h2></div></div></div>
+<div class="table">
+<a name="id982831"></a><p class="title"><b>Table&#160;4.&#160;Steps executed by a call to a function with a contract.</b></p>
+<div class="table-contents"><table class="table" summary="Steps executed by a call to a function with a contract.">
+<colgroup>
+<col>
+<col>
+<col>
+<col>
+<col>
+<col>
+<col>
+</colgroup>
+<thead><tr>
+<th>
+ <p>
+ Step
+ </p>
+ </th>
+<th>
+ <p>
+ Task
+ </p>
+ </th>
+<th>
+ <p>
+ Constructor
+ </p>
+ </th>
+<th>
+ <p>
+ Destructor
+ </p>
+ </th>
+<th>
+ <p>
+ Non-Static Member Function
+ </p>
+ </th>
+<th>
+ <p>
+ Static Member Function
+ </p>
+ </th>
+<th>
+ <p>
+ Free Function
+ </p>
+ </th>
+</tr></thead>
+<tbody>
+<tr>
+<td>
+ <p>
+ 1.
+ </p>
+ </td>
+<td>
+ <p>
+ <span class="emphasis"><em>Check static class invariants AND...</em></span>
+ </p>
+ </td>
+<td>
+ <p>
+ Yes.
+ </p>
+ </td>
+<td>
+ <p>
+ Yes.
+ </p>
+ </td>
+<td>
+ <p>
+ Yes.
+ </p>
+ </td>
+<td>
+ <p>
+ Yes.
+ </p>
+ </td>
+<td>
+ <p>
+ No (because there is no class for free functions).
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ 2.
+ </p>
+ </td>
+<td>
+ <p>
+ <span class="emphasis"><em>... AND check static class invariants for all base classes</em></span>
+ </p>
+ </td>
+<td>
+ <p>
+ Yes.
+ </p>
+ </td>
+<td>
+ <p>
+ Yes.
+ </p>
+ </td>
+<td>
+ <p>
+ Yes.
+ </p>
+ </td>
+<td>
+ <p>
+ Yes.
+ </p>
+ </td>
+<td>
+ <p>
+ No (because there is no inheritance for free functions).
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ 3.
+ </p>
+ </td>
+<td>
+ <p>
+ <span class="emphasis"><em>Check class invariants AND...</em></span>
+ </p>
+ </td>
+<td>
+ <p>
+ No (because there is no object before constructor body execution).
+ </p>
+ </td>
+<td>
+ <p>
+ Yes.
+ </p>
+ </td>
+<td>
+ <p>
+ Yes.
+ </p>
+ </td>
+<td>
+ <p>
+ No (because there is no object for static member functions).
+ </p>
+ </td>
+<td>
+ <p>
+ No (because there is no object for free functions).
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ 4.
+ </p>
+ </td>
+<td>
+ <p>
+ <span class="emphasis"><em>... AND check class invariants for all base classes</em></span>
+ </p>
+ </td>
+<td>
+ <p>
+ No (because there is no object before constructor body execution).
+ </p>
+ </td>
+<td>
+ <p>
+ Yes.
+ </p>
+ </td>
+<td>
+ <p>
+ Yes.
+ </p>
+ </td>
+<td>
+ <p>
+ No (because there is no inheritance for static member functions).
+ </p>
+ </td>
+<td>
+ <p>
+ No (because there is no inheritance for free functions).
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ 5.
+ </p>
+ </td>
+<td>
+ <p>
+ <span class="emphasis"><em>Check function preconditions OR...</em></span>
+ </p>
+ </td>
+<td>
+ <p>
+ Yes but without accessing the object (because there is no object
+ before constructor body execution) plus before constructing any base
+ class and before initializing any member variable (because object
+ construction should not start at all, not even the construction of
+ the base objects or of the members, if the constructor preconditions
+ are not satisfied).
+ </p>
+ </td>
+<td>
+ <p>
+ No (because destructors have no function parameter).
+ </p>
+ </td>
+<td>
+ <p>
+ Yes.
+ </p>
+ </td>
+<td>
+ <p>
+ Yes but without accessing the object (because there is no object
+ for static member functions).
+ </p>
+ </td>
+<td>
+ <p>
+ Yes.
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ 6.
+ </p>
+ </td>
+<td>
+ <p>
+ <span class="emphasis"><em>... OR check preconditions of overridden functions from
+ all base classes</em></span>
+ </p>
+ </td>
+<td>
+ <p>
+ Yes (same as above).
+ </p>
+ </td>
+<td>
+ <p>
+ No (same as above).
+ </p>
+ </td>
+<td>
+ <p>
+ Yes.
+ </p>
+ </td>
+<td>
+ <p>
+ No (because there is no inheritance for static member functions).
+ </p>
+ </td>
+<td>
+ <p>
+ No (because there is no inheritance for free functions).
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ 7.
+ </p>
+ </td>
+<td>
+ <p>
+ <span class="emphasis"><em>Copy old-of values AND...</em></span>
+ </p>
+ </td>
+<td>
+ <p>
+ Yes but old-of expressions cannot access the object (because there
+ is no object before constructor body execution).
+ </p>
+ </td>
+<td>
+ <p>
+ No (because destructors have no postconditions and therefore no old-of).
+ </p>
+ </td>
+<td>
+ <p>
+ Yes.
+ </p>
+ </td>
+<td>
+ <p>
+ Yes but old-of expressions cannot access the object (because there
+ is no object in static member functions).
+ </p>
+ </td>
+<td>
+ <p>
+ Yes.
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ 8.
+ </p>
+ </td>
+<td>
+ <p>
+ <span class="emphasis"><em>... AND copy old-of values of overridden functions from
+ all base classes</em></span>
+ </p>
+ </td>
+<td>
+ <p>
+ Yes (same as above).
+ </p>
+ </td>
+<td>
+ <p>
+ No (same as above).
+ </p>
+ </td>
+<td>
+ <p>
+ Yes.
+ </p>
+ </td>
+<td>
+ <p>
+ No (because there is no inheritance for static member functions).
+ </p>
+ </td>
+<td>
+ <p>
+ No (because there is no inheritance for free functions).
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ 9.
+ </p>
+ </td>
+<td>
+ <p>
+ <span class="emphasis"><em>Execute body</em></span>
+ </p>
+ </td>
+<td>
+ <p>
+ Yes.
+ </p>
+ </td>
+<td>
+ <p>
+ Yes.
+ </p>
+ </td>
+<td>
+ <p>
+ Yes.
+ </p>
+ </td>
+<td>
+ <p>
+ Yes.
+ </p>
+ </td>
+<td>
+ <p>
+ Yes.
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ 10.
+ </p>
+ </td>
+<td>
+ <p>
+ <span class="emphasis"><em>Check static class invariants AND...</em></span>
+ </p>
+ </td>
+<td>
+ <p>
+ Yes.
+ </p>
+ </td>
+<td>
+ <p>
+ Yes.
+ </p>
+ </td>
+<td>
+ <p>
+ Yes.
+ </p>
+ </td>
+<td>
+ <p>
+ Yes.
+ </p>
+ </td>
+<td>
+ <p>
+ No (because there is no class for free functions).
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ 11.
+ </p>
+ </td>
+<td>
+ <p>
+ <span class="emphasis"><em>... AND check static class invariants for all base classes</em></span>
+ </p>
+ </td>
+<td>
+ <p>
+ Yes.
+ </p>
+ </td>
+<td>
+ <p>
+ Yes.
+ </p>
+ </td>
+<td>
+ <p>
+ Yes.
+ </p>
+ </td>
+<td>
+ <p>
+ Yes.
+ </p>
+ </td>
+<td>
+ <p>
+ No (because there is no inheritance for free functions).
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ 12.
+ </p>
+ </td>
+<td>
+ <p>
+ <span class="emphasis"><em>Check class invariants AND...</em></span>
+ </p>
+ </td>
+<td>
+ <p>
+ Yes (because the object has been constructed).
+ </p>
+ </td>
+<td>
+ <p>
+ No (because there is no object after destructor body execution).
+ </p>
+ </td>
+<td>
+ <p>
+ Yes.
+ </p>
+ </td>
+<td>
+ <p>
+ No (because there is no object for static member functions).
+ </p>
+ </td>
+<td>
+ <p>
+ No (because there is no object for free functions).
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ 13.
+ </p>
+ </td>
+<td>
+ <p>
+ <span class="emphasis"><em>... AND check class invariants for all base classes</em></span>
+ </p>
+ </td>
+<td>
+ <p>
+ Yes (because the object has been constructed).
+ </p>
+ </td>
+<td>
+ <p>
+ No (because there is no object after destructor body execution).
+ </p>
+ </td>
+<td>
+ <p>
+ Yes.
+ </p>
+ </td>
+<td>
+ <p>
+ No (because there is no inheritance for static member functions).
+ </p>
+ </td>
+<td>
+ <p>
+ No (because there is no inheritance for free functions).
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ 14.
+ </p>
+ </td>
+<td>
+ <p>
+ <span class="emphasis"><em>Check function postconditions AND...</em></span>
+ </p>
+ </td>
+<td>
+ <p>
+ Yes.
+ </p>
+ </td>
+<td>
+ <p>
+ No (because destructors have no function parameter and there is no
+ object after destructor body execution).
+ </p>
+ </td>
+<td>
+ <p>
+ Yes.
+ </p>
+ </td>
+<td>
+ <p>
+ Yes.
+ </p>
+ </td>
+<td>
+ <p>
+ Yes.
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ 15.
+ </p>
+ </td>
+<td>
+ <p>
+ <span class="emphasis"><em>... AND check postconditions of overridden functions from
+ all base classes</em></span>
+ </p>
+ </td>
+<td>
+ <p>
+ Yes.
+ </p>
+ </td>
+<td>
+ <p>
+ No (because there is no object after destructor body execution).
+ </p>
+ </td>
+<td>
+ <p>
+ Yes.
+ </p>
+ </td>
+<td>
+ <p>
+ No (because there is no inheritance for static member functions).
+ </p>
+ </td>
+<td>
+ <p>
+ No (because there is no inheritance for free functions).
+ </p>
+ </td>
+</tr>
+</tbody>
+</table></div>
+</div>
+<br class="table-break">
+</div>
+<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
+<td align="left"></td>
+<td align="right"><div class="copyright-footer">Copyright &#169; 2009, 2010 Lorenzo Caminiti<p>
+ Distributed under the Contract++ Software License, Version 1.0 (see accompanying
+ file LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="../CONTRACT_WRAP_TYPE.html"><img src="../images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../images/home.png" alt="Home"></a><a accesskey="n" href="Rationale.html"><img src="../images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>

Added: sandbox/contract/libs/contract/doc/html/contract__/bibliography.html
==============================================================================
--- (empty file)
+++ sandbox/contract/libs/contract/doc/html/contract__/bibliography.html 2011-06-28 20:54:41 EDT (Tue, 28 Jun 2011)
@@ -0,0 +1,136 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
+<title>Bibliography</title>
+<link rel="stylesheet" href="../doc/html/boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
+<link rel="home" href="../index.html" title="Contract++ 0.3.490">
+<link rel="up" href="../index.html" title="Contract++ 0.3.490">
+<link rel="prev" href="Rationale.html" title="Annex: Rationale">
+<link rel="next" href="license.html" title="License">
+</head>
+<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
+<table cellpadding="2" width="100%"><tr><td valign="top"></td></tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="Rationale.html"><img src="../images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../images/home.png" alt="Home"></a><a accesskey="n" href="license.html"><img src="../images/next.png" alt="Next"></a>
+</div>
+<div class="section">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="contract__.bibliography"></a><a class="link" href="bibliography.html" title="Bibliography">Bibliography</a>
+</h2></div></div></div>
+<p>
+ [Abrahams2005] D. Abrahams, L. Crowl, T. Ottosen, and J. Widman. <span class="emphasis"><em>Proposal
+ to add Contract Programming to C++ (revision 2).</em></span> The C++ Standards
+ Committee, n1773,
+ 2005.
+ </p>
+<p>
+ [Bright2004] W. Bright. <a href="http://www.digitalmars.com/d/2.0/dbc.html" target="_top"><span class="emphasis"><em>Contract
+ Programming for the D Programming Language.</em></span></a> 2004.
+ </p>
+<p>
+ [Bright2004b] W. Bright. <a href="http://www.digitalmars.com/ctg/contract.html" target="_top"><span class="emphasis"><em>Contract
+ Programming for the Digital Mars C++ Compiler.</em></span></a> 2004.
+ </p>
+<p>
+ [C^2] Aechmea. <a href="http://www.programmersheaven.com/app/news/DisplayNews.aspx?NewsID=3843" target="_top"><span class="emphasis"><em>C^2
+ Contract Programming add-on for C++.</em></span></a> 2005.
+ </p>
+<p>
+ [Chrome2002] RemObjects. <a href="http://blogs.remobjects.com/blogs/mh/2008/05/01/p216" target="_top"><span class="emphasis"><em>Chromes:
+ Contract Programming for Object Pascal in .NET.</em></span></a> 2002.
+ </p>
+<p>
+ [Cline1990] M. Cline and D. Lea. "The Behaviour of C++ Classes" and
+ "Using Annotated C++". <span class="emphasis"><em>Proc. of the Symposium on Object
+ Oriented Programming Emphasizing Practical Applications</em></span>, Maris College,
+ 19090.
+ </p>
+<p>
+ [Crowl2005] L. Crowl and T. Ottosen. <span class="emphasis"><em>Proposal to add Contract Programming
+ to C++ (revision 3).</em></span> The C++ Standards Committee, n1866,
+ 2005.
+ </p>
+<p>
+ [Crowl2006] L. Crowl and T. Ottosen. <span class="emphasis"><em>Proposal to add Contract Programming
+ to C++ (revision 4).</em></span> The C++ Standards Committee, n1962,
+ 2006.
+ </p>
+<p>
+ [iContract] O. Enseling. <a href="http://www.javaworld.com/javaworld/jw-02-2001/jw-0216-cooltools.html" target="_top"><span class="emphasis"><em>iContract:
+ Contract Programming for Java.</em></span></a> 2001.
+ </p>
+<p>
+ [Jcontract] Parasoft. <a href="http://www.parasoft.com/jsp/products/article.jsp?label=product_info_Jcontract" target="_top"><span class="emphasis"><em>Jcontract:
+ Contract Programming for Java.</em></span></a>
+ </p>
+<p>
+ [Maley1999] D. Maley and I. Spence. <a href="http://www.computer.org/portal/web/csdl/doi/10.1109/TOOLS.1999.779000" target="_top"><span class="emphasis"><em>Emulating
+ Design by Contract in C++.</em></span></a> Proceedings of TOOLS, IEEE Computer
+ Society, 1999.
+ </p>
+<p>
+ [Meyer1997] B. Meyer. <span class="emphasis"><em>Object Oriented Software Construction.</em></span>
+ Prentice-Hall, 2nd edition, 1997.
+ </p>
+<p>
+ [Mitchell2002] R. Mitchell and J. McKim. <span class="emphasis"><em>Design by Contract, by Example.</em></span>
+ Addison-Wesley, 2002.
+ </p>
+<p>
+ [Nelson2004] C. Nelson. <span class="emphasis"><em>Working draft changes for C99 preprocessor
+ synchronization.</em></span> C++ Standards Committee n1653,
+ 2004.
+ </p>
+<p>
+ [Ottosen2004] T. Ottosen. <span class="emphasis"><em>Proposal to add Design by Contract to C++.</em></span>
+ The C++ Standards Committee, n1613,
+ 2004.
+ </p>
+<p>
+ [Ottosen2004b] T. Ottosen. <span class="emphasis"><em>Proposal to add Contract Programming to
+ C++ (revision 1).</em></span> The C++ Standards Committee, n1669,
+ 2004.
+ </p>
+<p>
+ [SPARKAda] Praxis. <a href="http://www.praxis-his.com/sparkada/language.asp" target="_top"><span class="emphasis"><em>SPARKAda
+ (Ada-like Language with Contract Programming).</em></span></a>
+ </p>
+<p>
+ [Spec#] Microsoft. <a href="http:://research.microsoft.com/en-us/projects/specsharp/" target="_top"><span class="emphasis"><em>Spec#
+ (C# Extension).</em></span></a>
+ </p>
+<p>
+ [Stroustrup1997] B. Stroustrup. <span class="emphasis"><em>The C++ Programming Language.</em></span>
+ Prentice-Hall, 2nd Edition, 1997
+ </p>
+<p>
+ [Sutter2005] H. Sutter and F. Glassborow. <span class="emphasis"><em>Delegating Constructors,
+ revision 2.</em></span> C++ Standards Committee, n1895,
+ 2005.
+ </p>
+<p>
+ [Tandin2004] A. Tandin. <a href="http://www.codeproject.com/KB/macros/DbC_and_Doxygen.aspx" target="_top"><span class="emphasis"><em>Design
+ by Contract macros for C++ and link to Doxygen.</em></span></a> 2004.
+ </p>
+<p>
+ [Wilson2006] M. Wilson. <span class="emphasis"><em>Contract Programming 101 -- The Nuclear Reactor
+ and the Deep Space Probe.</em></span> <a href="http://www.artima.com/cppsource/deepspace.html" target="_top">The
+ C++ Source</a>, 2006.
+ </p>
+</div>
+<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
+<td align="left"></td>
+<td align="right"><div class="copyright-footer">Copyright &#169; 2009, 2010 Lorenzo Caminiti<p>
+ Distributed under the Contract++ Software License, Version 1.0 (see accompanying
+ file LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="Rationale.html"><img src="../images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../images/home.png" alt="Home"></a><a accesskey="n" href="license.html"><img src="../images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>

Added: sandbox/contract/libs/contract/doc/html/contract__/contract_programming.html
==============================================================================
--- (empty file)
+++ sandbox/contract/libs/contract/doc/html/contract__/contract_programming.html 2011-06-28 20:54:41 EDT (Tue, 28 Jun 2011)
@@ -0,0 +1,886 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
+<title>Annex: Contract Programming</title>
+<link rel="stylesheet" href="../doc/html/boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
+<link rel="home" href="../index.html" title="Contract++ 0.3.490">
+<link rel="up" href="../index.html" title="Contract++ 0.3.490">
+<link rel="prev" href="throw_on_failure.html" title="Annex: Throw on Failure">
+<link rel="next" href="Grammar.html" title="Appendix: Grammar">
+</head>
+<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
+<table cellpadding="2" width="100%"><tr><td valign="top"></td></tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="throw_on_failure.html"><img src="../images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../images/home.png" alt="Home"></a><a accesskey="n" href="Grammar.html"><img src="../images/next.png" alt="Next"></a>
+</div>
+<div class="section">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="contract__.contract_programming"></a><a class="link" href="contract_programming.html" title="Annex: Contract Programming">Annex: Contract Programming</a>
+</h2></div></div></div>
+<div class="toc"><dl>
+<dt><span class="section">Features</span></dt>
+<dt><span class="section">Requirements</span></dt>
+<dt><span class="section">Benefits</span></dt>
+<dt><span class="section">Costs</span></dt>
+<dt><span class="section">Other Tools</span></dt>
+</dl></div>
+<p>
+ This section continues the discussion on Contract Programming started in <a class="link" href="tutorial.html#contract__.tutorial.contract_programming_overview" title="Contract Programming Overview">Contract Programming
+ Overview</a>.
+ </p>
+<div class="section">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="contract__.contract_programming.features"></a><a class="link" href="contract_programming.html#contract__.contract_programming.features" title="Features">Features</a>
+</h3></div></div></div>
+<p>
+ The following table compares features between this library, the proposal
+ for adding Contract Programming to the C++ standard <a class="link" href="bibliography.html" title="Bibliography">[Crowl2006]</a>
+ (see also <a class="link" href="bibliography.html" title="Bibliography">[Crowl2005]</a>, <a class="link" href="bibliography.html" title="Bibliography">[Abrahams2005]</a>, <a class="link" href="bibliography.html" title="Bibliography">[Ottosen2004b]</a>,
+ and <a class="link" href="bibliography.html" title="Bibliography">[Ottosen2004]</a>) <sup>[<a name="id951030" href="#ftn.id951030" class="footnote">19</a>]</sup> , the Eiffel programming language <a class="link" href="bibliography.html" title="Bibliography">[Meyer1997]</a>,
+ and the D programming language <a class="link" href="bibliography.html" title="Bibliography">[Bright2004]</a>.
+ </p>
+<div class="table">
+<a name="id951060"></a><p class="title"><b>Table&#160;1.&#160;Contract Programming Feature Comparison</b></p>
+<div class="table-contents"><table class="table" summary="Contract Programming Feature Comparison">
+<colgroup>
+<col>
+<col>
+<col>
+<col>
+<col>
+</colgroup>
+<thead><tr>
+<th>
+ <p>
+ Feature
+ </p>
+ </th>
+<th>
+ <p>
+ This Library
+ </p>
+ </th>
+<th>
+ <p>
+ C++ Standard Proposal
+ </p>
+ </th>
+<th>
+ <p>
+ ISE Eiffel 5.4
+ </p>
+ </th>
+<th>
+ <p>
+ D
+ </p>
+ </th>
+</tr></thead>
+<tbody>
+<tr>
+<td>
+ <p>
+ <span class="emphasis"><em>Keywords</em></span>
+ </p>
+ </td>
+<td>
+ <p>
+ In contract macros preprocessor sequence: <code class="literal">(precondition)</code>,
+ <code class="literal">(postcondition)</code>, <code class="literal">(body)</code>,
+ <code class="literal">(copyable)</code>, <code class="literal">(inherit)</code>
+ </p>
+ </td>
+<td>
+ <p>
+ <code class="literal">invariant</code>, <code class="literal">precondition</code>,
+ <code class="literal">postcondition</code>, <code class="literal">oldof</code>
+ </p>
+ </td>
+<td>
+ <p>
+ <code class="literal">invariant</code>, <code class="literal">require</code>, <code class="literal">ensure</code>,
+ <code class="literal">do</code>, <code class="literal">require else</code>, <code class="literal">ensure
+ then</code>, <code class="literal">old</code>, <code class="literal">result</code>,
+ <code class="literal">variant</code>
+ </p>
+ </td>
+<td>
+ <p>
+ <code class="literal">invariant</code>, <code class="literal">in</code>, <code class="literal">out</code>,
+ <code class="literal">assert</code>, <code class="literal">static</code>
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ <span class="emphasis"><em>On contract failure</em></span>
+ </p>
+ </td>
+<td>
+ <p>
+ Default to <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">terminate</span><span class="special">()</span></code> but can be customized (might
+ throw)
+ </p>
+ </td>
+<td>
+ <p>
+ Default to <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">terminate</span><span class="special">()</span></code> but can be customized (might
+ throw)
+ </p>
+ </td>
+<td>
+ <p>
+ Throw exception
+ </p>
+ </td>
+<td>
+ <p>
+ Throw exception
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ <span class="emphasis"><em>Return value in postconditions</em></span>
+ </p>
+ </td>
+<td>
+ <p>
+ Yes, <code class="literal">(postcondition)(</code><span class="emphasis"><em>result-name</em></span><code class="literal">)</code>
+ </p>
+ </td>
+<td>
+ <p>
+ Yes, <code class="literal">postcondition (</code><span class="emphasis"><em>result-name</em></span><code class="literal">)</code>
+ </p>
+ </td>
+<td>
+ <p>
+ Yes, <code class="literal">result</code> keyword
+ </p>
+ </td>
+<td>
+ <p>
+ No
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ <span class="emphasis"><em>Old values in postconditions</em></span>
+ </p>
+ </td>
+<td>
+ <p>
+ Yes, <code class="literal">CONTRACT_OLDOF(</code><span class="emphasis"><em>name</em></span><code class="literal">)</code>
+ (but only for class and argument types tagged <code class="computeroutput"><span class="identifier">contract</span><span class="special">::</span><span class="identifier">copyable</span></code>)
+ </p>
+ </td>
+<td>
+ <p>
+ Yes, <code class="literal">oldof</code> keyword
+ </p>
+ </td>
+<td>
+ <p>
+ Yes, <code class="literal">old</code> keyword
+ </p>
+ </td>
+<td>
+ <p>
+ No
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ <span class="emphasis"><em>Subcontracting</em></span>
+ </p>
+ </td>
+<td>
+ <p>
+ Yes, also support multiple base contracts for multiple inheritance
+ </p>
+ </td>
+<td>
+ <p>
+ Yes, also support multiple base contracts but only base classes
+ can specify preconditions
+ </p>
+ </td>
+<td>
+ <p>
+ Yes
+ </p>
+ </td>
+<td>
+ <p>
+ Yes
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ <span class="emphasis"><em>Contracts for abstract functions</em></span>
+ </p>
+ </td>
+<td>
+ <p>
+ Yes
+ </p>
+ </td>
+<td>
+ <p>
+ Yes
+ </p>
+ </td>
+<td>
+ <p>
+ Yes
+ </p>
+ </td>
+<td>
+ <p>
+ No (planned)
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ <span class="emphasis"><em>Arbitrary code in contracts</em></span>
+ </p>
+ </td>
+<td>
+ <p>
+ Yes (but recommended to limit contracts to a list of assertions
+ <code class="literal">CONTRACT_ASSERT()</code> and to use only public members
+ in preconditions)
+ </p>
+ </td>
+<td>
+ <p>
+ No, assertions only
+ </p>
+ </td>
+<td>
+ <p>
+ No, assertions only plus preconditions can only access public members
+ </p>
+ </td>
+<td>
+ <p>
+ Yes
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ <span class="emphasis"><em>Constant-correct</em></span>
+ </p>
+ </td>
+<td>
+ <p>
+ Yes
+ </p>
+ </td>
+<td>
+ <p>
+ Yes
+ </p>
+ </td>
+<td>
+ <p>
+ Yes
+ </p>
+ </td>
+<td>
+ <p>
+ No
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ <span class="emphasis"><em>Function code ordering</em></span>
+ </p>
+ </td>
+<td>
+ <p>
+ In contract macros preprocessor sequence: Preconditions -&gt; postconditions
+ -&gt; body
+ </p>
+ </td>
+<td>
+ <p>
+ Preconditions, postconditions, body
+ </p>
+ </td>
+<td>
+ <p>
+ Preconditions, body, postconditions
+ </p>
+ </td>
+<td>
+ <p>
+ Preconditions, postconditions, body
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ <span class="emphasis"><em>Static assertions</em></span>
+ </p>
+ </td>
+<td>
+ <p>
+ No (but Boost.MPL
+ can be used within contracts)
+ </p>
+ </td>
+<td>
+ <p>
+ No
+ </p>
+ </td>
+<td>
+ <p>
+ No
+ </p>
+ </td>
+<td>
+ <p>
+ Yes
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ <span class="emphasis"><em>Block invariants</em></span>
+ </p>
+ </td>
+<td>
+ <p>
+ Yes, <code class="literal">CONTRACT_ASSERT_BLOCK_INVARIANT()</code>
+ </p>
+ </td>
+<td>
+ <p>
+ Yes, <code class="literal">invariant</code>
+ </p>
+ </td>
+<td>
+ <p>
+ No, but support loop invariants (loops are special code blocks
+ that iterate)
+ </p>
+ </td>
+<td>
+ <p>
+ No
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ <span class="emphasis"><em>Loop variants</em></span>
+ </p>
+ </td>
+<td>
+ <p>
+ Yes, <code class="literal">CONTRACT_ASSERT_LOOP_VARIANT()</code> and <code class="literal">CONTRACT_INIT_LOOP_VARIANT</code>
+ </p>
+ </td>
+<td>
+ <p>
+ No
+ </p>
+ </td>
+<td>
+ <p>
+ Yes
+ </p>
+ </td>
+<td>
+ <p>
+ No
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ <span class="emphasis"><em>Disable assertion checking within assertions checking
+ (policy)</em></span>
+ </p>
+ </td>
+<td>
+ <p>
+ Yes (to prevent infinite recursion)
+ </p>
+ </td>
+<td>
+ <p>
+ Yes, but not in preconditions
+ </p>
+ </td>
+<td>
+ <p>
+ Yes
+ </p>
+ </td>
+<td>
+ <p>
+ No
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ <span class="emphasis"><em>Nested function calls (policy)</em></span>
+ </p>
+ </td>
+<td>
+ <p>
+ Disable checking of class invariants (static and non)
+ </p>
+ </td>
+<td>
+ <p>
+ Disable nothing
+ </p>
+ </td>
+<td>
+ <p>
+ Disable all checks
+ </p>
+ </td>
+<td>
+ <p>
+ Disable nothing
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ <span class="emphasis"><em>Non-static class invariants checking (policy)</em></span>
+ </p>
+ </td>
+<td>
+ <p>
+ At constructor exit, around any non-static function, at destructor
+ entry, and at function exit due to exception -- but only if programmers
+ specifies contracts for those (e.g., if no contract specified for
+ a private function then no class invariant and no contract is checked
+ for that function)
+ </p>
+ </td>
+<td>
+ <p>
+ At constructor exit, around public functions, at destructor entry,
+ and at function exit due to exception
+ </p>
+ </td>
+<td>
+ <p>
+ At constructor exit, and around public functions
+ </p>
+ </td>
+<td>
+ <p>
+ At constructor exit, around public functions, and at destructor
+ entry
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ <span class="emphasis"><em>Static class invariants checking (policy)</em></span>
+ </p>
+ </td>
+<td>
+ <p>
+ At entry and exit of any (also static) member function, constructor,
+ and destructor
+ </p>
+ </td>
+<td>
+ <p>
+ No static class invariants
+ </p>
+ </td>
+<td>
+ <p>
+ No static class invariants
+ </p>
+ </td>
+<td>
+ <p>
+ No static class invariants
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ <span class="emphasis"><em>Removable from object code</em></span>
+ </p>
+ </td>
+<td>
+ <p>
+ Yes, any combinations of <code class="computeroutput"><span class="identifier">CONTRACT_CHECK_BLOCK_INVARIANT</span></code>,
+ <code class="computeroutput"><span class="identifier">CONTRACT_CHECK_CLASS_INVARIANT</span></code>,
+ <code class="computeroutput"><span class="identifier">CONTRACT_CHECK_PRECONDITION</span></code>,
+ and <code class="computeroutput"><span class="identifier">CONTRACT_CHECK_POSTCONDITION</span></code>
+ </p>
+ </td>
+<td>
+ <p>
+ Yes
+ </p>
+ </td>
+<td>
+ <p>
+ Yes (but predefined combinations only)
+ </p>
+ </td>
+<td>
+ <p>
+ Yes
+ </p>
+ </td>
+</tr>
+</tbody>
+</table></div>
+</div>
+<br class="table-break">
+</div>
+<div class="section">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="contract__.contract_programming.requirements"></a><a class="link" href="contract_programming.html#contract__.contract_programming.requirements" title="Requirements">Requirements</a>
+</h3></div></div></div>
+<p>
+ The design of this library was largely based on the requirements identified
+ by the different revisions of the proposal for adding Contract Programming
+ to the C++ standard <a class="link" href="bibliography.html" title="Bibliography">[Crowl2006, etc]</a>
+ and by the Eiffel programming language <a class="link" href="bibliography.html" title="Bibliography">[Meyer1997]</a>.
+ </p>
+<p>
+ This is a list of some of the specific requirements considered for the library
+ design:
+ </p>
+<div class="orderedlist"><ol class="orderedlist" type="1">
+<li class="listitem">
+ Implement Contract Programming within ISO standard C++ (without using
+ external preprcessing tools, etc).
+ </li>
+<li class="listitem">
+ Support optional contract compilation and checking. Programmers can select
+ any combination among invariants, preconditions, and postconditions to
+ be compiled and checked (e.g., compile and check invariants and postconditions
+ only).
+ </li>
+<li class="listitem">
+ Programmers can decide the action to take on contract failure.
+ </li>
+<li class="listitem">
+ Programmers can completely remove contract code for compilation. In other
+ words, if no invariants, no preconditions, and no postconditions are
+ compiled and checked then the user code should remain unchanged (for
+ object size, execution time, compilation-time, etc).
+ </li>
+<li class="listitem">
+ Support old values in postconditions for copyable types. Plus allow programmers
+ to remove the extra copy overhead even for copyable types if the old
+ value is not needed in postconditions (e.g., by not specifying the type
+ copyable).
+ </li>
+<li class="listitem">
+ Support result value in postconditions.
+ </li>
+<li class="listitem">
+ Support subcontracting with multiple inheritance.
+ </li>
+<li class="listitem">
+ Enforce contract constant-correctness at compile-time.
+ </li>
+<li class="listitem">
+ Do not alter the user code public API.
+ </li>
+<li class="listitem">
+ Support contract for all C++ constructs (operators, template class, template
+ functions, static members, non-members, non-static members, constructors,
+ destructors, pure virtual members, etc).
+ </li>
+<li class="listitem">
+ Program contracts together with function and class declarations (not
+ definitions) because contracts are part of the specifications.
+ </li>
+<li class="listitem">
+ Support contract when function (body) definition is separated from (contract)
+ declaration.
+ </li>
+<li class="listitem">
+ Support block invariants.
+ </li>
+<li class="listitem">
+ Support loop variants and invariants.
+ </li>
+</ol></div>
+<p>
+ In addition, library early implementations were somewhat inspired by the
+ work of <a class="link" href="bibliography.html" title="Bibliography">[Maley1999]</a>.
+ </p>
+</div>
+<div class="section">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="contract__.contract_programming.benefits"></a><a class="link" href="contract_programming.html#contract__.contract_programming.benefits" title="Benefits">Benefits</a>
+</h3></div></div></div>
+<p>
+ The main use of Contract Programming is to improve software quality. <a class="link" href="bibliography.html" title="Bibliography">[Meyer1997]</a> discusses how Contract
+ Programming can be used as the basic tool to write "correct" software.
+ The following is a short summary of the benefits associated with Contract
+ Programming mainly taken from <a class="link" href="bibliography.html" title="Bibliography">[Ottosen2004]</a>.
+ See also <a class="link" href="bibliography.html" title="Bibliography">[Wilson2006]</a> for
+ a discussion of Contract Programming applied to the C++ programming language.
+ Furhtermore, <a class="link" href="bibliography.html" title="Bibliography">[Stroustrup1997]</a>
+ discusses the key importance of class invariants plus advantages and disadvantages
+ of using preconditions and postconditions.
+ </p>
+<div class="orderedlist"><ol class="orderedlist" type="1">
+<li class="listitem">
+ Using class invariants, programmers can describe what to expect from
+ a class and the logic dependencies between the class members. It is the
+ job of the constructor to ensure that the class invariants are satisfied
+ when the object is first created. Then the implementation of the member
+ functions can be largely simplified as they can be written knowing that
+ the class invariants are satisfied because Contract Programing checks
+ them before and after the execution of every member function. Finally,
+ the destructor makes sure that the class invariants hold for the entire
+ object life-cycle checking the class invariants one last time before
+ destroying the object.
+ </li>
+<li class="listitem">
+ Using function preconditions and postconditions, programmers can give
+ a precise semantic description of what a function requires at its entry
+ and what it ensures under its (normal) exit. In particular, using the
+ old value in postconditions, Contract Programming provides a mechanism
+ that allows programmers to compare values of an expression before and
+ after the executions of the function body. This mechanism is powerful
+ enough to enable programmers to express many constraints within the code
+ -- constraints that would otherwise have to be captured at the best only
+ informally by the code documentation.
+ </li>
+<li class="listitem">
+ Because contracts are embedded directly into the source code, they are
+ executed and verified at run-time so they are always up to date with
+ the code itself. Therefore the specifications as documented by the contracts
+ can be trusted to always be up to date with the source code itself.
+ </li>
+<li class="listitem">
+ Contract Programming can provide a powerful debugging facility because,
+ if contracts are well written, bugs will cause contract assertions to
+ fail exactly where the problem first occurs instead that in some later
+ stage of the program in an apparently unrelated manner. In general, a
+ precondition failure points to a bug in the function caller. A postcondition
+ failure points instead to a bug in the function implementation. Furthermore,
+ in case of contract failure, this library provides detailed error messages
+ that greatly helps debugging. <sup>[<a name="id952667" href="#ftn.id952667" class="footnote">20</a>]</sup>
+ </li>
+<li class="listitem">
+ Contract Programming facilitates testing because a contract naturally
+ specifies what a test should check. For example, preconditions of a function
+ state which inputs cause the function to fail and postconditions state
+ which inputs cause it to exit normally.
+ </li>
+<li class="listitem">
+ Contract Programming can serve to reduce the gap between designers and
+ programmers by providing a precise and unambiguous specification language.
+ Moreover, contracts can make code reviews easier.
+ </li>
+<li class="listitem">
+ Contract Programming formalizes the virtual function overriding mechanism
+ via the concept of subcontracting. This keeps the base class programmers
+ in control as overriding functions still have to fully satisfy the base
+ class contracts.
+ </li>
+<li class="listitem">
+ Contract Programming assertions can replace <span class="emphasis"><em>defensive programming</em></span>
+ checks localizing these checks within the contract and making the code
+ more readable.
+ </li>
+</ol></div>
+</div>
+<div class="section">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="contract__.contract_programming.costs"></a><a class="link" href="contract_programming.html#contract__.contract_programming.costs" title="Costs">Costs</a>
+</h3></div></div></div>
+<p>
+ Contract Programming benefits come to the cost of performance as discussed
+ in detail by both <a class="link" href="bibliography.html" title="Bibliography">[Stroustrup1997]</a>
+ and <a class="link" href="bibliography.html" title="Bibliography">[Meyer1997]</a>.
+ </p>
+<p>
+ The run-time performances are negatively impacted by Contract Programming
+ mainly because of the following:
+ </p>
+<div class="orderedlist"><ol class="orderedlist" type="1">
+<li class="listitem">
+ The extra processing required to check the assertions.
+ </li>
+<li class="listitem">
+ The extra processing required by the additional function calls (additional
+ functions are invoked to check class invariants, preconditions, and postconditions).
+ </li>
+<li class="listitem">
+ The extra processing required to copy object and function arguments when
+ their old values are accessed in postconditions.
+ </li>
+</ol></div>
+<p>
+ To alleviate some of these run-time performance impacts, you can selectively
+ turn off some of the contract compilation and the related run-time checking.
+ In reality, you will have to decide based on the performance trade-offs required
+ by your system but a reasonable approach might be to <sup>[<a name="id952845" href="#ftn.id952845" class="footnote">21</a>]</sup>:
+ </p>
+<div class="itemizedlist"><ul class="itemizedlist" type="disc">
+<li class="listitem">
+ Always write contracts to clarify the semantics of your design embedding
+ them directly into the code and its documentation.
+ </li>
+<li class="listitem">
+ Turn on class invariants, preconditions, and postconditions compilation
+ and checking during early testing.
+ </li>
+<li class="listitem">
+ Turn on only preconditions (and possibly class invariants) during release
+ testing and for the final release. (Postconditions are usually more expensive
+ to check.)
+ </li>
+</ul></div>
+<p>
+ Compile-time performances are also impacted by this library as compilation
+ time and compiler memory usage increase mainly because:
+ </p>
+<div class="orderedlist"><ol class="orderedlist" type="1">
+<li class="listitem">
+ The contracts appear in the class declaration (usually header files)
+ so they have to be re-compiled for each translation unit.
+ </li>
+<li class="listitem">
+ The library implementation extensively uses C++ preprocessor and template
+ metaprogramming which can significantly stress some compilers.
+ </li>
+</ol></div>
+<p>
+ In addition, Contract Programming might induce a false sense of security
+ on the correctness of the software. However, Contract Programming is proposed
+ here as a tool to complement (and not to substitute) testing.
+ </p>
+<p>
+ In general, Contract Programming is an essential approach to improve software
+ quality even if it comes at a performance cost. While performance trade-offs
+ should be carefully considered depending on the specific application domain,
+ software quality cannot be sacrificed -- it is difficult to see the value
+ of a system that quickly and efficiently provides the incorrect output.
+ </p>
+</div>
+<div class="section">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="contract__.contract_programming.other_tools"></a><a class="link" href="contract_programming.html#contract__.contract_programming.other_tools" title="Other Tools">Other Tools</a>
+</h3></div></div></div>
+<p>
+ Contract Programming is also supported by the following tools (this is <span class="emphasis"><em>not</em></span>
+ a complete list):
+ </p>
+<div class="itemizedlist"><ul class="itemizedlist" type="disc">
+<li class="listitem">
+ <a class="link" href="bibliography.html" title="Bibliography">[Bright2004b]</a> is the Digital
+ Mars C++ compiler with added Contract Programming support.
+ </li>
+<li class="listitem">
+ <a class="link" href="bibliography.html" title="Bibliography">[C^2]</a> implements Contract
+ Programming for C++ using an external preprocessing tool.
+ </li>
+<li class="listitem">
+ <a class="link" href="bibliography.html" title="Bibliography">[Spec#]</a> extends C# with
+ Contract Programming.
+ </li>
+<li class="listitem">
+ <a class="link" href="bibliography.html" title="Bibliography">[iContract]</a> and <a class="link" href="bibliography.html" title="Bibliography">[Jcontract]</a> are external preprocessing
+ tools that implement Contract Programming for Java.
+ </li>
+<li class="listitem">
+ <a class="link" href="bibliography.html" title="Bibliography">[Chrome2002]</a> is Object
+ Pascal in .NET with Contract Programming support.
+ </li>
+<li class="listitem">
+ <a class="link" href="bibliography.html" title="Bibliography">[SPARKAda]</a> is an Ada-like
+ programming language with Contract Programming support.
+ </li>
+</ul></div>
+<p>
+ Typically, preprocessing tools external to the language work by transforming
+ specially formatted code comments into contract code that is then checked
+ at run-time.
+ </p>
+</div>
+<div class="footnotes">
+<br><hr width="100" align="left">
+<div class="footnote"><p><sup>[<a id="ftn.id951030" href="#id951030" class="para">19</a>] </sup>
+ These are all revisions of the same proposal for adding Contract Programming
+ to the C++ standard.
+ </p></div>
+<div class="footnote"><p><sup>[<a id="ftn.id952667" href="#id952667" class="para">20</a>] </sup>
+ Of course, if the contract is ill written then Contract Programming
+ is of little use. However, it is less likely to have a bug in both
+ the function body and the contract than in the function body only.
+ For example, consider the validation of a result in postconditions.
+ Validating the return value might seem redundant, but in this case
+ we actually want that redundancy. When programmers write a function,
+ there is a certain probability that they make a mistake in implementing
+ the function body. When they specify the result of the function in
+ the postconditions, there is also a certain probability that they make
+ a mistake in writing the contract. However, the probability that they
+ make a mistake twice (in the body <span class="emphasis"><em>and</em></span> in the contract)
+ is lower than the probability that the mistake is made just once (in
+ the body).
+ </p></div>
+<div class="footnote"><p><sup>[<a id="ftn.id952845" href="#id952845" class="para">21</a>] </sup>
+ This approach is generally reasonable because in well tested production
+ code, validating the function body implementation via postconditions and
+ class invariants is rarely needed since the function has shown itself to
+ be "correct" during testing. On the other hand, checking arguments
+ has continuing need because of the evolution of the callers.
+ </p></div>
+</div>
+</div>
+<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
+<td align="left"></td>
+<td align="right"><div class="copyright-footer">Copyright &#169; 2009, 2010 Lorenzo Caminiti<p>
+ Distributed under the Contract++ Software License, Version 1.0 (see accompanying
+ file LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="throw_on_failure.html"><img src="../images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../images/home.png" alt="Home"></a><a accesskey="n" href="Grammar.html"><img src="../images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>

Added: sandbox/contract/libs/contract/doc/html/contract__/examples.html
==============================================================================
--- (empty file)
+++ sandbox/contract/libs/contract/doc/html/contract__/examples.html 2011-06-28 20:54:41 EDT (Tue, 28 Jun 2011)
@@ -0,0 +1,1572 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
+<title>Examples</title>
+<link rel="stylesheet" href="../doc/html/boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
+<link rel="home" href="../index.html" title="Contract++ 0.3.490">
+<link rel="up" href="../index.html" title="Contract++ 0.3.490">
+<link rel="prev" href="without_the_macros.html" title="Without the Macros">
+<link rel="next" href="throw_on_failure.html" title="Annex: Throw on Failure">
+</head>
+<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
+<table cellpadding="2" width="100%"><tr><td valign="top"></td></tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="without_the_macros.html"><img src="../images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../images/home.png" alt="Home"></a><a accesskey="n" href="throw_on_failure.html"><img src="../images/next.png" alt="Next"></a>
+</div>
+<div class="section">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="contract__.examples"></a><a class="link" href="examples.html" title="Examples">Examples</a>
+</h2></div></div></div>
+<p>
+ This section provides source code of fully working examples that can all be
+ compiled and executed using this library. The most interesting examples (from
+ the authors' prospective) have highlighted keywords in their purpose descriptions.
+ </p>
+<p>
+ All examples presented in the Contract Programming proposal for the C++ standard
+ <a class="link" href="bibliography.html" title="Bibliography">[Crowl2006]</a> are programmed here
+ using the library. Most of the other examples have been ported to C++ from
+ Eiffel code using this library and they were originally presented in <a class="link" href="bibliography.html" title="Bibliography">[Meyer1997]</a> and <a class="link" href="bibliography.html" title="Bibliography">[Mitchell2002]</a>.
+ </p>
+<div class="note"><table border="0" summary="Note">
+<tr>
+<td rowspan="2" align="center" valign="top" width="25"><img alt="[Note]" src="../images/note.png"></td>
+<th align="left">Note</th>
+</tr>
+<tr><td align="left" valign="top"><p>
+ Remember to #define the <code class="computeroutput">CONTRACT_CHECK_BLOCK_INVARIANT</code>,
+ <code class="computeroutput">CONTRACT_CHECK_CLASS_INVARIANT</code>,
+ <code class="computeroutput">CONTRACT_CHECK_PRECONDITION</code>,
+ and <code class="computeroutput">CONTRACT_CHECK_POSTCONDITION</code>
+ macro symbols using your compiler options (these symbols are #undefined by
+ default, see the <a class="link" href="getting_started.html" title="Getting Started">Getting Started</a>
+ section).
+ </p></td></tr>
+</table></div>
+<div class="informaltable"><table class="table">
+<colgroup>
+<col>
+<col>
+</colgroup>
+<thead><tr>
+<th>
+ <p>
+ Contract++ Library Syntax (supported by ISO C++)
+ </p>
+ </th>
+<th>
+ <p>
+ N1962 and ConceptC++ Syntax (proposals not part of C++0x standard)
+ </p>
+ </th>
+</tr></thead>
+<tbody><tr>
+<td>
+ <p>
+
+</p>
+<pre xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="table-programlisting"><span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">contract</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span>
+<span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">utility</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span> <span class="comment">// For boost::prior().</span>
+<span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">concept_check</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span>
+<span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">vector</span><span class="special">&gt;</span>
+
+<span class="comment">// Contract helpers.</span>
+
+<span class="identifier">CONTRACT_FUNCTION</span><span class="special">(</span>
+<span class="keyword">template</span><span class="special">(</span> <span class="keyword">class</span> <span class="identifier">Iter</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">T</span> <span class="special">)</span>
+ <span class="identifier">requires</span><span class="special">(</span> <span class="comment">// Concepts.</span>
+ <span class="identifier">boost</span><span class="special">::</span><span class="identifier">ForwardIterator</span><span class="special">&lt;</span><span class="identifier">Iter</span><span class="special">&gt;,</span>
+ <span class="identifier">boost</span><span class="special">::</span><span class="identifier">EqualityComparable</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">&gt;</span> <span class="comment">// For simplicity, assume T comparable.</span>
+ <span class="special">)</span>
+<span class="keyword">bool</span> <span class="special">(</span><span class="identifier">all_equals</span><span class="special">)</span> <span class="special">(</span> <span class="special">(</span><span class="identifier">Iter</span><span class="special">)</span> <span class="identifier">first</span><span class="special">,</span> <span class="special">(</span><span class="identifier">Iter</span><span class="special">)</span> <span class="identifier">last</span><span class="special">,</span> <span class="special">(</span><span class="keyword">const</span> <span class="identifier">T</span><span class="special">&amp;)</span> <span class="identifier">val</span> <span class="special">)</span>
+<span class="special">)</span> <span class="special">{</span>
+ <span class="keyword">for</span><span class="special">(</span><span class="identifier">Iter</span> <span class="identifier">i</span> <span class="special">=</span> <span class="identifier">first</span><span class="special">;</span> <span class="identifier">i</span> <span class="special">&lt;</span> <span class="identifier">last</span><span class="special">;</span> <span class="special">++</span><span class="identifier">i</span><span class="special">)</span> <span class="keyword">if</span> <span class="special">(*</span><span class="identifier">i</span> <span class="special">!=</span> <span class="identifier">val</span><span class="special">)</span> <span class="keyword">return</span> <span class="keyword">false</span><span class="special">;</span>
+ <span class="keyword">return</span> <span class="keyword">true</span><span class="special">;</span>
+<span class="special">}</span>
+
+<span class="identifier">CONTRACT_FUNCTION</span><span class="special">(</span>
+<span class="keyword">template</span><span class="special">(</span> <span class="keyword">class</span> <span class="identifier">Iter</span> <span class="special">)</span>
+ <span class="identifier">requires</span><span class="special">(</span>
+ <span class="identifier">boost</span><span class="special">::</span><span class="identifier">FowardIterator</span><span class="special">&lt;</span><span class="identifier">Iter</span><span class="special">&gt;,</span>
+ <span class="identifier">boost</span><span class="special">::</span><span class="identifier">EqualityComparable</span><span class="special">&lt;</span><span class="keyword">typename</span>
+ <span class="identifier">boost</span><span class="special">::</span><span class="identifier">FowardIterator</span><span class="special">&lt;</span><span class="identifier">Iter</span><span class="special">&gt;::</span><span class="identifier">value_type</span><span class="special">&gt;</span>
+ <span class="special">)</span>
+<span class="keyword">bool</span> <span class="special">(</span><span class="identifier">all_equals</span><span class="special">)</span> <span class="special">(</span> <span class="special">(</span><span class="identifier">Iter</span><span class="special">)</span> <span class="identifier">first1</span><span class="special">,</span> <span class="special">(</span><span class="identifier">Iter</span><span class="special">)</span> <span class="identifier">last1</span><span class="special">,</span> <span class="special">(</span><span class="identifier">Iter</span><span class="special">)</span> <span class="identifier">first2</span><span class="special">,</span> <span class="special">(</span><span class="identifier">Iter</span><span class="special">)</span> <span class="identifier">last2</span> <span class="special">)</span>
+ <span class="identifier">precondition</span><span class="special">(</span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">distance</span><span class="special">(</span><span class="identifier">first1</span><span class="special">,</span> <span class="identifier">last1</span><span class="special">)</span> <span class="special">==</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">distance</span><span class="special">(</span><span class="identifier">first2</span><span class="special">,</span> <span class="identifier">last2</span><span class="special">)</span>
+ <span class="special">)</span>
+<span class="special">)</span> <span class="special">{</span>
+ <span class="identifier">Iter</span> <span class="identifier">i</span> <span class="special">=</span> <span class="identifier">first1</span><span class="special">,</span> <span class="identifier">j</span> <span class="special">=</span> <span class="identifier">first2</span><span class="special">;</span>
+ <span class="keyword">while</span><span class="special">(</span><span class="identifier">i</span> <span class="special">&lt;</span> <span class="identifier">last1</span> <span class="special">&amp;&amp;</span> <span class="identifier">j</span> <span class="special">&lt;</span> <span class="identifier">last2</span><span class="special">)</span> <span class="special">{</span>
+ <span class="keyword">if</span> <span class="special">(*</span><span class="identifier">i</span> <span class="special">!=</span> <span class="special">*</span><span class="identifier">j</span><span class="special">)</span> <span class="keyword">return</span> <span class="keyword">false</span><span class="special">;</span>
+ <span class="special">++</span><span class="identifier">i</span><span class="special">;</span> <span class="special">++</span><span class="identifier">j</span><span class="special">;</span>
+ <span class="special">}</span>
+ <span class="keyword">return</span> <span class="keyword">true</span><span class="special">;</span>
+<span class="special">}</span>
+
+<span class="identifier">CONTRACT_FUNCTION</span><span class="special">(</span>
+<span class="keyword">template</span><span class="special">(</span> <span class="keyword">class</span> <span class="identifier">Iter</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Size</span> <span class="special">)</span>
+ <span class="identifier">requires</span><span class="special">(</span>
+ <span class="identifier">boost</span><span class="special">::</span><span class="identifier">ForwardIterator</span><span class="special">&lt;</span><span class="identifier">Iter</span><span class="special">&gt;,</span>
+ <span class="comment">// `IDENTITY_TYPE()` to handle commas within macro parameters.</span>
+ <span class="keyword">typename</span> <span class="identifier">CONTRACT_IDENTITY_TYPE</span><span class="special">((</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">Convertible</span><span class="special">&lt;</span><span class="identifier">Size</span><span class="special">,</span> <span class="keyword">int</span><span class="special">&gt;))</span>
+ <span class="special">)</span>
+<span class="keyword">bool</span> <span class="special">(</span><span class="identifier">equal_distance</span><span class="special">)</span> <span class="special">(</span> <span class="special">(</span><span class="identifier">Iter</span><span class="special">)</span> <span class="identifier">first</span><span class="special">,</span> <span class="special">(</span><span class="identifier">Iter</span><span class="special">)</span> <span class="identifier">last</span><span class="special">,</span> <span class="special">(</span><span class="identifier">Size</span><span class="special">)</span> <span class="identifier">size</span> <span class="special">)</span>
+<span class="special">)</span> <span class="special">{</span>
+ <span class="keyword">return</span> <span class="keyword">int</span><span class="special">(</span><span class="identifier">size</span><span class="special">)</span> <span class="special">==</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">distance</span><span class="special">(</span><span class="identifier">first</span><span class="special">,</span> <span class="identifier">last</span><span class="special">);</span> <span class="comment">// Could tag for in-iter.</span>
+<span class="special">}</span>
+
+<span class="comment">// New vector interface (with contracts).</span>
+
+<span class="identifier">CONTRACT_CLASS</span><span class="special">(</span>
+<span class="keyword">template</span><span class="special">(</span> <span class="keyword">class</span> <span class="identifier">T</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Alloc</span><span class="special">,</span> <span class="keyword">default</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">allocator</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">&gt;</span> <span class="special">)</span>
+<span class="keyword">class</span> <span class="special">(</span><span class="identifier">vector</span><span class="special">)</span> <span class="comment">// No base classes so no subcontracting for this example.</span>
+<span class="special">)</span> <span class="special">{</span>
+ <span class="identifier">CONTRACT_CLASS_INVARIANT</span><span class="special">(</span> <span class="comment">// Used within a private context.</span>
+ <span class="identifier">empty</span><span class="special">()</span> <span class="special">==</span> <span class="special">(</span><span class="identifier">size</span><span class="special">()</span> <span class="special">==</span> <span class="number">0</span><span class="special">),</span>
+ <span class="keyword">int</span><span class="special">(</span><span class="identifier">size</span><span class="special">())</span> <span class="special">==</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">distance</span><span class="special">(</span><span class="identifier">begin</span><span class="special">(),</span> <span class="identifier">end</span><span class="special">()),</span>
+ <span class="keyword">int</span><span class="special">(</span><span class="identifier">size</span><span class="special">())</span> <span class="special">==</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">distance</span><span class="special">(</span><span class="identifier">rbegin</span><span class="special">(),</span> <span class="identifier">rend</span><span class="special">()),</span>
+ <span class="identifier">size</span><span class="special">()</span> <span class="special">&lt;=</span> <span class="identifier">capacity</span><span class="special">(),</span>
+ <span class="identifier">capacity</span><span class="special">()</span> <span class="special">&lt;=</span> <span class="identifier">max_size</span><span class="special">()</span>
+ <span class="special">)</span>
+ <span class="comment">// No static class invariants for this example.</span>
+
+<span class="keyword">public</span><span class="special">:</span>
+ <span class="keyword">typedef</span> <span class="keyword">typename</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">vector</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">,</span> <span class="identifier">Alloc</span><span class="special">&gt;::</span><span class="identifier">size_type</span> <span class="identifier">size_type</span><span class="special">;</span>
+ <span class="keyword">typedef</span> <span class="keyword">typename</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">vector</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">,</span> <span class="identifier">Alloc</span><span class="special">&gt;::</span><span class="identifier">iterator</span> <span class="identifier">iterator</span><span class="special">;</span>
+ <span class="keyword">typedef</span> <span class="keyword">typename</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">vector</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">,</span> <span class="identifier">Alloc</span><span class="special">&gt;::</span><span class="identifier">const_iterator</span> <span class="identifier">const_iterator</span><span class="special">;</span>
+ <span class="keyword">typedef</span> <span class="keyword">typename</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">vector</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">,</span> <span class="identifier">Alloc</span><span class="special">&gt;::</span><span class="identifier">reverse_iterator</span> <span class="identifier">reverse_iterator</span><span class="special">;</span>
+ <span class="keyword">typedef</span> <span class="keyword">typename</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">vector</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">,</span> <span class="identifier">Alloc</span><span class="special">&gt;::</span><span class="identifier">const_reverse_iterator</span>
+ <span class="identifier">const_reverse_iterator</span><span class="special">;</span>
+ <span class="keyword">typedef</span> <span class="keyword">typename</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">vector</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">,</span> <span class="identifier">Alloc</span><span class="special">&gt;::</span><span class="identifier">reference</span> <span class="identifier">reference</span><span class="special">;</span>
+ <span class="keyword">typedef</span> <span class="keyword">typename</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">vector</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">,</span> <span class="identifier">Alloc</span><span class="special">&gt;::</span><span class="identifier">const_reference</span> <span class="identifier">const_reference</span><span class="special">;</span>
+
+ <span class="identifier">CONTRACT_CONSTRUCTOR</span><span class="special">(</span>
+ <span class="keyword">public</span> <span class="special">(</span><span class="identifier">vector</span><span class="special">)</span> <span class="special">(</span> <span class="keyword">void</span> <span class="special">)</span>
+ <span class="identifier">initialize</span><span class="special">(</span> <span class="identifier">vector_</span><span class="special">()</span> <span class="special">)</span> <span class="comment">// Member initializers.</span>
+ <span class="identifier">postcondition</span><span class="special">(</span> <span class="identifier">empty</span><span class="special">()</span> <span class="special">)</span>
+ <span class="special">)</span> <span class="special">{}</span>
+
+ <span class="identifier">CONTRACT_CONSTRUCTOR</span><span class="special">(</span>
+ <span class="keyword">public</span> <span class="keyword">explicit</span> <span class="special">(</span><span class="identifier">vector</span><span class="special">)</span> <span class="special">(</span> <span class="special">(</span><span class="keyword">const</span> <span class="identifier">Alloc</span><span class="special">&amp;)</span> <span class="identifier">al</span> <span class="special">)</span>
+ <span class="identifier">initialize</span><span class="special">(</span> <span class="identifier">vector_</span><span class="special">(</span><span class="identifier">al</span><span class="special">)</span> <span class="special">)</span>
+ <span class="identifier">postcondition</span><span class="special">(</span> <span class="identifier">empty</span><span class="special">(),</span> <span class="identifier">al</span> <span class="special">==</span> <span class="identifier">get_allocator</span><span class="special">()</span> <span class="special">)</span>
+ <span class="special">)</span> <span class="special">{}</span>
+
+ <span class="identifier">CONTRACT_CONSTRUCTOR</span><span class="special">(</span>
+ <span class="keyword">public</span> <span class="keyword">explicit</span> <span class="special">(</span><span class="identifier">vector</span><span class="special">)</span> <span class="special">(</span> <span class="special">(</span><span class="identifier">size_type</span><span class="special">)</span> <span class="identifier">count</span> <span class="special">)</span>
+ <span class="identifier">initialize</span><span class="special">(</span> <span class="special">(</span><span class="identifier">vector_</span><span class="special">(</span><span class="identifier">count</span><span class="special">))</span> <span class="special">)</span>
+ <span class="identifier">postcondition</span><span class="special">(</span> <span class="identifier">size</span><span class="special">()</span> <span class="special">==</span> <span class="identifier">count</span><span class="special">,</span> <span class="identifier">all_equals</span><span class="special">(</span><span class="identifier">begin</span><span class="special">(),</span> <span class="identifier">end</span><span class="special">(),</span> <span class="identifier">T</span><span class="special">())</span> <span class="special">)</span>
+ <span class="special">)</span> <span class="special">{}</span>
+
+ <span class="identifier">CONTRACT_CONSTRUCTOR</span><span class="special">(</span>
+ <span class="keyword">public</span> <span class="special">(</span><span class="identifier">vector</span><span class="special">)</span> <span class="special">(</span> <span class="special">(</span><span class="identifier">size_type</span><span class="special">)</span> <span class="identifier">count</span><span class="special">,</span> <span class="special">(</span><span class="keyword">const</span> <span class="identifier">T</span><span class="special">&amp;)</span> <span class="identifier">val</span> <span class="special">)</span>
+ <span class="identifier">initialize</span><span class="special">(</span> <span class="identifier">vector_</span><span class="special">(</span><span class="identifier">count</span><span class="special">,</span> <span class="identifier">val</span><span class="special">)</span> <span class="special">)</span>
+ <span class="identifier">postcondition</span><span class="special">(</span> <span class="identifier">size</span><span class="special">()</span> <span class="special">==</span> <span class="identifier">count</span><span class="special">,</span> <span class="identifier">all_equals</span><span class="special">(</span><span class="identifier">begin</span><span class="special">(),</span> <span class="identifier">end</span><span class="special">(),</span> <span class="identifier">val</span><span class="special">)</span> <span class="special">)</span>
+ <span class="special">)</span> <span class="special">{}</span>
+
+ <span class="identifier">CONTRACT_CONSTRUCTOR</span><span class="special">(</span>
+ <span class="keyword">public</span> <span class="special">(</span><span class="identifier">vector</span><span class="special">)</span> <span class="special">(</span> <span class="special">(</span><span class="identifier">size_type</span><span class="special">)</span> <span class="identifier">count</span><span class="special">,</span> <span class="special">(</span><span class="keyword">const</span> <span class="identifier">T</span><span class="special">&amp;)</span> <span class="identifier">val</span><span class="special">,</span> <span class="special">(</span><span class="keyword">const</span> <span class="identifier">Alloc</span><span class="special">&amp;)</span> <span class="identifier">al</span> <span class="special">)</span>
+ <span class="identifier">initialize</span><span class="special">(</span> <span class="identifier">vector_</span><span class="special">(</span><span class="identifier">count</span><span class="special">,</span> <span class="identifier">val</span><span class="special">,</span> <span class="identifier">al</span><span class="special">)</span> <span class="special">)</span>
+ <span class="identifier">postcondition</span><span class="special">(</span>
+ <span class="identifier">size</span><span class="special">()</span> <span class="special">==</span> <span class="identifier">count</span><span class="special">,</span>
+ <span class="identifier">all_equals</span><span class="special">(</span><span class="identifier">begin</span><span class="special">(),</span> <span class="identifier">end</span><span class="special">(),</span> <span class="identifier">val</span><span class="special">),</span>
+ <span class="identifier">al</span> <span class="special">==</span> <span class="identifier">get_allocator</span><span class="special">()</span>
+ <span class="special">)</span>
+ <span class="special">)</span> <span class="special">{}</span>
+
+ <span class="identifier">CONTRACT_CONSTRUCTOR</span><span class="special">(</span>
+ <span class="keyword">public</span> <span class="special">(</span><span class="identifier">vector</span><span class="special">)</span> <span class="special">(</span> <span class="special">(</span><span class="keyword">const</span> <span class="identifier">vector</span><span class="special">&amp;)</span> <span class="identifier">right</span> <span class="special">)</span>
+ <span class="identifier">initialize</span><span class="special">(</span> <span class="identifier">vector_</span><span class="special">(</span><span class="identifier">right</span><span class="special">.</span><span class="identifier">vector_</span><span class="special">)</span> <span class="special">)</span>
+ <span class="identifier">postcondition</span><span class="special">(</span> <span class="identifier">right</span> <span class="special">==</span> <span class="special">*</span><span class="keyword">this</span> <span class="special">)</span>
+ <span class="special">)</span> <span class="special">{}</span>
+
+ <span class="identifier">CONTRACT_CONSTRUCTOR</span><span class="special">(</span>
+ <span class="keyword">public</span> <span class="keyword">template</span><span class="special">(</span> <span class="keyword">class</span> <span class="identifier">InIt</span> <span class="special">)</span> <span class="identifier">requires</span><span class="special">(</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">InputIterator</span><span class="special">&lt;</span><span class="identifier">InIt</span><span class="special">&gt;</span> <span class="special">)</span>
+ <span class="special">(</span><span class="identifier">vector</span><span class="special">)</span> <span class="special">(</span> <span class="special">(</span><span class="identifier">InIt</span><span class="special">)</span> <span class="identifier">first</span><span class="special">,</span> <span class="special">(</span><span class="identifier">InIt</span><span class="special">)</span> <span class="identifier">last</span> <span class="special">)</span>
+ <span class="identifier">initialize</span><span class="special">(</span> <span class="identifier">vector_</span><span class="special">(</span><span class="identifier">first</span><span class="special">,</span> <span class="identifier">last</span><span class="special">)</span> <span class="special">)</span>
+ <span class="identifier">postcondition</span><span class="special">(</span> <span class="identifier">equal_distance</span><span class="special">(</span><span class="identifier">first</span><span class="special">,</span> <span class="identifier">last</span><span class="special">,</span> <span class="identifier">size</span><span class="special">())</span> <span class="special">)</span>
+ <span class="special">)</span> <span class="special">{}</span>
+
+ <span class="identifier">CONTRACT_CONSTRUCTOR</span><span class="special">(</span>
+ <span class="keyword">public</span> <span class="keyword">template</span><span class="special">(</span> <span class="keyword">class</span> <span class="identifier">InIt</span> <span class="special">)</span> <span class="identifier">requires</span><span class="special">(</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">InputIterator</span><span class="special">&lt;</span><span class="identifier">InIt</span><span class="special">&gt;</span> <span class="special">)</span>
+ <span class="special">(</span><span class="identifier">vector</span><span class="special">)</span> <span class="special">(</span> <span class="special">(</span><span class="identifier">InIt</span><span class="special">)</span> <span class="identifier">first</span><span class="special">,</span> <span class="special">(</span><span class="identifier">InIt</span><span class="special">)</span> <span class="identifier">last</span><span class="special">,</span> <span class="special">(</span><span class="keyword">const</span> <span class="identifier">Alloc</span><span class="special">&amp;)</span> <span class="identifier">al</span> <span class="special">)</span>
+ <span class="identifier">initialize</span><span class="special">(</span> <span class="identifier">vector_</span><span class="special">(</span><span class="identifier">first</span><span class="special">,</span> <span class="identifier">last</span><span class="special">,</span> <span class="identifier">al</span><span class="special">)</span> <span class="special">)</span>
+ <span class="identifier">postcondition</span><span class="special">(</span>
+ <span class="identifier">equal_distance</span><span class="special">(</span><span class="identifier">first</span><span class="special">,</span> <span class="identifier">last</span><span class="special">,</span> <span class="identifier">size</span><span class="special">()),</span>
+ <span class="identifier">al</span> <span class="special">==</span> <span class="identifier">get_allocator</span><span class="special">()</span>
+ <span class="special">)</span>
+ <span class="special">)</span> <span class="special">{}</span>
+
+ <span class="identifier">CONTRACT_DESTRUCTOR</span><span class="special">(</span> <span class="comment">// Contracted so also destructor checks invariants.</span>
+ <span class="keyword">public</span> <span class="special">(</span><span class="identifier">vector</span><span class="special">)</span> <span class="special">(</span> <span class="keyword">void</span> <span class="special">)</span>
+ <span class="special">)</span> <span class="special">{}</span>
+
+ <span class="identifier">CONTRACT_FUNCTION</span><span class="special">(</span>
+ <span class="keyword">public</span> <span class="keyword">void</span> <span class="special">(</span><span class="identifier">reserve</span><span class="special">)</span> <span class="special">(</span> <span class="special">(</span><span class="identifier">size_type</span><span class="special">)</span> <span class="identifier">count</span> <span class="special">)</span>
+ <span class="identifier">precondition</span><span class="special">(</span> <span class="identifier">count</span> <span class="special">&lt;</span> <span class="identifier">max_size</span><span class="special">()</span> <span class="special">)</span>
+ <span class="identifier">postcondition</span><span class="special">(</span> <span class="identifier">capacity</span><span class="special">()</span> <span class="special">&gt;=</span> <span class="identifier">count</span> <span class="special">)</span>
+ <span class="special">)</span> <span class="special">{</span>
+ <span class="identifier">vector_</span><span class="special">.</span><span class="identifier">reserve</span><span class="special">(</span><span class="identifier">count</span><span class="special">);</span>
+ <span class="special">}</span>
+
+ <span class="identifier">CONTRACT_FUNCTION</span><span class="special">(</span>
+ <span class="keyword">public</span> <span class="special">(</span><span class="identifier">size_type</span><span class="special">)</span> <span class="special">(</span><span class="identifier">capacity</span><span class="special">)</span> <span class="special">(</span> <span class="keyword">void</span> <span class="special">)</span> <span class="keyword">const</span> <span class="comment">// Constant member.</span>
+ <span class="identifier">postcondition</span><span class="special">(</span> <span class="keyword">auto</span> <span class="identifier">result</span> <span class="special">=</span> <span class="keyword">return</span><span class="special">,</span> <span class="identifier">result</span> <span class="special">&gt;=</span> <span class="identifier">size</span><span class="special">()</span> <span class="special">)</span> <span class="comment">// With result.</span>
+ <span class="special">)</span> <span class="special">{</span>
+ <span class="keyword">return</span> <span class="identifier">vector_</span><span class="special">.</span><span class="identifier">capacity</span><span class="special">();</span>
+ <span class="special">}</span>
+
+ <span class="identifier">CONTRACT_FUNCTION</span><span class="special">(</span>
+ <span class="keyword">public</span> <span class="special">(</span><span class="identifier">iterator</span><span class="special">)</span> <span class="special">(</span><span class="identifier">begin</span><span class="special">)</span> <span class="special">(</span> <span class="keyword">void</span> <span class="special">)</span>
+ <span class="identifier">postcondition</span><span class="special">(</span>
+ <span class="keyword">auto</span> <span class="identifier">result</span> <span class="special">=</span> <span class="keyword">return</span><span class="special">,</span>
+ <span class="keyword">if</span><span class="special">(</span><span class="identifier">empty</span><span class="special">())</span> <span class="special">(</span> <span class="identifier">result</span> <span class="special">==</span> <span class="identifier">end</span><span class="special">()</span> <span class="special">)</span> <span class="comment">// Select assertion.</span>
+ <span class="special">)</span>
+ <span class="special">)</span> <span class="special">{</span>
+ <span class="keyword">return</span> <span class="identifier">vector_</span><span class="special">.</span><span class="identifier">begin</span><span class="special">();</span>
+ <span class="special">}</span>
+
+ <span class="identifier">CONTRACT_FUNCTION</span><span class="special">(</span>
+ <span class="keyword">public</span> <span class="special">(</span><span class="identifier">const_iterator</span><span class="special">)</span> <span class="special">(</span><span class="identifier">begin</span><span class="special">)</span> <span class="special">(</span> <span class="keyword">void</span> <span class="special">)</span> <span class="keyword">const</span>
+ <span class="identifier">postcondition</span><span class="special">(</span>
+ <span class="keyword">auto</span> <span class="identifier">result</span> <span class="special">=</span> <span class="keyword">return</span><span class="special">,</span>
+ <span class="keyword">if</span><span class="special">(</span><span class="identifier">empty</span><span class="special">())</span> <span class="special">(</span> <span class="identifier">result</span> <span class="special">==</span> <span class="identifier">end</span><span class="special">()</span> <span class="special">)</span>
+ <span class="special">)</span>
+ <span class="special">)</span> <span class="special">{</span>
+ <span class="keyword">return</span> <span class="identifier">vector_</span><span class="special">.</span><span class="identifier">begin</span><span class="special">();</span>
+ <span class="special">}</span>
+
+ <span class="identifier">CONTRACT_FUNCTION</span><span class="special">(</span> <span class="comment">// Contracted even if no pre/post so to check invariants.</span>
+ <span class="keyword">public</span> <span class="special">(</span><span class="identifier">iterator</span><span class="special">)</span> <span class="special">(</span><span class="identifier">end</span><span class="special">)</span> <span class="special">(</span> <span class="keyword">void</span> <span class="special">)</span>
+ <span class="special">)</span> <span class="special">{</span>
+ <span class="keyword">return</span> <span class="identifier">vector_</span><span class="special">.</span><span class="identifier">end</span><span class="special">();</span>
+ <span class="special">}</span>
+
+ <span class="identifier">CONTRACT_FUNCTION</span><span class="special">(</span>
+ <span class="keyword">public</span> <span class="special">(</span><span class="identifier">const_iterator</span><span class="special">)</span> <span class="special">(</span><span class="identifier">end</span><span class="special">)</span> <span class="special">(</span> <span class="keyword">void</span> <span class="special">)</span> <span class="keyword">const</span>
+ <span class="special">)</span> <span class="special">{</span>
+ <span class="keyword">return</span> <span class="identifier">vector_</span><span class="special">.</span><span class="identifier">end</span><span class="special">();</span>
+ <span class="special">}</span>
+
+ <span class="identifier">CONTRACT_FUNCTION</span><span class="special">(</span>
+ <span class="keyword">public</span> <span class="special">(</span><span class="identifier">reverse_iterator</span><span class="special">)</span> <span class="special">(</span><span class="identifier">rbegin</span><span class="special">)</span> <span class="special">(</span> <span class="keyword">void</span> <span class="special">)</span>
+ <span class="identifier">postcondition</span><span class="special">(</span>
+ <span class="keyword">auto</span> <span class="identifier">result</span> <span class="special">=</span> <span class="keyword">return</span><span class="special">,</span>
+ <span class="keyword">if</span><span class="special">(</span><span class="identifier">empty</span><span class="special">())</span> <span class="special">(</span> <span class="identifier">result</span> <span class="special">==</span> <span class="identifier">rend</span><span class="special">()</span> <span class="special">)</span>
+ <span class="special">)</span>
+ <span class="special">)</span> <span class="special">{</span>
+ <span class="keyword">return</span> <span class="identifier">vector_</span><span class="special">.</span><span class="identifier">rbegin</span><span class="special">();</span>
+ <span class="special">}</span>
+
+ <span class="identifier">CONTRACT_FUNCTION</span><span class="special">(</span>
+ <span class="keyword">public</span> <span class="special">(</span><span class="identifier">const_reverse_iterator</span><span class="special">)</span> <span class="special">(</span><span class="identifier">rbegin</span><span class="special">)</span> <span class="special">(</span> <span class="keyword">void</span> <span class="special">)</span> <span class="keyword">const</span>
+ <span class="identifier">postcondition</span><span class="special">(</span>
+ <span class="keyword">auto</span> <span class="identifier">result</span> <span class="special">=</span> <span class="keyword">return</span><span class="special">,</span>
+ <span class="keyword">if</span><span class="special">(</span><span class="identifier">empty</span><span class="special">())</span> <span class="special">(</span> <span class="identifier">result</span> <span class="special">==</span> <span class="identifier">rend</span><span class="special">()</span> <span class="special">)</span>
+ <span class="special">)</span>
+ <span class="special">)</span> <span class="special">{</span>
+ <span class="keyword">return</span> <span class="identifier">vector_</span><span class="special">.</span><span class="identifier">rbegin</span><span class="special">();</span>
+ <span class="special">}</span>
+
+ <span class="identifier">CONTRACT_FUNCTION</span><span class="special">(</span>
+ <span class="keyword">public</span> <span class="special">(</span><span class="identifier">reverse_iterator</span><span class="special">)</span> <span class="special">(</span><span class="identifier">rend</span><span class="special">)</span> <span class="special">(</span> <span class="keyword">void</span> <span class="special">)</span>
+ <span class="special">)</span> <span class="special">{</span>
+ <span class="keyword">return</span> <span class="identifier">vector_</span><span class="special">.</span><span class="identifier">rend</span><span class="special">();</span>
+ <span class="special">}</span>
+
+ <span class="identifier">CONTRACT_FUNCTION</span><span class="special">(</span>
+ <span class="keyword">public</span> <span class="special">(</span><span class="identifier">const_reverse_iterator</span><span class="special">)</span> <span class="special">(</span><span class="identifier">rend</span><span class="special">)</span> <span class="special">(</span> <span class="keyword">void</span> <span class="special">)</span> <span class="keyword">const</span>
+ <span class="special">)</span> <span class="special">{</span>
+ <span class="keyword">return</span> <span class="identifier">vector_</span><span class="special">.</span><span class="identifier">rend</span><span class="special">();</span>
+ <span class="special">}</span>
+
+ <span class="identifier">CONTRACT_FUNCTION</span><span class="special">(</span>
+ <span class="keyword">public</span> <span class="keyword">void</span> <span class="special">(</span><span class="identifier">resize</span><span class="special">)</span> <span class="special">(</span> <span class="special">(</span><span class="identifier">size_type</span><span class="special">)</span> <span class="identifier">newsize</span> <span class="special">)</span>
+ <span class="identifier">postcondition</span><span class="special">(</span>
+ <span class="keyword">auto</span> <span class="identifier">old_size</span> <span class="special">=</span> <span class="identifier">CONTRACT_OLDOF</span> <span class="identifier">size</span><span class="special">(),</span> <span class="comment">// Old values.</span>
+ <span class="identifier">size</span><span class="special">()</span> <span class="special">==</span> <span class="identifier">newsize</span><span class="special">,</span>
+ <span class="comment">// Version 1: with an if.</span>
+ <span class="keyword">if</span><span class="special">(</span><span class="identifier">newsize</span> <span class="special">&gt;</span> <span class="identifier">old_size</span><span class="special">)</span> <span class="special">(</span>
+ <span class="identifier">all_equals</span><span class="special">(</span><span class="identifier">begin</span><span class="special">()</span> <span class="special">+</span> <span class="identifier">old_size</span><span class="special">,</span> <span class="identifier">end</span><span class="special">(),</span> <span class="identifier">T</span><span class="special">())</span>
+ <span class="special">)</span> <span class="keyword">else</span> <span class="special">(</span>
+ <span class="keyword">true</span> <span class="comment">// Dummy assertion to show the optional else branch.</span>
+ <span class="special">)</span>
+ <span class="special">)</span>
+ <span class="special">)</span> <span class="special">{</span>
+ <span class="identifier">vector_</span><span class="special">.</span><span class="identifier">resize</span><span class="special">(</span><span class="identifier">newsize</span><span class="special">);</span>
+ <span class="special">}</span>
+
+ <span class="identifier">CONTRACT_FUNCTION</span><span class="special">(</span>
+ <span class="keyword">public</span> <span class="keyword">void</span> <span class="special">(</span><span class="identifier">resize</span><span class="special">)</span> <span class="special">(</span> <span class="special">(</span><span class="identifier">size_type</span><span class="special">)</span> <span class="identifier">newsize</span><span class="special">,</span> <span class="special">(</span><span class="identifier">T</span><span class="special">)</span> <span class="identifier">val</span> <span class="special">)</span>
+ <span class="identifier">postcondition</span><span class="special">(</span>
+ <span class="special">(</span><span class="identifier">size_type</span><span class="special">)</span> <span class="identifier">old_size</span> <span class="special">=</span> <span class="identifier">CONTRACT_OLDOF</span> <span class="identifier">size</span><span class="special">(),</span> <span class="comment">// Specify old type.</span>
+ <span class="identifier">size</span><span class="special">()</span> <span class="special">==</span> <span class="identifier">newsize</span><span class="special">,</span>
+ <span class="comment">// Version 2: with a ternary operator `condition ? then : else`.</span>
+ <span class="identifier">newsize</span> <span class="special">&gt;</span> <span class="identifier">old_size</span> <span class="special">?</span>
+ <span class="identifier">all_equals</span><span class="special">(</span><span class="identifier">begin</span><span class="special">()</span> <span class="special">+</span> <span class="identifier">old_size</span><span class="special">,</span> <span class="identifier">end</span><span class="special">(),</span> <span class="identifier">val</span><span class="special">)</span> <span class="special">:</span> <span class="keyword">true</span>
+ <span class="special">)</span>
+ <span class="special">)</span> <span class="special">{</span>
+ <span class="identifier">vector_</span><span class="special">.</span><span class="identifier">resize</span><span class="special">(</span><span class="identifier">newsize</span><span class="special">,</span> <span class="identifier">val</span><span class="special">);</span>
+ <span class="special">}</span>
+
+ <span class="identifier">CONTRACT_FUNCTION</span><span class="special">(</span>
+ <span class="keyword">public</span> <span class="special">(</span><span class="identifier">size_type</span><span class="special">)</span> <span class="special">(</span><span class="identifier">size</span><span class="special">)</span> <span class="special">(</span> <span class="keyword">void</span> <span class="special">)</span> <span class="keyword">const</span>
+ <span class="identifier">postcondition</span><span class="special">(</span> <span class="keyword">auto</span> <span class="identifier">result</span> <span class="special">=</span> <span class="keyword">return</span><span class="special">,</span> <span class="identifier">result</span> <span class="special">&lt;=</span> <span class="identifier">capacity</span><span class="special">()</span> <span class="special">)</span>
+ <span class="special">)</span> <span class="special">{</span>
+ <span class="keyword">return</span> <span class="identifier">vector_</span><span class="special">.</span><span class="identifier">size</span><span class="special">();</span>
+ <span class="special">}</span>
+
+ <span class="identifier">CONTRACT_FUNCTION</span><span class="special">(</span>
+ <span class="keyword">public</span> <span class="special">(</span><span class="identifier">size_type</span><span class="special">)</span> <span class="special">(</span><span class="identifier">max_size</span><span class="special">)</span> <span class="special">(</span> <span class="keyword">void</span> <span class="special">)</span> <span class="keyword">const</span>
+ <span class="identifier">postcondition</span><span class="special">(</span> <span class="keyword">auto</span> <span class="identifier">result</span> <span class="special">=</span> <span class="keyword">return</span><span class="special">,</span> <span class="identifier">result</span> <span class="special">&gt;=</span> <span class="identifier">capacity</span><span class="special">()</span> <span class="special">)</span>
+ <span class="special">)</span> <span class="special">{</span>
+ <span class="keyword">return</span> <span class="identifier">vector_</span><span class="special">.</span><span class="identifier">max_size</span><span class="special">();</span>
+ <span class="special">}</span>
+
+ <span class="identifier">CONTRACT_FUNCTION</span><span class="special">(</span>
+ <span class="keyword">public</span> <span class="keyword">bool</span> <span class="special">(</span><span class="identifier">empty</span><span class="special">)</span> <span class="special">(</span> <span class="keyword">void</span> <span class="special">)</span> <span class="keyword">const</span>
+ <span class="identifier">postcondition</span><span class="special">(</span> <span class="keyword">auto</span> <span class="identifier">result</span> <span class="special">=</span> <span class="keyword">return</span><span class="special">,</span> <span class="identifier">result</span> <span class="special">==</span> <span class="special">(</span><span class="identifier">size</span><span class="special">()</span> <span class="special">==</span> <span class="number">0</span><span class="special">)</span> <span class="special">)</span>
+ <span class="special">)</span> <span class="special">{</span>
+ <span class="keyword">return</span> <span class="identifier">vector_</span><span class="special">.</span><span class="identifier">empty</span><span class="special">();</span>
+ <span class="special">}</span>
+
+ <span class="identifier">CONTRACT_FUNCTION</span><span class="special">(</span>
+ <span class="keyword">public</span> <span class="special">(</span><span class="identifier">Alloc</span><span class="special">)</span> <span class="special">(</span><span class="identifier">get_allocator</span><span class="special">)</span> <span class="special">(</span> <span class="keyword">void</span> <span class="special">)</span> <span class="keyword">const</span>
+ <span class="special">)</span> <span class="special">{</span>
+ <span class="keyword">return</span> <span class="identifier">vector_</span><span class="special">.</span><span class="identifier">get_allocator</span><span class="special">();</span>
+ <span class="special">}</span>
+
+ <span class="identifier">CONTRACT_FUNCTION</span><span class="special">(</span>
+ <span class="keyword">public</span> <span class="special">(</span><span class="identifier">reference</span><span class="special">)</span> <span class="special">(</span><span class="identifier">at</span><span class="special">)</span> <span class="special">(</span> <span class="special">(</span><span class="identifier">size_type</span><span class="special">)</span> <span class="identifier">off</span> <span class="special">)</span>
+ <span class="identifier">precondition</span><span class="special">(</span> <span class="identifier">off</span> <span class="special">&lt;</span> <span class="identifier">size</span><span class="special">()</span> <span class="special">)</span>
+ <span class="special">)</span> <span class="special">{</span>
+ <span class="keyword">return</span> <span class="identifier">vector_</span><span class="special">.</span><span class="identifier">at</span><span class="special">(</span><span class="identifier">off</span><span class="special">);</span>
+ <span class="special">}</span>
+
+ <span class="identifier">CONTRACT_FUNCTION</span><span class="special">(</span>
+ <span class="keyword">public</span> <span class="special">(</span><span class="identifier">const_reference</span><span class="special">)</span> <span class="special">(</span><span class="identifier">at</span><span class="special">)</span> <span class="special">(</span> <span class="special">(</span><span class="identifier">size_type</span><span class="special">)</span> <span class="identifier">off</span> <span class="special">)</span> <span class="keyword">const</span>
+ <span class="identifier">precondition</span><span class="special">(</span> <span class="identifier">off</span> <span class="special">&lt;</span> <span class="identifier">size</span><span class="special">()</span> <span class="special">)</span>
+ <span class="special">)</span> <span class="special">{</span>
+ <span class="keyword">return</span> <span class="identifier">vector_</span><span class="special">.</span><span class="identifier">at</span><span class="special">(</span><span class="identifier">off</span><span class="special">);</span>
+ <span class="special">}</span>
+
+ <span class="identifier">CONTRACT_FUNCTION</span><span class="special">(</span> <span class="comment">// Operators name in both symbol `[]` and word `at`.</span>
+ <span class="keyword">public</span> <span class="special">(</span><span class="identifier">reference</span><span class="special">)</span> <span class="keyword">operator</span><span class="special">([],</span> <span class="identifier">at</span><span class="special">)</span> <span class="special">(</span> <span class="special">(</span><span class="identifier">size_type</span><span class="special">)</span> <span class="identifier">off</span> <span class="special">)</span>
+ <span class="identifier">precondition</span><span class="special">(</span> <span class="identifier">off</span> <span class="special">&lt;</span> <span class="identifier">size</span><span class="special">()</span> <span class="special">)</span>
+ <span class="special">)</span> <span class="special">{</span>
+ <span class="keyword">return</span> <span class="identifier">vector_</span><span class="special">[</span><span class="identifier">off</span><span class="special">];</span>
+ <span class="special">}</span>
+
+ <span class="identifier">CONTRACT_FUNCTION</span><span class="special">(</span>
+ <span class="keyword">public</span> <span class="special">(</span><span class="identifier">const_reference</span><span class="special">)</span> <span class="keyword">operator</span><span class="special">([],</span> <span class="identifier">at</span><span class="special">)</span> <span class="special">(</span> <span class="special">(</span><span class="identifier">size_type</span><span class="special">)</span> <span class="identifier">off</span> <span class="special">)</span> <span class="keyword">const</span>
+ <span class="identifier">precondition</span><span class="special">(</span> <span class="identifier">off</span> <span class="special">&lt;</span> <span class="identifier">size</span><span class="special">()</span> <span class="special">)</span>
+ <span class="special">)</span> <span class="special">{</span>
+ <span class="keyword">return</span> <span class="identifier">vector_</span><span class="special">[</span><span class="identifier">off</span><span class="special">];</span>
+ <span class="special">}</span>
+
+ <span class="identifier">CONTRACT_FUNCTION</span><span class="special">(</span>
+ <span class="keyword">public</span> <span class="special">(</span><span class="identifier">reference</span><span class="special">)</span> <span class="special">(</span><span class="identifier">front</span><span class="special">)</span> <span class="special">(</span> <span class="keyword">void</span> <span class="special">)</span>
+ <span class="identifier">precondition</span><span class="special">(</span> <span class="keyword">bool</span><span class="special">(!</span><span class="identifier">empty</span><span class="special">())</span> <span class="special">)</span> <span class="comment">// `bool()` handles leading `!`.</span>
+ <span class="special">)</span> <span class="special">{</span>
+ <span class="keyword">return</span> <span class="identifier">vector_</span><span class="special">.</span><span class="identifier">front</span><span class="special">();</span>
+ <span class="special">}</span>
+
+ <span class="identifier">CONTRACT_FUNCTION</span><span class="special">(</span>
+ <span class="keyword">public</span> <span class="special">(</span><span class="identifier">const_reference</span><span class="special">)</span> <span class="special">(</span><span class="identifier">front</span><span class="special">)</span> <span class="special">(</span> <span class="keyword">void</span> <span class="special">)</span> <span class="keyword">const</span>
+ <span class="identifier">precondition</span><span class="special">(</span> <span class="identifier">empty</span><span class="special">()</span> <span class="special">==</span> <span class="keyword">false</span> <span class="special">)</span> <span class="comment">// `== false` instead of `!`.</span>
+ <span class="special">)</span> <span class="special">{</span>
+ <span class="keyword">return</span> <span class="identifier">vector_</span><span class="special">.</span><span class="identifier">front</span><span class="special">();</span>
+ <span class="special">}</span>
+
+ <span class="identifier">CONTRACT_FUNCTION</span><span class="special">(</span>
+ <span class="keyword">public</span> <span class="special">(</span><span class="identifier">reference</span><span class="special">)</span> <span class="special">(</span><span class="identifier">back</span><span class="special">)</span> <span class="special">(</span> <span class="keyword">void</span> <span class="special">)</span>
+ <span class="identifier">precondition</span><span class="special">(</span> <span class="identifier">contract</span><span class="special">::</span><span class="identifier">identity</span><span class="special">(!</span><span class="identifier">empty</span><span class="special">())</span> <span class="special">)</span> <span class="comment">// `identity` for `!`.</span>
+ <span class="special">)</span> <span class="special">{</span>
+ <span class="keyword">return</span> <span class="identifier">vector_</span><span class="special">.</span><span class="identifier">back</span><span class="special">();</span>
+ <span class="special">}</span>
+
+ <span class="identifier">CONTRACT_FUNCTION</span><span class="special">(</span>
+ <span class="keyword">public</span> <span class="special">(</span><span class="identifier">const_reference</span><span class="special">)</span> <span class="special">(</span><span class="identifier">back</span><span class="special">)</span> <span class="special">(</span> <span class="keyword">void</span> <span class="special">)</span> <span class="keyword">const</span>
+ <span class="identifier">precondition</span><span class="special">(</span> <span class="identifier">empty</span><span class="special">()</span> <span class="special">==</span> <span class="keyword">false</span> <span class="special">)</span>
+ <span class="special">)</span> <span class="special">{</span>
+ <span class="keyword">return</span> <span class="identifier">vector_</span><span class="special">.</span><span class="identifier">back</span><span class="special">();</span>
+ <span class="special">}</span>
+
+ <span class="identifier">CONTRACT_FUNCTION</span><span class="special">(</span>
+ <span class="keyword">public</span> <span class="keyword">void</span> <span class="special">(</span><span class="identifier">push_back</span><span class="special">)</span> <span class="special">(</span> <span class="special">(</span><span class="keyword">const</span> <span class="identifier">T</span><span class="special">&amp;)</span> <span class="identifier">val</span> <span class="special">)</span>
+ <span class="identifier">precondition</span><span class="special">(</span> <span class="identifier">size</span><span class="special">()</span> <span class="special">&lt;</span> <span class="identifier">max_size</span><span class="special">()</span> <span class="special">)</span>
+ <span class="identifier">postcondition</span><span class="special">(</span>
+ <span class="keyword">auto</span> <span class="identifier">old_size</span> <span class="special">=</span> <span class="identifier">CONTRACT_OLDOF</span> <span class="identifier">size</span><span class="special">(),</span>
+ <span class="keyword">auto</span> <span class="identifier">old_capacity</span> <span class="special">=</span> <span class="identifier">CONTRACT_OLDOF</span> <span class="identifier">capacity</span><span class="special">(),</span>
+ <span class="identifier">back</span><span class="special">()</span> <span class="special">==</span> <span class="identifier">val</span><span class="special">,</span>
+ <span class="identifier">size</span><span class="special">()</span> <span class="special">==</span> <span class="identifier">old_size</span> <span class="special">+</span> <span class="number">1</span><span class="special">,</span>
+ <span class="identifier">capacity</span><span class="special">()</span> <span class="special">&gt;=</span> <span class="identifier">old_capacity</span>
+ <span class="special">)</span>
+ <span class="special">)</span> <span class="special">{</span>
+ <span class="identifier">vector_</span><span class="special">.</span><span class="identifier">push_back</span><span class="special">(</span><span class="identifier">val</span><span class="special">);</span>
+ <span class="special">}</span>
+
+ <span class="identifier">CONTRACT_FUNCTION</span><span class="special">(</span>
+ <span class="keyword">public</span> <span class="keyword">void</span> <span class="special">(</span><span class="identifier">pop_back</span><span class="special">)</span> <span class="special">(</span> <span class="keyword">void</span> <span class="special">)</span>
+ <span class="identifier">precondition</span><span class="special">(</span> <span class="identifier">empty</span><span class="special">()</span> <span class="special">==</span> <span class="keyword">false</span> <span class="special">)</span>
+ <span class="identifier">postcondition</span><span class="special">(</span>
+ <span class="keyword">auto</span> <span class="identifier">old_size</span> <span class="special">=</span> <span class="identifier">CONTRACT_OLDOF</span> <span class="identifier">size</span><span class="special">(),</span>
+ <span class="identifier">size</span><span class="special">()</span> <span class="special">==</span> <span class="identifier">old_size</span> <span class="special">-</span> <span class="number">1</span>
+ <span class="special">)</span>
+ <span class="special">)</span> <span class="special">{</span>
+ <span class="identifier">vector_</span><span class="special">.</span><span class="identifier">pop_back</span><span class="special">();</span>
+ <span class="special">}</span>
+
+ <span class="identifier">CONTRACT_FUNCTION</span><span class="special">(</span>
+ <span class="keyword">public</span> <span class="keyword">template</span><span class="special">(</span> <span class="keyword">class</span> <span class="identifier">InIt</span> <span class="special">)</span> <span class="identifier">requires</span><span class="special">(</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">InputIterator</span><span class="special">&lt;</span><span class="identifier">InIt</span><span class="special">&gt;</span> <span class="special">)</span>
+ <span class="keyword">void</span> <span class="special">(</span><span class="identifier">assign</span><span class="special">)</span> <span class="special">(</span> <span class="special">(</span><span class="identifier">InIt</span><span class="special">)</span> <span class="identifier">first</span><span class="special">,</span> <span class="special">(</span><span class="identifier">InIt</span><span class="special">)</span> <span class="identifier">last</span> <span class="special">)</span>
+ <span class="comment">/** @pre [first, last) not sub-range of [begin(), end()). */</span>
+ <span class="identifier">postcondition</span><span class="special">(</span> <span class="identifier">equal_distance</span><span class="special">(</span><span class="identifier">first</span><span class="special">,</span> <span class="identifier">last</span><span class="special">,</span> <span class="identifier">size</span><span class="special">())</span> <span class="special">)</span>
+ <span class="special">)</span> <span class="special">{</span>
+ <span class="identifier">vector_</span><span class="special">.</span><span class="identifier">assign</span><span class="special">(</span><span class="identifier">first</span><span class="special">,</span> <span class="identifier">last</span><span class="special">);</span>
+ <span class="special">}</span>
+
+ <span class="identifier">CONTRACT_FUNCTION</span><span class="special">(</span>
+ <span class="keyword">public</span> <span class="keyword">void</span> <span class="special">(</span><span class="identifier">assign</span><span class="special">)</span> <span class="special">(</span> <span class="special">(</span><span class="identifier">size_type</span><span class="special">)</span> <span class="identifier">count</span><span class="special">,</span> <span class="special">(</span><span class="keyword">const</span> <span class="identifier">T</span><span class="special">&amp;)</span> <span class="identifier">val</span> <span class="special">)</span>
+ <span class="identifier">precondition</span><span class="special">(</span> <span class="identifier">count</span> <span class="special">&lt;=</span> <span class="identifier">max_size</span><span class="special">()</span> <span class="special">)</span>
+ <span class="identifier">postcondition</span><span class="special">(</span> <span class="identifier">all_equals</span><span class="special">(</span><span class="identifier">begin</span><span class="special">(),</span> <span class="identifier">end</span><span class="special">(),</span> <span class="identifier">val</span><span class="special">)</span> <span class="special">)</span>
+ <span class="special">)</span> <span class="special">{</span>
+ <span class="identifier">vector_</span><span class="special">.</span><span class="identifier">assign</span><span class="special">(</span><span class="identifier">count</span><span class="special">,</span> <span class="identifier">val</span><span class="special">);</span>
+ <span class="special">}</span>
+
+ <span class="identifier">CONTRACT_FUNCTION</span><span class="special">(</span>
+ <span class="keyword">public</span> <span class="special">(</span><span class="identifier">iterator</span><span class="special">)</span> <span class="special">(</span><span class="identifier">insert</span><span class="special">)</span> <span class="special">(</span> <span class="special">(</span><span class="identifier">iterator</span><span class="special">)</span> <span class="identifier">pos</span><span class="special">,</span> <span class="special">(</span><span class="keyword">const</span> <span class="identifier">T</span><span class="special">&amp;)</span> <span class="identifier">val</span> <span class="special">)</span>
+ <span class="identifier">precondition</span><span class="special">(</span> <span class="identifier">size</span><span class="special">()</span> <span class="special">&lt;</span> <span class="identifier">max_size</span><span class="special">()</span> <span class="special">)</span>
+ <span class="identifier">postcondition</span><span class="special">(</span>
+ <span class="keyword">auto</span> <span class="identifier">result</span> <span class="special">=</span> <span class="keyword">return</span><span class="special">,</span>
+ <span class="keyword">auto</span> <span class="identifier">old_size</span> <span class="special">=</span> <span class="identifier">CONTRACT_OLDOF</span> <span class="identifier">size</span><span class="special">(),</span>
+ <span class="keyword">auto</span> <span class="identifier">old_capacity</span> <span class="special">=</span> <span class="identifier">CONTRACT_OLDOF</span> <span class="identifier">capacity</span><span class="special">(),</span>
+ <span class="identifier">val</span> <span class="special">==</span> <span class="special">*</span><span class="identifier">result</span><span class="special">,</span>
+ <span class="identifier">size</span><span class="special">()</span> <span class="special">==</span> <span class="identifier">old_size</span> <span class="special">+</span> <span class="number">1</span><span class="special">,</span>
+ <span class="identifier">capacity</span><span class="special">()</span> <span class="special">&gt;=</span> <span class="identifier">old_capacity</span>
+ <span class="comment">/** @post
+ * if capacity() &gt; oldof capacity():
+ * all iterators invalidated
+ * else:
+ * all iterators in [pos, end()) invalidated
+ */</span>
+ <span class="special">)</span>
+ <span class="special">)</span> <span class="special">{</span>
+ <span class="keyword">return</span> <span class="identifier">vector_</span><span class="special">.</span><span class="identifier">insert</span><span class="special">(</span><span class="identifier">pos</span><span class="special">,</span> <span class="identifier">val</span><span class="special">);</span>
+ <span class="special">}</span>
+
+ <span class="identifier">CONTRACT_FUNCTION</span><span class="special">(</span>
+ <span class="keyword">public</span> <span class="keyword">void</span> <span class="special">(</span><span class="identifier">insert</span><span class="special">)</span> <span class="special">(</span> <span class="special">(</span><span class="identifier">iterator</span><span class="special">)</span> <span class="identifier">pos</span><span class="special">,</span> <span class="special">(</span><span class="identifier">size_type</span><span class="special">)</span> <span class="identifier">count</span><span class="special">,</span> <span class="special">(</span><span class="keyword">const</span> <span class="identifier">T</span><span class="special">&amp;)</span> <span class="identifier">val</span> <span class="special">)</span>
+ <span class="identifier">precondition</span><span class="special">(</span> <span class="identifier">max_size</span><span class="special">()</span> <span class="special">&gt;</span> <span class="identifier">size</span><span class="special">()</span> <span class="special">+</span> <span class="identifier">count</span> <span class="special">)</span>
+ <span class="identifier">postcondition</span><span class="special">(</span>
+ <span class="keyword">auto</span> <span class="identifier">old_size</span> <span class="special">=</span> <span class="identifier">CONTRACT_OLDOF</span> <span class="identifier">size</span><span class="special">(),</span>
+ <span class="keyword">auto</span> <span class="identifier">old_capacity</span> <span class="special">=</span> <span class="identifier">CONTRACT_OLDOF</span> <span class="identifier">capacity</span><span class="special">(),</span>
+ <span class="keyword">auto</span> <span class="identifier">old_pos</span> <span class="special">=</span> <span class="identifier">CONTRACT_OLDOF</span> <span class="identifier">pos</span><span class="special">,</span>
+ <span class="identifier">size</span><span class="special">()</span> <span class="special">==</span> <span class="identifier">old_size</span> <span class="special">+</span> <span class="identifier">count</span><span class="special">,</span>
+ <span class="identifier">capacity</span><span class="special">()</span> <span class="special">&gt;=</span> <span class="identifier">old_capacity</span><span class="special">,</span>
+ <span class="keyword">if</span><span class="special">(</span><span class="identifier">capacity</span><span class="special">()</span> <span class="special">==</span> <span class="identifier">old_capacity</span><span class="special">)</span> <span class="special">(</span>
+ <span class="identifier">all_equals</span><span class="special">(</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">prior</span><span class="special">(</span><span class="identifier">old_pos</span><span class="special">),</span>
+ <span class="identifier">boost</span><span class="special">::</span><span class="identifier">prior</span><span class="special">(</span><span class="identifier">old_pos</span><span class="special">)</span> <span class="special">+</span> <span class="identifier">count</span><span class="special">,</span> <span class="identifier">val</span><span class="special">)</span>
+ <span class="comment">/** @post All iterators in [pos, end()) invalidated. */</span>
+ <span class="special">)</span>
+ <span class="comment">/** @post Else, all iterators invalidated. */</span>
+ <span class="special">)</span>
+ <span class="special">)</span> <span class="special">{</span>
+ <span class="identifier">vector_</span><span class="special">.</span><span class="identifier">insert</span><span class="special">(</span><span class="identifier">pos</span><span class="special">,</span> <span class="identifier">count</span><span class="special">,</span> <span class="identifier">val</span><span class="special">);</span>
+ <span class="special">}</span>
+
+ <span class="identifier">CONTRACT_FUNCTION</span><span class="special">(</span>
+ <span class="keyword">public</span> <span class="keyword">template</span><span class="special">(</span> <span class="keyword">class</span> <span class="identifier">InIt</span> <span class="special">)</span> <span class="identifier">requires</span><span class="special">(</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">InputIterator</span><span class="special">&lt;</span><span class="identifier">InIt</span><span class="special">&gt;</span> <span class="special">)</span>
+ <span class="keyword">void</span> <span class="special">(</span><span class="identifier">insert</span><span class="special">)</span> <span class="special">(</span> <span class="special">(</span><span class="identifier">iterator</span><span class="special">)</span> <span class="identifier">pos</span><span class="special">,</span> <span class="special">(</span><span class="identifier">InIt</span><span class="special">)</span> <span class="identifier">first</span><span class="special">,</span> <span class="special">(</span><span class="identifier">InIt</span><span class="special">)</span> <span class="identifier">last</span> <span class="special">)</span>
+ <span class="identifier">precondition</span><span class="special">(</span>
+ <span class="comment">/** @pre [first, last) not a sub-range of [begin(), end()). */</span>
+ <span class="identifier">max_size</span><span class="special">()</span> <span class="special">&gt;</span> <span class="identifier">size</span><span class="special">()</span> <span class="special">+</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">distance</span><span class="special">(</span><span class="identifier">first</span><span class="special">,</span> <span class="identifier">last</span><span class="special">)</span>
+ <span class="special">)</span>
+ <span class="identifier">postcondition</span><span class="special">(</span>
+ <span class="keyword">auto</span> <span class="identifier">old_size</span> <span class="special">=</span> <span class="identifier">CONTRACT_OLDOF</span> <span class="identifier">size</span><span class="special">(),</span>
+ <span class="keyword">auto</span> <span class="identifier">old_capacity</span> <span class="special">=</span> <span class="identifier">CONTRACT_OLDOF</span> <span class="identifier">capacity</span><span class="special">(),</span>
+ <span class="identifier">size</span><span class="special">()</span> <span class="special">==</span> <span class="identifier">old_size</span> <span class="special">+</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">distance</span><span class="special">(</span><span class="identifier">first</span><span class="special">,</span> <span class="identifier">last</span><span class="special">),</span>
+ <span class="identifier">capacity</span><span class="special">()</span> <span class="special">&gt;=</span> <span class="identifier">old_capacity</span>
+ <span class="special">)</span>
+ <span class="special">)</span> <span class="special">{</span>
+ <span class="keyword">return</span> <span class="identifier">vector_</span><span class="special">.</span><span class="identifier">insert</span><span class="special">(</span><span class="identifier">pos</span><span class="special">,</span> <span class="identifier">first</span><span class="special">,</span> <span class="identifier">last</span><span class="special">);</span>
+ <span class="special">}</span>
+
+ <span class="identifier">CONTRACT_FUNCTION</span><span class="special">(</span>
+ <span class="keyword">public</span> <span class="special">(</span><span class="identifier">iterator</span><span class="special">)</span> <span class="special">(</span><span class="identifier">erase</span><span class="special">)</span> <span class="special">(</span> <span class="special">(</span><span class="identifier">iterator</span><span class="special">)</span> <span class="identifier">pos</span> <span class="special">)</span>
+ <span class="identifier">precondition</span><span class="special">(</span>
+ <span class="identifier">empty</span><span class="special">()</span> <span class="special">==</span> <span class="keyword">false</span><span class="special">,</span>
+ <span class="identifier">pos</span> <span class="special">!=</span> <span class="identifier">end</span><span class="special">()</span>
+ <span class="special">)</span>
+ <span class="identifier">postcondition</span><span class="special">(</span>
+ <span class="keyword">auto</span> <span class="identifier">result</span> <span class="special">=</span> <span class="keyword">return</span><span class="special">,</span>
+ <span class="keyword">auto</span> <span class="identifier">old_size</span> <span class="special">=</span> <span class="identifier">CONTRACT_OLDOF</span> <span class="identifier">size</span><span class="special">(),</span>
+ <span class="identifier">size</span><span class="special">()</span> <span class="special">==</span> <span class="identifier">old_size</span> <span class="special">-</span> <span class="number">1</span><span class="special">,</span>
+ <span class="keyword">if</span><span class="special">(</span><span class="identifier">empty</span><span class="special">())</span> <span class="special">(</span> <span class="identifier">result</span> <span class="special">==</span> <span class="identifier">end</span><span class="special">()</span> <span class="special">)</span>
+ <span class="comment">/** @post Iterators in [pos, end()) invalidated. */</span>
+ <span class="special">)</span>
+ <span class="special">)</span> <span class="special">{</span>
+ <span class="keyword">return</span> <span class="identifier">vector_</span><span class="special">.</span><span class="identifier">erase</span><span class="special">(</span><span class="identifier">pos</span><span class="special">);</span>
+ <span class="special">}</span>
+
+ <span class="identifier">CONTRACT_FUNCTION</span><span class="special">(</span>
+ <span class="keyword">public</span> <span class="special">(</span><span class="identifier">iterator</span><span class="special">)</span> <span class="special">(</span><span class="identifier">erase</span><span class="special">)</span> <span class="special">(</span> <span class="special">(</span><span class="identifier">iterator</span><span class="special">)</span> <span class="identifier">first</span><span class="special">,</span> <span class="special">(</span><span class="identifier">iterator</span><span class="special">)</span> <span class="identifier">last</span> <span class="special">)</span>
+ <span class="identifier">precondition</span><span class="special">(</span> <span class="identifier">size</span><span class="special">()</span> <span class="special">&gt;=</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">distance</span><span class="special">(</span><span class="identifier">first</span><span class="special">,</span> <span class="identifier">last</span><span class="special">)</span> <span class="special">)</span>
+ <span class="identifier">postcondition</span><span class="special">(</span>
+ <span class="keyword">auto</span> <span class="identifier">result</span> <span class="special">=</span> <span class="keyword">return</span><span class="special">,</span>
+ <span class="keyword">auto</span> <span class="identifier">old_size</span> <span class="special">=</span> <span class="identifier">CONTRACT_OLDOF</span> <span class="identifier">size</span><span class="special">(),</span>
+ <span class="identifier">size</span><span class="special">()</span> <span class="special">==</span> <span class="identifier">old_size</span> <span class="special">-</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">distance</span><span class="special">(</span><span class="identifier">first</span><span class="special">,</span> <span class="identifier">last</span><span class="special">),</span>
+ <span class="keyword">if</span><span class="special">(</span><span class="identifier">empty</span><span class="special">())</span> <span class="special">(</span> <span class="identifier">result</span> <span class="special">==</span> <span class="identifier">end</span><span class="special">()</span> <span class="special">)</span>
+ <span class="comment">/** @post Iterators in [first, end()) invalidated. */</span>
+ <span class="special">)</span>
+ <span class="special">)</span> <span class="special">{</span>
+ <span class="keyword">return</span> <span class="identifier">vector_</span><span class="special">.</span><span class="identifier">erase</span><span class="special">(</span><span class="identifier">first</span><span class="special">,</span> <span class="identifier">last</span><span class="special">);</span>
+ <span class="special">}</span>
+
+ <span class="identifier">CONTRACT_FUNCTION</span><span class="special">(</span>
+ <span class="keyword">public</span> <span class="keyword">void</span> <span class="special">(</span><span class="identifier">clear</span><span class="special">)</span> <span class="special">(</span> <span class="keyword">void</span> <span class="special">)</span>
+ <span class="identifier">postcondition</span><span class="special">(</span> <span class="identifier">empty</span><span class="special">()</span> <span class="special">)</span>
+ <span class="special">)</span> <span class="special">{</span>
+ <span class="identifier">vector_</span><span class="special">.</span><span class="identifier">clear</span><span class="special">();</span>
+ <span class="special">}</span>
+
+ <span class="identifier">CONTRACT_FUNCTION</span><span class="special">(</span>
+ <span class="keyword">public</span> <span class="keyword">void</span> <span class="special">(</span><span class="identifier">swap</span><span class="special">)</span> <span class="special">(</span> <span class="special">(</span><span class="identifier">vector</span><span class="special">&amp;)</span> <span class="identifier">right</span> <span class="special">)</span>
+ <span class="identifier">postcondition</span><span class="special">(</span>
+ <span class="keyword">auto</span> <span class="identifier">old_self</span> <span class="special">=</span> <span class="identifier">CONTRACT_OLDOF</span> <span class="special">*</span><span class="keyword">this</span><span class="special">,</span> <span class="comment">// Deep copy (not just ptr).</span>
+ <span class="keyword">auto</span> <span class="identifier">old_right</span> <span class="special">=</span> <span class="identifier">CONTRACT_OLDOF</span> <span class="identifier">right</span><span class="special">,</span>
+ <span class="identifier">right</span> <span class="special">==</span> <span class="identifier">old_self</span><span class="special">,</span>
+ <span class="identifier">old_right</span> <span class="special">==</span> <span class="special">*</span><span class="keyword">this</span><span class="special">,</span>
+ <span class="special">)</span>
+ <span class="special">)</span> <span class="special">{</span>
+ <span class="identifier">vector_</span><span class="special">.</span><span class="identifier">swap</span><span class="special">(</span><span class="identifier">right</span><span class="special">);</span>
+ <span class="special">}</span>
+
+ <span class="identifier">CONTRACT_FUNCTION</span><span class="special">(</span>
+ <span class="keyword">public</span> <span class="keyword">bool</span> <span class="keyword">operator</span><span class="special">(==,</span> <span class="identifier">equal</span><span class="special">)</span> <span class="special">(</span> <span class="special">(</span><span class="keyword">const</span> <span class="identifier">vector</span><span class="special">&amp;)</span> <span class="identifier">right</span> <span class="special">)</span> <span class="keyword">const</span>
+ <span class="identifier">postcondition</span><span class="special">(</span>
+ <span class="keyword">auto</span> <span class="identifier">result</span> <span class="special">=</span> <span class="keyword">return</span><span class="special">,</span>
+ <span class="identifier">result</span> <span class="special">==</span> <span class="identifier">all_equals</span><span class="special">(</span><span class="identifier">begin</span><span class="special">(),</span> <span class="identifier">end</span><span class="special">(),</span> <span class="identifier">right</span><span class="special">.</span><span class="identifier">begin</span><span class="special">(),</span> <span class="identifier">right</span><span class="special">.</span><span class="identifier">end</span><span class="special">())</span>
+ <span class="special">)</span>
+ <span class="special">)</span> <span class="special">{</span>
+ <span class="keyword">return</span> <span class="identifier">vector_</span> <span class="special">==</span> <span class="identifier">right</span><span class="special">.</span><span class="identifier">vector_</span><span class="special">;</span>
+ <span class="special">}</span>
+
+<span class="keyword">private</span><span class="special">:</span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">vector</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">,</span> <span class="identifier">Alloc</span><span class="special">&gt;</span> <span class="identifier">vector_</span><span class="special">;</span>
+<span class="special">};</span>
+</pre>
+<p>
+ </p>
+ </td>
+<td>
+ <p>
+
+</p>
+<pre xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="table-programlisting"><span class="comment">// Extra spaces, newlines, public, etc to better align code with library syntax.</span>
+
+<span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">concepts</span><span class="special">&gt;</span>
+<span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">vector</span><span class="special">&gt;</span>
+
+<span class="comment">// Contract helpers.</span>
+
+
+<span class="keyword">template</span><span class="special">&lt;</span> <span class="keyword">class</span> <span class="identifier">Iter</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">T</span> <span class="special">&gt;</span>
+ <span class="identifier">requires</span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">ForwardIterator</span><span class="special">&lt;</span><span class="identifier">Iter</span><span class="special">&gt;,</span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">EqualityComparable</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">&gt;</span>
+
+<span class="keyword">bool</span> <span class="identifier">all_equals</span> <span class="special">(</span> <span class="identifier">Iter</span> <span class="identifier">first</span><span class="special">,</span> <span class="identifier">Iter</span> <span class="identifier">last</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">T</span><span class="special">&amp;</span> <span class="identifier">val</span> <span class="special">)</span>
+<span class="special">{</span>
+ <span class="keyword">for</span><span class="special">(</span><span class="identifier">Iter</span> <span class="identifier">i</span> <span class="special">=</span> <span class="identifier">first</span><span class="special">;</span> <span class="identifier">i</span> <span class="special">&lt;</span> <span class="identifier">last</span><span class="special">;</span> <span class="special">++</span><span class="identifier">i</span><span class="special">)</span> <span class="keyword">if</span><span class="special">(*</span><span class="identifier">i</span> <span class="special">!=</span> <span class="identifier">val</span><span class="special">)</span> <span class="keyword">return</span> <span class="keyword">false</span><span class="special">;</span>
+ <span class="keyword">return</span> <span class="keyword">true</span><span class="special">;</span>
+<span class="special">}</span>
+
+
+<span class="keyword">template</span><span class="special">&lt;</span> <span class="keyword">class</span> <span class="identifier">Iter</span> <span class="special">&gt;</span>
+ <span class="identifier">requires</span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">ForwardIterator</span><span class="special">&lt;</span><span class="identifier">Iter</span><span class="special">&gt;,</span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">EqualityComparable</span><span class="special">&lt;</span><span class="keyword">typename</span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">ForwardIterator</span><span class="special">&lt;</span><span class="identifier">Iter</span><span class="special">&gt;::</span><span class="identifier">value_type</span><span class="special">&gt;</span>
+
+<span class="keyword">bool</span> <span class="identifier">all_equals</span> <span class="special">(</span> <span class="identifier">Iter</span> <span class="identifier">first1</span><span class="special">,</span> <span class="identifier">Iter</span> <span class="identifier">last1</span><span class="special">,</span> <span class="identifier">Iter</span> <span class="identifier">first2</span><span class="special">,</span> <span class="identifier">Iter</span> <span class="identifier">last2</span> <span class="special">)</span>
+ <span class="identifier">precondition</span> <span class="special">{</span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">distance</span><span class="special">(</span><span class="identifier">first1</span><span class="special">,</span> <span class="identifier">last1</span><span class="special">)</span> <span class="special">==</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">distance</span><span class="special">(</span><span class="identifier">first2</span><span class="special">,</span> <span class="identifier">last2</span><span class="special">);</span>
+ <span class="special">}</span>
+<span class="special">{</span>
+ <span class="identifier">Iter</span> <span class="identifier">i</span> <span class="special">=</span> <span class="identifier">first1</span><span class="special">,</span> <span class="identifier">j</span> <span class="special">=</span> <span class="identifier">first2</span><span class="special">;</span>
+ <span class="keyword">while</span><span class="special">(</span><span class="identifier">i</span> <span class="special">&lt;</span> <span class="identifier">last1</span> <span class="special">&amp;&amp;</span> <span class="identifier">j</span> <span class="special">&lt;</span> <span class="identifier">last2</span><span class="special">)</span> <span class="special">{</span>
+ <span class="keyword">if</span><span class="special">(*</span><span class="identifier">i</span> <span class="special">!=</span> <span class="special">*</span><span class="identifier">j</span><span class="special">)</span> <span class="keyword">return</span> <span class="keyword">false</span><span class="special">;</span>
+ <span class="special">++</span><span class="identifier">i</span><span class="special">;</span> <span class="special">++</span><span class="identifier">j</span><span class="special">;</span>
+ <span class="special">}</span>
+ <span class="keyword">return</span> <span class="keyword">true</span><span class="special">;</span>
+<span class="special">}</span>
+
+
+<span class="keyword">template</span><span class="special">&lt;</span> <span class="keyword">class</span> <span class="identifier">Iter</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Size</span> <span class="special">&gt;</span>
+ <span class="identifier">requires</span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">ForwardIterator</span><span class="special">&lt;</span><span class="identifier">Iter</span><span class="special">&gt;,</span>
+
+ <span class="keyword">typename</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">Convertible</span><span class="special">&lt;</span><span class="identifier">Size</span><span class="special">,</span> <span class="keyword">int</span><span class="special">&gt;</span>
+
+<span class="keyword">bool</span> <span class="identifier">equal_distance</span> <span class="special">(</span> <span class="identifier">Iter</span> <span class="identifier">first</span><span class="special">,</span> <span class="identifier">Iter</span> <span class="identifier">last</span><span class="special">,</span> <span class="identifier">Size</span> <span class="identifier">size</span> <span class="special">)</span>
+<span class="special">{</span>
+ <span class="keyword">return</span> <span class="keyword">int</span><span class="special">(</span><span class="identifier">size</span><span class="special">)</span> <span class="special">==</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">distance</span><span class="special">(</span><span class="identifier">first</span><span class="special">,</span> <span class="identifier">last</span><span class="special">);</span>
+<span class="special">}</span>
+
+<span class="comment">// New vector interface (with contracts).</span>
+
+
+<span class="keyword">template</span><span class="special">&lt;</span> <span class="keyword">class</span> <span class="identifier">T</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Alloc</span> <span class="special">=</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">allocator</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">&gt;</span> <span class="special">&gt;</span>
+<span class="keyword">class</span> <span class="identifier">vector</span>
+<span class="special">{</span>
+ <span class="identifier">invariant</span> <span class="special">{</span>
+ <span class="identifier">empty</span><span class="special">()</span> <span class="special">==</span> <span class="special">(</span><span class="identifier">size</span><span class="special">()</span> <span class="special">==</span> <span class="number">0</span><span class="special">);</span>
+ <span class="keyword">int</span><span class="special">(</span><span class="identifier">size</span><span class="special">())</span> <span class="special">==</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">distance</span><span class="special">(</span><span class="identifier">begin</span><span class="special">(),</span> <span class="identifier">end</span><span class="special">());</span>
+ <span class="keyword">int</span><span class="special">(</span><span class="identifier">size</span><span class="special">())</span> <span class="special">==</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">distance</span><span class="special">(</span><span class="identifier">rbegin</span><span class="special">(),</span> <span class="identifier">rend</span><span class="special">());</span>
+ <span class="identifier">size</span><span class="special">()</span> <span class="special">&lt;=</span> <span class="identifier">capacity</span><span class="special">();</span>
+ <span class="identifier">capacity</span><span class="special">()</span> <span class="special">&lt;=</span> <span class="identifier">max_size</span><span class="special">();</span>
+ <span class="special">}</span>
+ <span class="comment">// No static class invariants allowed (could be `static invariant { ... }`).</span>
+
+<span class="keyword">public</span><span class="special">:</span>
+ <span class="keyword">typedef</span> <span class="keyword">typename</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">vector</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">,</span> <span class="identifier">Alloc</span><span class="special">&gt;::</span><span class="identifier">size_type</span> <span class="identifier">size_type</span><span class="special">;</span>
+ <span class="keyword">typedef</span> <span class="keyword">typename</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">vector</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">,</span> <span class="identifier">Alloc</span><span class="special">&gt;::</span><span class="identifier">iterator</span> <span class="identifier">iterator</span><span class="special">;</span>
+ <span class="keyword">typedef</span> <span class="keyword">typename</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">vector</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">,</span> <span class="identifier">Alloc</span><span class="special">&gt;::</span><span class="identifier">const_iterator</span> <span class="identifier">const_iterator</span><span class="special">;</span>
+ <span class="keyword">typedef</span> <span class="keyword">typename</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">vector</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">,</span> <span class="identifier">Alloc</span><span class="special">&gt;::</span><span class="identifier">reverse_iterator</span> <span class="identifier">reverse_iterator</span><span class="special">;</span>
+ <span class="keyword">typedef</span> <span class="keyword">typename</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">vector</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">,</span> <span class="identifier">Alloc</span><span class="special">&gt;::</span><span class="identifier">const_reverse_iterator</span>
+ <span class="identifier">const_reverse_iterator</span><span class="special">;</span>
+ <span class="keyword">typedef</span> <span class="keyword">typename</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">vector</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">,</span> <span class="identifier">Alloc</span><span class="special">&gt;::</span><span class="identifier">reference</span> <span class="identifier">reference</span><span class="special">;</span>
+ <span class="keyword">typedef</span> <span class="keyword">typename</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">vector</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">,</span> <span class="identifier">Alloc</span><span class="special">&gt;::</span><span class="identifier">const_reference</span> <span class="identifier">const_reference</span><span class="special">;</span>
+
+
+ <span class="keyword">public</span><span class="special">:</span> <span class="identifier">vector</span> <span class="special">(</span> <span class="keyword">void</span> <span class="special">)</span>
+ <span class="special">:</span> <span class="identifier">vector_</span><span class="special">()</span>
+ <span class="identifier">postcondition</span> <span class="special">{</span> <span class="identifier">empty</span><span class="special">();</span> <span class="special">}</span>
+ <span class="special">{}</span>
+
+
+ <span class="keyword">public</span><span class="special">:</span> <span class="keyword">explicit</span> <span class="identifier">vector</span> <span class="special">(</span> <span class="keyword">const</span> <span class="identifier">Alloc</span><span class="special">&amp;</span> <span class="identifier">al</span> <span class="special">)</span>
+ <span class="special">:</span> <span class="identifier">vector_</span><span class="special">(</span><span class="identifier">al</span><span class="special">)</span>
+ <span class="identifier">postcondition</span> <span class="special">{</span> <span class="identifier">empty</span><span class="special">();</span> <span class="identifier">al</span> <span class="special">==</span> <span class="identifier">get_allocator</span><span class="special">();</span> <span class="special">}</span>
+ <span class="special">{}</span>
+
+
+ <span class="keyword">public</span><span class="special">:</span> <span class="keyword">explicit</span> <span class="identifier">vector</span> <span class="special">(</span> <span class="identifier">size_type</span> <span class="identifier">count</span> <span class="special">)</span>
+ <span class="special">:</span> <span class="identifier">vector_</span><span class="special">(</span><span class="identifier">count</span><span class="special">)</span>
+ <span class="identifier">postcondition</span> <span class="special">{</span> <span class="identifier">size</span><span class="special">()</span> <span class="special">==</span> <span class="identifier">count</span><span class="special">;</span> <span class="identifier">all_equals</span><span class="special">(</span><span class="identifier">begin</span><span class="special">(),</span> <span class="identifier">end</span><span class="special">(),</span> <span class="identifier">T</span><span class="special">());</span> <span class="special">}</span>
+ <span class="special">{}</span>
+
+
+ <span class="keyword">public</span><span class="special">:</span> <span class="identifier">vector</span> <span class="special">(</span> <span class="identifier">size_type</span> <span class="identifier">count</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">T</span><span class="special">&amp;</span> <span class="identifier">val</span> <span class="special">)</span>
+ <span class="special">:</span> <span class="identifier">vector_</span><span class="special">(</span><span class="identifier">count</span><span class="special">,</span> <span class="identifier">val</span><span class="special">)</span>
+ <span class="identifier">postcondition</span> <span class="special">{</span> <span class="identifier">size</span><span class="special">()</span> <span class="special">==</span> <span class="identifier">count</span><span class="special">;</span> <span class="identifier">all_equals</span><span class="special">(</span><span class="identifier">begin</span><span class="special">(),</span> <span class="identifier">end</span><span class="special">(),</span> <span class="identifier">val</span><span class="special">);</span> <span class="special">}</span>
+ <span class="special">{}</span>
+
+
+ <span class="keyword">public</span><span class="special">:</span> <span class="identifier">vector</span> <span class="special">(</span> <span class="identifier">size_type</span> <span class="identifier">count</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">T</span><span class="special">&amp;</span> <span class="identifier">val</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">Alloc</span><span class="special">&amp;</span> <span class="identifier">al</span> <span class="special">)</span>
+ <span class="special">:</span> <span class="identifier">vector_</span><span class="special">(</span><span class="identifier">count</span><span class="special">,</span> <span class="identifier">val</span><span class="special">,</span> <span class="identifier">al</span><span class="special">)</span>
+ <span class="identifier">postcondition</span> <span class="special">{</span>
+ <span class="identifier">size</span> <span class="special">==</span> <span class="identifier">count</span><span class="special">;</span>
+ <span class="identifier">all_equals</span><span class="special">(</span><span class="identifier">begin</span><span class="special">(),</span> <span class="identifier">end</span><span class="special">(),</span> <span class="identifier">val</span><span class="special">);</span>
+ <span class="identifier">al</span> <span class="special">==</span> <span class="identifier">get_allocator</span><span class="special">();</span>
+ <span class="special">}</span>
+ <span class="special">{}</span>
+
+
+ <span class="keyword">public</span><span class="special">:</span> <span class="identifier">vector</span> <span class="special">(</span> <span class="keyword">const</span> <span class="identifier">vector</span><span class="special">&amp;</span> <span class="identifier">right</span> <span class="special">)</span>
+ <span class="special">:</span> <span class="identifier">vector_</span><span class="special">(</span><span class="identifier">right</span><span class="special">)</span>
+ <span class="identifier">postcondition</span> <span class="special">{</span> <span class="identifier">right</span> <span class="special">==</span> <span class="special">*</span><span class="keyword">this</span><span class="special">;</span> <span class="special">}</span>
+ <span class="special">{}</span>
+
+
+ <span class="keyword">public</span><span class="special">:</span> <span class="keyword">template</span><span class="special">&lt;</span> <span class="keyword">class</span> <span class="identifier">InIt</span> <span class="special">&gt;</span> <span class="identifier">requires</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">InputIterator</span><span class="special">&lt;</span><span class="identifier">InIt</span><span class="special">&gt;</span>
+ <span class="identifier">vector</span> <span class="special">(</span> <span class="identifier">InIt</span> <span class="identifier">first</span><span class="special">,</span> <span class="identifier">InIt</span> <span class="identifier">last</span> <span class="special">)</span>
+ <span class="special">:</span> <span class="identifier">vector_</span><span class="special">(</span><span class="identifier">first</span><span class="special">,</span> <span class="identifier">last</span><span class="special">)</span>
+ <span class="identifier">postcondition</span> <span class="special">{</span> <span class="identifier">equal_distance</span><span class="special">(</span><span class="identifier">first</span><span class="special">,</span> <span class="identifier">last</span><span class="special">,</span> <span class="identifier">size</span><span class="special">());</span> <span class="special">}</span>
+ <span class="special">{}</span>
+
+
+ <span class="keyword">public</span><span class="special">:</span> <span class="keyword">template</span><span class="special">&lt;</span> <span class="keyword">class</span> <span class="identifier">InIt</span> <span class="special">&gt;</span> <span class="identifier">requires</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">InputIterator</span><span class="special">&lt;</span><span class="identifier">InIt</span><span class="special">&gt;</span>
+ <span class="identifier">vector</span> <span class="special">(</span> <span class="identifier">InIt</span> <span class="identifier">first</span><span class="special">,</span> <span class="identifier">InIt</span> <span class="identifier">last</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">Alloc</span><span class="special">&amp;</span> <span class="identifier">al</span> <span class="special">)</span>
+ <span class="special">:</span> <span class="identifier">vector_</span><span class="special">(</span><span class="identifier">first</span><span class="special">,</span> <span class="identifier">last</span><span class="special">,</span> <span class="identifier">al</span><span class="special">)</span>
+ <span class="identifier">postcondition</span> <span class="special">{</span>
+ <span class="identifier">equal_distance</span><span class="special">(</span><span class="identifier">first</span><span class="special">,</span> <span class="identifier">last</span><span class="special">,</span> <span class="identifier">size</span><span class="special">());</span>
+ <span class="identifier">al</span> <span class="special">==</span> <span class="identifier">get_allocator</span><span class="special">();</span>
+ <span class="special">}</span>
+ <span class="special">{}</span>
+
+
+ <span class="keyword">public</span><span class="special">:</span> <span class="special">~</span><span class="identifier">vector</span> <span class="special">(</span> <span class="keyword">void</span> <span class="special">)</span>
+ <span class="special">{}</span>
+
+
+ <span class="keyword">public</span><span class="special">:</span> <span class="keyword">void</span> <span class="identifier">reserve</span> <span class="special">(</span> <span class="identifier">size_type</span> <span class="identifier">count</span> <span class="special">)</span>
+ <span class="identifier">precondition</span> <span class="special">{</span> <span class="identifier">count</span> <span class="special">&lt;</span> <span class="identifier">max_size</span><span class="special">();</span> <span class="special">}</span>
+ <span class="identifier">postcondition</span> <span class="special">{</span> <span class="identifier">capacity</span><span class="special">()</span> <span class="special">&gt;=</span> <span class="identifier">count</span><span class="special">;</span> <span class="special">}</span>
+ <span class="special">{</span>
+ <span class="identifier">vector_</span><span class="special">.</span><span class="identifier">reverse</span><span class="special">(</span><span class="identifier">count</span><span class="special">);</span>
+ <span class="special">}</span>
+
+
+ <span class="keyword">public</span><span class="special">:</span> <span class="identifier">size_type</span> <span class="identifier">capacity</span> <span class="special">(</span> <span class="keyword">void</span> <span class="special">)</span> <span class="keyword">const</span>
+ <span class="identifier">postcondition</span><span class="special">(</span><span class="identifier">result</span><span class="special">)</span> <span class="special">{</span> <span class="identifier">result</span> <span class="special">&gt;=</span> <span class="identifier">size</span><span class="special">();</span> <span class="special">}</span>
+ <span class="special">{</span>
+ <span class="keyword">return</span> <span class="identifier">vector_</span><span class="special">.</span><span class="identifier">capacity</span><span class="special">();</span>
+ <span class="special">}</span>
+
+
+ <span class="keyword">public</span><span class="special">:</span> <span class="identifier">iterator</span> <span class="identifier">begin</span> <span class="special">(</span> <span class="keyword">void</span> <span class="special">)</span>
+ <span class="identifier">postcondition</span><span class="special">(</span><span class="identifier">result</span><span class="special">)</span> <span class="special">{</span>
+
+ <span class="keyword">if</span><span class="special">(</span><span class="identifier">empty</span><span class="special">())</span> <span class="special">{</span> <span class="identifier">result</span> <span class="special">==</span> <span class="identifier">end</span><span class="special">();</span> <span class="special">}</span>
+ <span class="special">}</span>
+ <span class="special">{</span>
+ <span class="keyword">return</span> <span class="identifier">vector_</span><span class="special">.</span><span class="identifier">begin</span><span class="special">();</span>
+ <span class="special">}</span>
+
+
+ <span class="keyword">public</span><span class="special">:</span> <span class="identifier">const_iterator</span> <span class="identifier">begin</span> <span class="special">(</span> <span class="keyword">void</span> <span class="special">)</span> <span class="keyword">const</span>
+ <span class="identifier">postcondition</span><span class="special">(</span><span class="identifier">result</span><span class="special">)</span> <span class="special">{</span>
+
+ <span class="keyword">if</span><span class="special">(</span><span class="identifier">empty</span><span class="special">())</span> <span class="special">{</span> <span class="identifier">result</span> <span class="special">==</span> <span class="identifier">end</span><span class="special">();</span> <span class="special">}</span>
+ <span class="special">}</span>
+ <span class="special">{</span>
+ <span class="keyword">return</span> <span class="identifier">vector_</span><span class="special">.</span><span class="identifier">begin</span><span class="special">();</span>
+ <span class="special">}</span>
+
+
+ <span class="keyword">public</span><span class="special">:</span> <span class="identifier">iterator</span> <span class="identifier">end</span> <span class="special">(</span> <span class="keyword">void</span> <span class="special">)</span>
+ <span class="special">{</span>
+ <span class="keyword">return</span> <span class="identifier">vector_</span><span class="special">.</span><span class="identifier">end</span><span class="special">();</span>
+ <span class="special">}</span>
+
+
+ <span class="keyword">public</span><span class="special">:</span> <span class="identifier">const_iterator</span> <span class="identifier">end</span> <span class="special">(</span> <span class="keyword">void</span> <span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
+ <span class="special">{</span>
+ <span class="keyword">return</span> <span class="identifier">vector_</span><span class="special">.</span><span class="identifier">end</span><span class="special">();</span>
+ <span class="special">}</span>
+
+
+ <span class="keyword">public</span><span class="special">:</span> <span class="identifier">reverse_iterator</span> <span class="identifier">rbegin</span> <span class="special">(</span> <span class="keyword">void</span> <span class="special">)</span>
+ <span class="identifier">postcondition</span><span class="special">(</span><span class="identifier">result</span><span class="special">)</span> <span class="special">{</span>
+
+ <span class="keyword">if</span><span class="special">(</span><span class="identifier">empty</span><span class="special">())</span> <span class="special">{</span> <span class="identifier">result</span> <span class="special">==</span> <span class="identifier">rend</span><span class="special">();</span> <span class="special">}</span>
+ <span class="special">}</span>
+ <span class="special">{</span>
+ <span class="keyword">return</span> <span class="identifier">vector_</span><span class="special">.</span><span class="identifier">rbegin</span><span class="special">();</span>
+ <span class="special">}</span>
+
+
+ <span class="keyword">public</span><span class="special">:</span> <span class="identifier">const_reverse_iterator</span> <span class="identifier">rbegin</span> <span class="special">(</span> <span class="keyword">void</span> <span class="special">)</span> <span class="keyword">const</span>
+ <span class="identifier">postcondition</span><span class="special">(</span><span class="identifier">result</span><span class="special">)</span> <span class="special">{</span>
+
+ <span class="keyword">if</span><span class="special">(</span><span class="identifier">empty</span><span class="special">())</span> <span class="special">{</span> <span class="identifier">result</span> <span class="special">==</span> <span class="identifier">rend</span><span class="special">();</span> <span class="special">}</span>
+ <span class="special">}</span>
+ <span class="special">{</span>
+ <span class="keyword">return</span> <span class="identifier">vector_</span><span class="special">.</span><span class="identifier">rbegin</span><span class="special">();</span>
+ <span class="special">}</span>
+
+
+ <span class="keyword">public</span><span class="special">:</span> <span class="identifier">reverse_iterator</span> <span class="identifier">rend</span> <span class="special">(</span> <span class="keyword">void</span> <span class="special">)</span>
+ <span class="special">{</span>
+ <span class="keyword">return</span> <span class="identifier">vector_</span><span class="special">.</span><span class="identifier">rend</span><span class="special">();</span>
+ <span class="special">}</span>
+
+
+ <span class="keyword">public</span><span class="special">:</span> <span class="identifier">const_reverse_iterator</span> <span class="identifier">rend</span> <span class="special">(</span> <span class="keyword">void</span> <span class="special">)</span> <span class="keyword">const</span>
+ <span class="special">{</span>
+ <span class="keyword">return</span> <span class="identifier">vector_</span><span class="special">.</span><span class="identifier">rend</span><span class="special">();</span>
+ <span class="special">}</span>
+
+
+ <span class="keyword">public</span><span class="special">:</span> <span class="keyword">void</span> <span class="identifier">resize</span> <span class="special">(</span> <span class="identifier">size_type</span> <span class="identifier">newsize</span> <span class="special">)</span>
+ <span class="identifier">postcondition</span> <span class="special">{</span>
+
+ <span class="identifier">size</span><span class="special">()</span> <span class="special">==</span> <span class="identifier">newsize</span><span class="special">;</span>
+ <span class="comment">// Version 1: with an if.</span>
+ <span class="keyword">if</span><span class="special">(</span><span class="identifier">newsize</span> <span class="special">&gt;</span> <span class="identifier">oldof</span> <span class="identifier">size</span><span class="special">())</span> <span class="special">{</span> <span class="comment">// Old values.</span>
+ <span class="identifier">all_equals</span><span class="special">(</span><span class="identifier">begin</span><span class="special">()</span> <span class="special">+</span> <span class="identifier">oldof</span> <span class="identifier">size</span><span class="special">(),</span> <span class="identifier">end</span><span class="special">(),</span> <span class="identifier">T</span><span class="special">());</span>
+ <span class="special">}</span> <span class="keyword">else</span> <span class="special">{</span>
+ <span class="keyword">true</span><span class="special">;</span> <span class="comment">// Dummy assertion to show the optional else branch.</span>
+ <span class="special">}</span>
+ <span class="special">}</span>
+ <span class="special">{</span>
+ <span class="identifier">vector_</span><span class="special">.</span><span class="identifier">resize</span><span class="special">(</span><span class="identifier">newsize</span><span class="special">);</span>
+ <span class="special">}</span>
+
+
+ <span class="keyword">public</span><span class="special">:</span> <span class="keyword">void</span> <span class="identifier">resize</span> <span class="special">(</span> <span class="identifier">size_type</span> <span class="identifier">newsize</span><span class="special">,</span> <span class="identifier">T</span> <span class="identifier">val</span> <span class="special">)</span>
+ <span class="identifier">postcondition</span> <span class="special">{</span>
+
+ <span class="identifier">size</span><span class="special">()</span> <span class="special">==</span> <span class="identifier">newsize</span><span class="special">;</span>
+ <span class="comment">// Version 2: with ternary operator `condition ? then : else`.</span>
+ <span class="identifier">newsize</span> <span class="special">&gt;</span> <span class="identifier">oldof</span> <span class="identifier">size</span><span class="special">()</span> <span class="special">?</span> <span class="comment">// then</span>
+ <span class="identifier">all_equals</span><span class="special">(</span><span class="identifier">begin</span><span class="special">()</span> <span class="special">+</span> <span class="identifier">oldof</span> <span class="identifier">size</span><span class="special">(),</span> <span class="identifier">end</span><span class="special">(),</span> <span class="identifier">val</span><span class="special">)</span> <span class="special">:</span> <span class="keyword">true</span><span class="special">;</span>
+ <span class="special">}</span>
+ <span class="special">{</span>
+ <span class="identifier">vector_</span><span class="special">.</span><span class="identifier">resize</span><span class="special">(</span><span class="identifier">newsize</span><span class="special">,</span> <span class="identifier">val</span><span class="special">);</span>
+ <span class="special">}</span>
+
+
+ <span class="keyword">public</span><span class="special">:</span> <span class="identifier">size_type</span> <span class="identifier">size</span> <span class="special">(</span> <span class="keyword">void</span> <span class="special">)</span> <span class="keyword">const</span>
+ <span class="identifier">postcondition</span><span class="special">(</span><span class="identifier">result</span><span class="special">)</span> <span class="special">{</span> <span class="identifier">result</span> <span class="special">&lt;=</span> <span class="identifier">capacity</span><span class="special">();</span> <span class="special">}</span>
+ <span class="special">{</span>
+ <span class="keyword">return</span> <span class="identifier">vector_</span><span class="special">.</span><span class="identifier">size</span><span class="special">();</span>
+ <span class="special">}</span>
+
+
+ <span class="keyword">public</span><span class="special">:</span> <span class="identifier">size_type</span> <span class="identifier">max_size</span> <span class="special">(</span> <span class="keyword">void</span> <span class="special">)</span> <span class="keyword">const</span>
+ <span class="identifier">postcondition</span><span class="special">(</span><span class="identifier">result</span><span class="special">)</span> <span class="special">{</span> <span class="identifier">result</span> <span class="special">&gt;=</span> <span class="identifier">capacity</span><span class="special">();</span> <span class="special">}</span>
+ <span class="special">{</span>
+ <span class="keyword">return</span> <span class="identifier">vactor_</span><span class="special">.</span><span class="identifier">max_size</span><span class="special">();</span>
+ <span class="special">}</span>
+
+
+ <span class="keyword">public</span><span class="special">:</span> <span class="keyword">bool</span> <span class="identifier">empty</span> <span class="special">(</span> <span class="keyword">void</span> <span class="special">)</span> <span class="keyword">const</span>
+ <span class="identifier">postcondition</span><span class="special">(</span> <span class="identifier">result</span> <span class="special">)</span> <span class="special">{</span> <span class="identifier">result</span> <span class="special">==</span> <span class="special">(</span><span class="identifier">size</span><span class="special">()</span> <span class="special">==</span> <span class="number">0</span><span class="special">);</span> <span class="special">}</span>
+ <span class="special">{</span>
+ <span class="keyword">return</span> <span class="identifier">vector_</span><span class="special">.</span><span class="identifier">empty</span><span class="special">();</span>
+ <span class="special">}</span>
+
+
+ <span class="keyword">public</span><span class="special">:</span> <span class="identifier">Alloc</span> <span class="identifier">get_allocator</span> <span class="special">(</span> <span class="keyword">void</span> <span class="special">)</span> <span class="keyword">const</span>
+ <span class="special">{</span>
+ <span class="keyword">return</span> <span class="identifier">vector_</span><span class="special">.</span><span class="identifier">get_allocator</span><span class="special">();</span>
+ <span class="special">}</span>
+
+
+ <span class="keyword">public</span><span class="special">:</span> <span class="identifier">reference</span> <span class="identifier">at</span> <span class="special">(</span> <span class="identifier">size_type</span> <span class="identifier">off</span> <span class="special">)</span>
+ <span class="identifier">precondition</span> <span class="special">{</span> <span class="identifier">off</span> <span class="special">&lt;</span> <span class="identifier">size</span><span class="special">();</span> <span class="special">}</span>
+ <span class="special">{</span>
+ <span class="keyword">return</span> <span class="identifier">vector_</span><span class="special">.</span><span class="identifier">at</span><span class="special">(</span><span class="identifier">off</span><span class="special">);</span>
+ <span class="special">}</span>
+
+
+ <span class="keyword">public</span><span class="special">:</span> <span class="identifier">const_reference</span> <span class="identifier">at</span> <span class="special">(</span> <span class="identifier">size_type</span> <span class="identifier">off</span> <span class="special">)</span> <span class="keyword">const</span>
+ <span class="identifier">precondition</span> <span class="special">{</span> <span class="identifier">off</span> <span class="special">&lt;</span> <span class="identifier">size</span><span class="special">();</span> <span class="special">}</span>
+ <span class="special">{</span>
+ <span class="keyword">return</span> <span class="identifier">vector_</span><span class="special">.</span><span class="identifier">at</span><span class="special">(</span><span class="identifier">off</span><span class="special">);</span>
+ <span class="special">}</span>
+
+
+ <span class="keyword">public</span><span class="special">:</span> <span class="identifier">reference</span> <span class="keyword">operator</span><span class="special">[]</span> <span class="special">(</span> <span class="identifier">size_type</span> <span class="identifier">off</span> <span class="special">)</span>
+ <span class="identifier">precondition</span> <span class="special">{</span> <span class="identifier">off</span> <span class="special">&lt;</span> <span class="identifier">size</span><span class="special">();</span> <span class="special">}</span>
+ <span class="special">{</span>
+ <span class="keyword">return</span> <span class="identifier">vector_</span><span class="special">[</span><span class="identifier">off</span><span class="special">];</span>
+ <span class="special">}</span>
+
+
+ <span class="keyword">public</span><span class="special">:</span> <span class="identifier">const_reference</span> <span class="keyword">operator</span><span class="special">[]</span> <span class="special">(</span> <span class="identifier">size_type</span> <span class="identifier">off</span> <span class="special">)</span> <span class="keyword">const</span>
+ <span class="identifier">precondition</span> <span class="special">{</span> <span class="identifier">off</span> <span class="special">&lt;</span> <span class="identifier">size</span><span class="special">();</span> <span class="special">}</span>
+ <span class="special">{</span>
+ <span class="keyword">return</span> <span class="identifier">vector_</span><span class="special">[</span><span class="identifier">off</span><span class="special">];</span>
+ <span class="special">}</span>
+
+
+ <span class="keyword">public</span><span class="special">:</span> <span class="identifier">reference</span> <span class="identifier">front</span> <span class="special">(</span> <span class="keyword">void</span> <span class="special">)</span>
+ <span class="identifier">recondition</span> <span class="special">{</span> <span class="keyword">bool</span><span class="special">(!</span><span class="identifier">empty</span><span class="special">());</span> <span class="special">}</span>
+ <span class="special">{</span>
+ <span class="keyword">return</span> <span class="identifier">vector_</span><span class="special">.</span><span class="identifier">front</span><span class="special">();</span>
+ <span class="special">}</span>
+
+
+ <span class="keyword">public</span><span class="special">:</span> <span class="identifier">const_reference</span> <span class="identifier">front</span> <span class="special">(</span> <span class="keyword">void</span> <span class="special">)</span> <span class="keyword">const</span>
+ <span class="identifier">precondition</span> <span class="special">{</span> <span class="identifier">empty</span><span class="special">()</span> <span class="special">==</span> <span class="keyword">false</span><span class="special">;</span> <span class="special">}</span>
+ <span class="special">{</span>
+ <span class="keyword">return</span> <span class="identifier">vector_</span><span class="special">.</span><span class="identifier">front</span><span class="special">();</span>
+ <span class="special">}</span>
+
+
+ <span class="keyword">public</span><span class="special">:</span> <span class="identifier">reference</span> <span class="identifier">back</span> <span class="special">(</span> <span class="keyword">void</span> <span class="special">)</span>
+ <span class="identifier">precondition</span> <span class="special">{</span> <span class="special">!</span><span class="identifier">empty</span><span class="special">();</span> <span class="special">}</span>
+ <span class="special">{</span>
+ <span class="keyword">return</span> <span class="identifier">vector_</span><span class="special">.</span><span class="identifier">back</span><span class="special">();</span>
+ <span class="special">}</span>
+
+
+ <span class="keyword">public</span><span class="special">:</span> <span class="identifier">const_reference</span> <span class="identifier">back</span> <span class="special">(</span> <span class="keyword">void</span> <span class="special">)</span> <span class="keyword">const</span>
+ <span class="identifier">precondition</span> <span class="special">{</span> <span class="identifier">empty</span><span class="special">()</span> <span class="special">==</span> <span class="keyword">false</span><span class="special">;</span> <span class="special">}</span>
+ <span class="special">{</span>
+ <span class="keyword">return</span> <span class="identifier">vector_</span><span class="special">.</span><span class="identifier">back</span><span class="special">();</span>
+ <span class="special">}</span>
+
+
+ <span class="keyword">public</span><span class="special">:</span> <span class="keyword">void</span> <span class="identifier">push_back</span> <span class="special">(</span> <span class="keyword">const</span> <span class="identifier">T</span><span class="special">&amp;</span> <span class="identifier">val</span> <span class="special">)</span>
+ <span class="identifier">precondition</span> <span class="special">{</span> <span class="identifier">size</span><span class="special">()</span> <span class="special">&lt;</span> <span class="identifier">max_size</span><span class="special">();</span> <span class="special">}</span>
+ <span class="identifier">postcondition</span> <span class="special">{</span>
+
+
+ <span class="identifier">back</span><span class="special">()</span> <span class="special">==</span> <span class="identifier">val</span><span class="special">;</span>
+ <span class="identifier">size</span><span class="special">()</span> <span class="special">==</span> <span class="identifier">oldof</span> <span class="identifier">size</span><span class="special">()</span> <span class="special">+</span> <span class="number">1</span><span class="special">;</span>
+ <span class="identifier">capacity</span><span class="special">()</span> <span class="special">&gt;=</span> <span class="identifier">oldof</span> <span class="identifier">capacity</span><span class="special">();</span>
+ <span class="special">}</span>
+ <span class="special">{</span>
+ <span class="identifier">vector_</span><span class="special">.</span><span class="identifier">push_back</span><span class="special">(</span><span class="identifier">val</span><span class="special">);</span>
+ <span class="special">}</span>
+
+
+ <span class="identifier">pubilc</span><span class="special">:</span> <span class="keyword">void</span> <span class="identifier">pop_back</span> <span class="special">(</span> <span class="keyword">void</span> <span class="special">)</span>
+ <span class="identifier">precondition</span> <span class="special">{</span> <span class="identifier">empty</span><span class="special">()</span> <span class="special">==</span> <span class="keyword">false</span><span class="special">;</span> <span class="special">}</span>
+ <span class="identifier">postcondition</span> <span class="special">{</span>
+
+ <span class="identifier">size</span><span class="special">()</span> <span class="special">==</span> <span class="identifier">oldof</span> <span class="identifier">size</span><span class="special">()</span> <span class="special">-</span> <span class="number">1</span><span class="special">;</span>
+ <span class="special">}</span>
+ <span class="special">{</span>
+ <span class="identifier">vector_</span><span class="special">.</span><span class="identifier">pop_back</span><span class="special">();</span>
+ <span class="special">}</span>
+
+
+ <span class="identifier">pubilc</span><span class="special">:</span> <span class="keyword">template</span><span class="special">&lt;</span> <span class="keyword">class</span> <span class="identifier">InIt</span> <span class="special">&gt;</span> <span class="identifier">requires</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">InputIterator</span><span class="special">&lt;</span><span class="identifier">InIt</span><span class="special">&gt;</span>
+ <span class="keyword">void</span> <span class="identifier">assign</span> <span class="special">(</span> <span class="identifier">InIt</span> <span class="identifier">first</span><span class="special">,</span> <span class="identifier">InIt</span> <span class="identifier">last</span> <span class="special">)</span>
+ <span class="comment">/** @pre [first, last) not sub-range of [begin(), end()). */</span>
+ <span class="identifier">postcondition</span> <span class="special">{</span> <span class="identifier">equal_distance</span><span class="special">(</span><span class="identifier">first</span><span class="special">,</span> <span class="identifier">last</span><span class="special">,</span> <span class="identifier">size</span><span class="special">());</span> <span class="special">}</span>
+ <span class="special">{</span>
+ <span class="identifier">vector_</span><span class="special">.</span><span class="identifier">assign</span><span class="special">(</span><span class="identifier">first</span><span class="special">,</span> <span class="identifier">last</span><span class="special">);</span>
+ <span class="special">}</span>
+
+
+ <span class="keyword">public</span><span class="special">:</span> <span class="keyword">void</span> <span class="identifier">assign</span> <span class="special">(</span> <span class="identifier">size_type</span> <span class="identifier">count</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">T</span><span class="special">&amp;</span> <span class="identifier">val</span> <span class="special">)</span>
+ <span class="identifier">precondition</span> <span class="special">{</span> <span class="identifier">count</span> <span class="special">&lt;=</span> <span class="identifier">max_size</span><span class="special">();</span> <span class="special">}</span>
+ <span class="identifier">postcondition</span> <span class="special">{</span> <span class="identifier">all_equals</span><span class="special">(</span><span class="identifier">begin</span><span class="special">(),</span> <span class="identifier">end</span><span class="special">(),</span> <span class="identifier">val</span><span class="special">);</span> <span class="special">}</span>
+ <span class="special">{</span>
+ <span class="identifier">assign</span><span class="special">(</span><span class="identifier">count</span><span class="special">,</span> <span class="identifier">val</span><span class="special">);</span>
+ <span class="special">}</span>
+
+
+ <span class="keyword">public</span><span class="special">:</span> <span class="identifier">iterator</span> <span class="identifier">insert</span> <span class="special">(</span> <span class="identifier">iterator</span> <span class="identifier">where</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">T</span><span class="special">&amp;</span> <span class="identifier">val</span> <span class="special">)</span>
+ <span class="identifier">precondition</span> <span class="special">{</span> <span class="identifier">size</span><span class="special">()</span> <span class="special">&lt;</span> <span class="identifier">max_size</span><span class="special">();</span> <span class="special">}</span>
+ <span class="identifier">postcondition</span><span class="special">(</span><span class="identifier">result</span><span class="special">)</span> <span class="special">{</span>
+
+
+
+ <span class="identifier">val</span> <span class="special">==</span> <span class="special">*</span><span class="identifier">result</span><span class="special">;</span>
+ <span class="identifier">size</span><span class="special">()</span> <span class="special">==</span> <span class="identifier">oldof</span> <span class="identifier">size</span><span class="special">()</span> <span class="special">+</span> <span class="number">1</span><span class="special">;</span>
+ <span class="identifier">capacity</span><span class="special">()</span> <span class="special">&gt;=</span> <span class="identifier">oldof</span> <span class="identifier">capacity</span><span class="special">();</span>
+ <span class="comment">/** @post
+ * if capacity() &gt; oldof capacity():
+ * all iterators invalidated
+ * else:
+ * all iterators in [pos, end()) invalidated
+ */</span>
+ <span class="special">}</span>
+ <span class="special">{</span>
+ <span class="keyword">return</span> <span class="identifier">vector_</span><span class="special">.</span><span class="identifier">insert</span><span class="special">(</span><span class="identifier">pos</span><span class="special">,</span> <span class="identifier">val</span><span class="special">);</span>
+ <span class="special">}</span>
+
+
+ <span class="keyword">public</span><span class="special">:</span> <span class="keyword">void</span> <span class="identifier">insert</span> <span class="special">(</span> <span class="identifier">iterator</span> <span class="identifier">pos</span><span class="special">,</span> <span class="identifier">size_type</span> <span class="identifier">count</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">T</span><span class="special">&amp;</span> <span class="identifier">val</span> <span class="special">)</span>
+ <span class="identifier">precondition</span> <span class="special">{</span> <span class="identifier">size</span><span class="special">()</span> <span class="special">+</span> <span class="identifier">count</span> <span class="special">&lt;=</span> <span class="identifier">max_size</span><span class="special">();</span> <span class="special">}</span>
+ <span class="identifier">postcondition</span> <span class="special">{</span>
+
+
+
+ <span class="identifier">size</span><span class="special">()</span> <span class="special">==</span> <span class="identifier">oldof</span> <span class="identifier">size</span><span class="special">()</span> <span class="special">+</span> <span class="identifier">count</span><span class="special">;</span>
+ <span class="identifier">capacity</span><span class="special">()</span> <span class="special">&gt;=</span> <span class="identifier">oldof</span> <span class="identifier">capacity</span><span class="special">();</span>
+ <span class="keyword">if</span><span class="special">(</span><span class="identifier">capacity</span><span class="special">()</span> <span class="special">==</span> <span class="identifier">oldof</span> <span class="identifier">capacity</span><span class="special">())</span> <span class="special">{</span>
+ <span class="identifier">all_equals</span><span class="special">(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">prior</span><span class="special">(</span><span class="identifier">oldof</span> <span class="identifier">pos</span><span class="special">),</span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">prior</span><span class="special">(</span><span class="identifier">oldof</span> <span class="identifier">pos</span><span class="special">)</span> <span class="special">+</span> <span class="identifier">count</span><span class="special">,</span> <span class="identifier">val</span><span class="special">);</span>
+ <span class="comment">/** @post All iterators in [pos, end()) invalidated. */</span>
+ <span class="special">}</span>
+ <span class="comment">/** @post Else, all iterators invalidated. */</span>
+ <span class="special">}</span>
+ <span class="special">{</span>
+ <span class="identifier">vector_</span><span class="special">.</span><span class="identifier">insert</span><span class="special">(</span><span class="identifier">pos</span><span class="special">,</span> <span class="identifier">count</span><span class="special">,</span> <span class="identifier">val</span><span class="special">);</span>
+ <span class="special">}</span>
+
+
+ <span class="keyword">public</span><span class="special">:</span> <span class="keyword">template</span><span class="special">&lt;</span> <span class="keyword">class</span> <span class="identifier">InIt</span> <span class="special">&gt;</span> <span class="identifier">requires</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">InputIterator</span><span class="special">&lt;</span><span class="identifier">InIt</span><span class="special">&gt;</span>
+ <span class="keyword">void</span> <span class="identifier">insert</span> <span class="special">(</span> <span class="identifier">iterator</span> <span class="identifier">where</span><span class="special">,</span> <span class="identifier">InIt</span> <span class="identifier">first</span><span class="special">,</span> <span class="identifier">InIt</span> <span class="identifier">last</span> <span class="special">)</span>
+ <span class="identifier">precondition</span> <span class="special">{</span>
+ <span class="comment">/** @pre [first, last) not a sub-range of [begin(), end()). */</span>
+ <span class="identifier">max_size</span><span class="special">()</span> <span class="special">&gt;=</span> <span class="special">(</span><span class="identifier">size</span><span class="special">()</span> <span class="special">+</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">distance</span><span class="special">(</span><span class="identifier">first</span><span class="special">,</span> <span class="identifier">last</span><span class="special">));</span>
+ <span class="special">}</span>
+ <span class="identifier">postcondition</span> <span class="special">{</span>
+
+
+ <span class="identifier">size</span><span class="special">()</span> <span class="special">==</span> <span class="identifier">oldof</span> <span class="identifier">size</span><span class="special">()</span> <span class="special">+</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">distance</span><span class="special">(</span><span class="identifier">first</span><span class="special">,</span> <span class="identifier">last</span><span class="special">);</span>
+ <span class="identifier">capacity</span><span class="special">()</span> <span class="special">&gt;=</span> <span class="identifier">oldof</span> <span class="identifier">capacity</span><span class="special">();</span>
+ <span class="special">}</span>
+ <span class="special">{</span>
+ <span class="keyword">return</span> <span class="identifier">vector_</span><span class="special">.</span><span class="identifier">insert</span><span class="special">(</span><span class="identifier">pos</span><span class="special">,</span> <span class="identifier">first</span><span class="special">,</span> <span class="identifier">last</span><span class="special">);</span>
+ <span class="special">}</span>
+
+
+ <span class="keyword">public</span><span class="special">:</span> <span class="identifier">iterator</span> <span class="identifier">erase</span> <span class="special">(</span> <span class="identifier">iterator</span> <span class="identifier">pos</span> <span class="special">)</span>
+ <span class="identifier">precondition</span> <span class="special">{</span>
+ <span class="identifier">empty</span><span class="special">()</span> <span class="special">==</span> <span class="keyword">false</span><span class="special">;</span>
+ <span class="identifier">pos</span> <span class="special">!=</span> <span class="identifier">end</span><span class="special">();</span>
+ <span class="special">}</span>
+ <span class="identifier">postcondition</span><span class="special">(</span><span class="identifier">result</span><span class="special">)</span> <span class="special">{</span>
+
+
+ <span class="identifier">size</span><span class="special">()</span> <span class="special">==</span> <span class="identifier">oldof</span> <span class="identifier">size</span><span class="special">()</span> <span class="special">-</span> <span class="number">1</span><span class="special">;</span>
+ <span class="keyword">if</span><span class="special">(</span><span class="identifier">empty</span><span class="special">())</span> <span class="special">{</span> <span class="identifier">result</span> <span class="special">==</span> <span class="identifier">end</span><span class="special">();</span> <span class="special">}</span>
+ <span class="comment">/** @post Iterators in [pos, end()) invalidated. */</span>
+ <span class="special">}</span>
+ <span class="special">{</span>
+ <span class="keyword">return</span> <span class="identifier">vector_</span><span class="special">.</span><span class="identifier">erase</span><span class="special">(</span><span class="identifier">pos</span><span class="special">);</span>
+ <span class="special">}</span>
+
+
+ <span class="keyword">public</span><span class="special">:</span> <span class="identifier">iterator</span> <span class="identifier">erase</span> <span class="special">(</span> <span class="identifier">iterator</span> <span class="identifier">first</span><span class="special">,</span> <span class="identifier">iterator</span> <span class="identifier">last</span> <span class="special">)</span>
+ <span class="identifier">precondition</span> <span class="special">{</span> <span class="identifier">size</span><span class="special">()</span> <span class="special">&gt;=</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">distance</span><span class="special">(</span><span class="identifier">first</span><span class="special">,</span> <span class="identifier">last</span><span class="special">);</span> <span class="special">}</span>
+ <span class="identifier">postcondition</span><span class="special">(</span><span class="identifier">result</span><span class="special">)</span> <span class="special">{</span>
+
+
+ <span class="identifier">size</span><span class="special">()</span> <span class="special">==</span> <span class="identifier">oldof</span> <span class="identifier">size</span><span class="special">()</span> <span class="special">-</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">distance</span><span class="special">(</span> <span class="identifier">first</span><span class="special">,</span> <span class="identifier">last</span> <span class="special">);</span>
+ <span class="keyword">if</span><span class="special">(</span><span class="identifier">empty</span><span class="special">())</span> <span class="special">{</span> <span class="identifier">result</span> <span class="special">==</span> <span class="identifier">end</span><span class="special">();</span> <span class="special">}</span>
+ <span class="comment">/** @post Iterators in [first, end()) invalidated. */</span>
+ <span class="special">}</span>
+ <span class="special">{</span>
+ <span class="keyword">return</span> <span class="identifier">vector_</span><span class="special">.</span><span class="identifier">erase</span><span class="special">(</span><span class="identifier">first</span><span class="special">,</span> <span class="identifier">last</span><span class="special">);</span>
+ <span class="special">}</span>
+
+
+ <span class="keyword">public</span><span class="special">:</span> <span class="keyword">void</span> <span class="identifier">clear</span> <span class="special">(</span> <span class="keyword">void</span> <span class="special">)</span>
+ <span class="identifier">postcondition</span> <span class="special">{</span> <span class="identifier">empty</span><span class="special">();</span> <span class="special">}</span>
+ <span class="special">{</span>
+ <span class="identifier">vector_</span><span class="special">.</span><span class="identifier">clear</span><span class="special">();</span>
+ <span class="special">}</span>
+
+
+ <span class="keyword">public</span><span class="special">:</span> <span class="keyword">void</span> <span class="identifier">swap</span> <span class="special">(</span> <span class="identifier">vector</span><span class="special">&amp;</span> <span class="identifier">right</span> <span class="special">)</span>
+ <span class="identifier">postcondition</span> <span class="special">{</span>
+
+
+ <span class="identifier">right</span> <span class="special">==</span> <span class="identifier">oldof</span> <span class="special">*</span><span class="keyword">this</span><span class="special">;</span>
+ <span class="identifier">oldof</span> <span class="identifier">right</span> <span class="special">==</span> <span class="special">*</span><span class="keyword">this</span><span class="special">;</span>
+ <span class="special">}</span>
+ <span class="special">{</span>
+ <span class="keyword">return</span> <span class="identifier">vector_</span><span class="special">.</span><span class="identifier">swap</span><span class="special">(</span><span class="identifier">right</span><span class="special">);</span>
+ <span class="special">}</span>
+
+
+ <span class="keyword">public</span><span class="special">:</span> <span class="keyword">bool</span> <span class="keyword">operator</span><span class="special">==</span> <span class="special">(</span> <span class="keyword">const</span> <span class="identifier">vector</span><span class="special">&amp;</span> <span class="identifier">right</span> <span class="special">)</span> <span class="keyword">const</span>
+ <span class="identifier">postcondition</span><span class="special">(</span><span class="identifier">result</span><span class="special">)</span> <span class="special">{</span>
+
+ <span class="identifier">result</span> <span class="special">==</span> <span class="identifier">all_equals</span><span class="special">(</span><span class="identifier">begin</span><span class="special">(),</span> <span class="identifier">end</span><span class="special">(),</span> <span class="identifier">right</span><span class="special">.</span><span class="identifier">begin</span><span class="special">(),</span> <span class="identifier">right</span><span class="special">.</span><span class="identifier">end</span><span class="special">());</span>
+ <span class="special">}</span>
+ <span class="special">{</span>
+ <span class="keyword">return</span> <span class="identifier">vector_</span> <span class="special">==</span> <span class="identifier">right</span><span class="special">.</span><span class="identifier">vector_</span><span class="special">;</span>
+ <span class="special">}</span>
+
+<span class="keyword">private</span><span class="special">:</span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">vector</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">,</span> <span class="identifier">Alloc</span><span class="special">&gt;</span> <span class="identifier">vector_</span><span class="special">;</span>
+<span class="special">};</span>
+</pre>
+<p>
+ </p>
+ </td>
+</tr></tbody>
+</table></div>
+<div class="informaltable"><table class="table">
+<colgroup>
+<col>
+<col>
+<col>
+<col>
+</colgroup>
+<thead><tr>
+<th>
+ <p>
+ Source
+ </p>
+ </th>
+<th>
+ <p>
+ Name
+ </p>
+ </th>
+<th>
+ <p>
+ Purpose
+ </p>
+ </th>
+<th>
+ <p>
+ Files
+ </p>
+ </th>
+</tr></thead>
+<tbody>
+<tr>
+<td>
+ <p>
+ <a class="link" href="bibliography.html" title="Bibliography">[Crowl2006]</a>
+ </p>
+ </td>
+<td>
+ <p>
+ STL Vector
+ </p>
+ </td>
+<td>
+ <p>
+ <span class="bold"><strong>Complete contracts</strong></span> for STL vector.
+ </p>
+ </td>
+<td>
+ <p>
+ main.cpp
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ <a class="link" href="bibliography.html" title="Bibliography">[Crowl2006]</a>
+ </p>
+ </td>
+<td>
+ <p>
+ Block
+ </p>
+ </td>
+<td>
+ <p>
+ Block invariants.
+ </p>
+ </td>
+<td>
+ <p>
+ main.cpp
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ <a class="link" href="bibliography.html" title="Bibliography">[Crowl2006]</a>
+ </p>
+ </td>
+<td>
+ <p>
+ Circle
+ </p>
+ </td>
+<td>
+ <p>
+ Subcontracting.
+ </p>
+ </td>
+<td>
+ <p>
+ main.cpp
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ <a class="link" href="bibliography.html" title="Bibliography">[Crowl2006]</a>
+ </p>
+ </td>
+<td>
+ <p>
+ Factorial
+ </p>
+ </td>
+<td>
+ <p>
+ Contracts with recursion.
+ </p>
+ </td>
+<td>
+ <p>
+ main.cpp
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ <a class="link" href="bibliography.html" title="Bibliography">[Crowl2006]</a>
+ </p>
+ </td>
+<td>
+ <p>
+ Operator Equal
+ </p>
+ </td>
+<td>
+ <p>
+ Contracts for operators.
+ </p>
+ </td>
+<td>
+ <p>
+ main.cpp
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ <a class="link" href="bibliography.html" title="Bibliography">[Crowl2006]</a>
+ </p>
+ </td>
+<td>
+ <p>
+ Square Root
+ </p>
+ </td>
+<td>
+ <p>
+ Contracts for non-member functions.
+ </p>
+ </td>
+<td>
+ <p>
+ main.cpp
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ <a class="link" href="bibliography.html" title="Bibliography">[Crowl2006]</a>
+ </p>
+ </td>
+<td>
+ <p>
+ Sum
+ </p>
+ </td>
+<td>
+ <p>
+ Contracts for non-member functions (with separated definition).
+ </p>
+ </td>
+<td>
+ <p>
+ sum.hpp sum.cpp main.cpp
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ <a class="link" href="bibliography.html" title="Bibliography">[Mitchell2002]</a>
+ </p>
+ </td>
+<td>
+ <p>
+ Name List
+ </p>
+ </td>
+<td>
+ <p>
+ Relax base class preconditions using <span class="bold"><strong>subcontracting</strong></span>.
+ </p>
+ </td>
+<td>
+ <p>
+ names.hpp
+ names.cpp
+ main.cpp
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ <a class="link" href="bibliography.html" title="Bibliography">[Mitchell2002]</a>
+ </p>
+ </td>
+<td>
+ <p>
+ Courier
+ </p>
+ </td>
+<td>
+ <p>
+ Relax base class preconditions using subcontracting.
+ </p>
+ </td>
+<td>
+ <p>
+ couriers.hpp
+ couriers.cpp
+ main.cpp
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ <a class="link" href="bibliography.html" title="Bibliography">[Mitchell2002]</a>
+ </p>
+ </td>
+<td>
+ <p>
+ Dictionary
+ </p>
+ </td>
+<td>
+ <p>
+ Contracts for a dictionary (map-like) data-type.
+ </p>
+ </td>
+<td>
+ <p>
+ dictionary.hpp
+ main.cpp
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ <a class="link" href="bibliography.html" title="Bibliography">[Mitchell2002]</a>
+ </p>
+ </td>
+<td>
+ <p>
+ Stack
+ </p>
+ </td>
+<td>
+ <p>
+ Contracts for a stack.
+ </p>
+ </td>
+<td>
+ <p>
+ stack.hpp
+ main.cpp
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ <a class="link" href="bibliography.html" title="Bibliography">[Mitchell2002]</a>
+ </p>
+ </td>
+<td>
+ <p>
+ Simple Queue
+ </p>
+ </td>
+<td>
+ <p>
+ Contracts for a queue.
+ </p>
+ </td>
+<td>
+ <p>
+ simple_queue.hpp
+ main.cpp
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ <a class="link" href="bibliography.html" title="Bibliography">[Mitchell2002]</a>
+ </p>
+ </td>
+<td>
+ <p>
+ Customer Manager
+ </p>
+ </td>
+<td>
+ <p>
+ Contracts for a class manging customers.
+ </p>
+ </td>
+<td>
+ <p>
+ customer_manager.hpp
+ customer_manager.cpp
+ main.cpp
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ <a class="link" href="bibliography.html" title="Bibliography">[Mitchell2002]</a>
+ </p>
+ </td>
+<td>
+ <p>
+ Observe
+ </p>
+ </td>
+<td>
+ <p>
+ Contracts for the observer design pattern.
+ </p>
+ </td>
+<td>
+ <p>
+ observe.hpp
+ main.cpp
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ <a class="link" href="bibliography.html" title="Bibliography">[Mitchell2002]</a>
+ </p>
+ </td>
+<td>
+ <p>
+ Counter
+ </p>
+ </td>
+<td>
+ <p>
+ <span class="bold"><strong>Relaxe the accessible copy constructor requirement</strong></span>
+ for old <code class="computeroutput"><span class="identifier">decrement_button</span></code>
+ objects in postconditions.
+ </p>
+ </td>
+<td>
+ <p>
+ counter.hpp
+ view_of_counter.hpp
+ push_button.hpp
+ decrement_button.hpp
+ main.cpp
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ <a class="link" href="bibliography.html" title="Bibliography">[Meyer1997]</a>
+ </p>
+ </td>
+<td>
+ <p>
+ Stack3
+ </p>
+ </td>
+<td>
+ <p>
+ Contracts for functions returning <span class="bold"><strong>error codes</strong></span>.
+ </p>
+ </td>
+<td>
+ <p>
+ stack3.hpp
+ main.cpp
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ <a class="link" href="bibliography.html" title="Bibliography">[Meyer1997]</a>
+ </p>
+ </td>
+<td>
+ <p>
+ Stack4
+ </p>
+ </td>
+<td>
+ <p>
+ Contracts for stack.
+ </p>
+ </td>
+<td>
+ <p>
+ stack4.hpp
+ main.cpp
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ <a class="link" href="bibliography.html" title="Bibliography">[Meyer1997]</a>
+ </p>
+ </td>
+<td>
+ <p>
+ Greatest Common Divisor
+ </p>
+ </td>
+<td>
+ <p>
+ <span class="bold"><strong>Block invariants and loop variants.</strong></span>
+ </p>
+ </td>
+<td>
+ <p>
+ main.cpp
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ <a class="link" href="bibliography.html" title="Bibliography">[Meyer1997]</a>
+ </p>
+ </td>
+<td>
+ <p>
+ Max Array
+ </p>
+ </td>
+<td>
+ <p>
+ Block invariants and loop variants.
+ </p>
+ </td>
+<td>
+ <p>
+ main.cpp
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ <a class="link" href="bibliography.html" title="Bibliography">[Stroustrup1997]</a>
+ </p>
+ </td>
+<td>
+ <p>
+ String
+ </p>
+ </td>
+<td>
+ <p>
+ Precondition and invariants (no postconditions).
+ </p>
+ </td>
+<td>
+ <p>
+ string.hpp
+ string.cpp
+ main.cpp
+ </p>
+ </td>
+</tr>
+</tbody>
+</table></div>
+</div>
+<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
+<td align="left"></td>
+<td align="right"><div class="copyright-footer">Copyright &#169; 2009, 2010 Lorenzo Caminiti<p>
+ Distributed under the Contract++ Software License, Version 1.0 (see accompanying
+ file LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="without_the_macros.html"><img src="../images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../images/home.png" alt="Home"></a><a accesskey="n" href="throw_on_failure.html"><img src="../images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>

Added: sandbox/contract/libs/contract/doc/html/contract__/getting_started.html
==============================================================================
--- (empty file)
+++ sandbox/contract/libs/contract/doc/html/contract__/getting_started.html 2011-06-28 20:54:41 EDT (Tue, 28 Jun 2011)
@@ -0,0 +1,225 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
+<title>Getting Started</title>
+<link rel="stylesheet" href="../doc/html/boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
+<link rel="home" href="../index.html" title="Contract++ 0.3.490">
+<link rel="up" href="../index.html" title="Contract++ 0.3.490">
+<link rel="prev" href="../index.html" title="Contract++ 0.3.490">
+<link rel="next" href="tutorial.html" title="Tutorial">
+</head>
+<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
+<table cellpadding="2" width="100%"><tr><td valign="top"></td></tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="../index.html"><img src="../images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../images/home.png" alt="Home"></a><a accesskey="n" href="tutorial.html"><img src="../images/next.png" alt="Next"></a>
+</div>
+<div class="section">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="contract__.getting_started"></a><a class="link" href="getting_started.html" title="Getting Started">Getting Started</a>
+</h2></div></div></div>
+<div class="toc"><dl>
+<dt><span class="section">Installation</span></dt>
+<dt><span class="section">Header Files</span></dt>
+<dt><span class="section"><a href="getting_started.html#contract__.getting_started.control_contract_compilation">Control
+ Contract Compilation</a></span></dt>
+<dt><span class="section"><a href="getting_started.html#contract__.getting_started.names_and_symbols">Names and
+ Symbols</a></span></dt>
+<dt><span class="section"><a href="getting_started.html#contract__.getting_started.compile_time_configuration">Compile-Time
+ Configuration</a></span></dt>
+</dl></div>
+<p>
+ This section illustrates how to setup your system to use this library.
+ </p>
+<div class="section">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="contract__.getting_started.installation"></a><a class="link" href="getting_started.html#contract__.getting_started.installation" title="Installation">Installation</a>
+</h3></div></div></div>
+<p>
+ This library requires the Boost.MPL
+ and Boost.Preprocessor
+ libraries. The Boost library is
+ a collection of highly portable C++ libraries. You should be able to download,
+ compile, and install Boost for
+ your operating system from the Boost
+ website. Precompiled Boost installation
+ packages are also available for most common operating systems and they might
+ already be installed on your system.
+ </p>
+<p>
+ This library is composed of header files only. Therefore there are no library
+ precompiled object files which need to be installed. Just instruct your C++
+ compiler where to find the library header files (e.g., using the '-I' option
+ for GCC or '/I' for MSVC). For example, if you have uncompressed the library
+ files in a directory named <code class="computeroutput"><span class="string">"$HOME/libs/contractpp/"</span></code>
+ then you can compile with GCC using:
+ </p>
+<pre class="programlisting">$ g++ -I$HOME/libs/contractpp/src/ ...
+</pre>
+<p>
+ Note that the path of the library source files (contained in the <code class="computeroutput"><span class="string">"src/"</span></code> subdirectory) is specified.
+ </p>
+</div>
+<div class="section">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="contract__.getting_started.header_files"></a><a class="link" href="getting_started.html#contract__.getting_started.header_files" title="Header Files">Header Files</a>
+</h3></div></div></div>
+<p>
+ The library headers are simply included in your C++ source code as follow:
+ </p>
+<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">contract</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span>
+</pre>
+<p>
+ In general, there is no need to include the header files from the <code class="literal">"contract/"</code>
+ directory separately and the one include above is enough. In this documentation,
+ the <code class="computeroutput"><span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">contract</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span></code>
+ will occasionally be assumed and omitted from the example code.
+ </p>
+</div>
+<div class="section">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="contract__.getting_started.control_contract_compilation"></a><a class="link" href="getting_started.html#contract__.getting_started.control_contract_compilation" title="Control Contract Compilation">Control
+ Contract Compilation</a>
+</h3></div></div></div>
+<p>
+ This library provides the following macro symbols to selectively turn on
+ or off contract compilation and run-time checking:
+ </p>
+<div class="itemizedlist"><ul class="itemizedlist" type="disc">
+<li class="listitem">
+ <span class="bold"><strong>Block invariants</strong></span> and <span class="bold"><strong>loop
+ variants</strong></span> are compiled and checked only if the <code class="computeroutput">CONTRACT_CHECK_BLOCK_INVARIANT</code>
+ is #defined. By default, this macro symbol is <span class="emphasis"><em>not</em></span>
+ #defined.
+ </li>
+<li class="listitem">
+ <span class="bold"><strong>Class invariants</strong></span> are compiled and checked
+ only if the <code class="computeroutput">CONTRACT_CHECK_CLASS_INVARIANT</code>
+ is #defined. By default, this macro symbol is <span class="emphasis"><em>not</em></span>
+ #defined.
+ </li>
+<li class="listitem">
+ <span class="bold"><strong>Preconditions</strong></span> are compiled and checked
+ only if the <code class="computeroutput">CONTRACT_CHECK_PRECONDITION</code>
+ is #defined. By default, this macro symbol is <span class="emphasis"><em>not</em></span>
+ #defined.
+ </li>
+<li class="listitem">
+ <span class="bold"><strong>Postconditions</strong></span> are compiled and checked
+ only if the <code class="computeroutput">CONTRACT_CHECK_POSTCONDITION</code>
+ is #defined. By default, this macro symbol is <span class="emphasis"><em>not</em></span>
+ #defined. In addition, the library copies variables to support old values
+ in postconditions only when <code class="computeroutput">CONTRACT_CHECK_POSTCONDITION</code>
+ is #defined (in this case, these extra copy operations will introduce
+ some run-time overhead).
+ </li>
+</ul></div>
+<div class="important"><table border="0" summary="Important">
+<tr>
+<td rowspan="2" align="center" valign="top" width="25"><img alt="[Important]" src="../images/important.png"></td>
+<th align="left">Important</th>
+</tr>
+<tr><td align="left" valign="top">
+<p>
+ <span class="bold"><strong>Contracts Off by Default</strong></span>
+ </p>
+<p>
+ All these symbols are #undefined by default so you must define them when
+ compiling otherwise the library will do nothing.
+ </p>
+</td></tr>
+</table></div>
+<p>
+ In Contract Programming, it is usually important to be able to selectively
+ turn off compilation of invariants, preconditions, and/or postconditions
+ for the sake of run-time efficiency, to reduce the size of the compiled object
+ code, and also to reduce the compile-time overhead associated with the compilation
+ of contracts. However, be aware that when contract compilation is turned
+ off the compiler will not even check that the contract code is syntactically
+ correct (so it might be good practice to compile with the contracts turned
+ on once to maintain the contract code even if the contracts will be turned
+ off in the actual release build).
+ </p>
+<p>
+ These macros must be #defined before the library <span class="emphasis"><em>first</em></span>
+ #include. Your compiler options to #define macros can be used to this purpose
+ ("-D" and "-U" for GCC, "/D" and "/U"
+ for Microsoft Visual C++, etc).
+ </p>
+<p>
+ For example, let's assume we only want to check class invariants and preconditions
+ but no postconditions and block invariants. Then we have to #define <code class="computeroutput">CONTRACT_CHECK_CLASS_INVARIANT</code>
+ and <code class="computeroutput">CONTRACT_CHECK_PRECONDITION</code>
+ but leave <code class="computeroutput">CONTRACT_CHECK_POSTCONDITION</code>
+ and <code class="computeroutput">CONTRACT_CHECK_BLOCK_INVARIANT</code>
+ #undefined. If we are using the GCC compiler, we can do this using the following
+ command line options:
+ </p>
+<pre class="programlisting">$ g++ -DCONTRACT_CHECK_CLASS_INVARIANT -DCONTRACT_CHECK_PRECONDITION
+ -UCONTRACT_CHECK_POSTCONDITION -UCONTRACT_CHECK_BLOCK_INVARIANT ...
+</pre>
+</div>
+<div class="section">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="contract__.getting_started.names_and_symbols"></a><a class="link" href="getting_started.html#contract__.getting_started.names_and_symbols" title="Names and Symbols">Names and
+ Symbols</a>
+</h3></div></div></div>
+<p>
+ All library names are defined within the <code class="computeroutput"><span class="identifier">contract</span></code>
+ namespace. All library macros start with the <code class="computeroutput"><span class="identifier">CONTRACT</span></code>
+ prefix. Any library names, macros, files, directories, etc that end with
+ an underscore "<code class="computeroutput"><span class="identifier">_</span></code>"
+ are library implementation specific and should <span class="emphasis"><em>not</em></span> be
+ used directly in user code by programmers.
+ </p>
+<p>
+ This library needs to <span class="emphasis"><em>augment</em></span> the user code with special
+ symbols to implement the contracts. These symbols need to be defined within
+ the user code namespace. All these symbols start with the <code class="computeroutput"><span class="identifier">contract</span></code>
+ prefix and end with an underscore "<code class="computeroutput"><span class="identifier">_</span></code>"
+ to prevent name clashes with user code. Again, these symbols end with an
+ underscore "<code class="computeroutput"><span class="identifier">_</span></code>"
+ so they are library implementation specific and should <span class="emphasis"><em>not</em></span>
+ be used directly in user code by programmers.
+ </p>
+<p>
+ Finally, all library names in the <code class="computeroutput"><span class="identifier">contract</span><span class="special">::</span><span class="identifier">aux</span></code> namespace
+ and symbols starting with <code class="computeroutput"><span class="identifier">CONTRACT_AUX</span></code>
+ are also library implementation specific and should <span class="emphasis"><em>not</em></span>
+ be used directly in user code by programmers.
+ </p>
+</div>
+<div class="section">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="contract__.getting_started.compile_time_configuration"></a><a class="link" href="getting_started.html#contract__.getting_started.compile_time_configuration" title="Compile-Time Configuration">Compile-Time
+ Configuration</a>
+</h3></div></div></div>
+<p>
+ Some of the library behaviour can be changed at compile-time #defining special
+ <span class="emphasis"><em>configuration macros</em></span> (<code class="computeroutput">CONTRACT_CONFIG_MAX_FUNCTION_ARITY</code>,
+ <code class="computeroutput">CONTRACT_CONFIG_MAX_MULTIPLE_INHERITANCE</code>,
+ etc). If configuration macros are not #defined, the library will use appropriate
+ default values for them.
+ </p>
+<p>
+ The library configuration macros can be #defined using your compiler options
+ similarly to what discussed above. However, it is strongly recommended <span class="emphasis"><em>not</em></span>
+ to change the library compile-time configuration unless strictly necessary.
+ </p>
+</div>
+</div>
+<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
+<td align="left"></td>
+<td align="right"><div class="copyright-footer">Copyright &#169; 2009, 2010 Lorenzo Caminiti<p>
+ Distributed under the Contract++ Software License, Version 1.0 (see accompanying
+ file LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="../index.html"><img src="../images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../images/home.png" alt="Home"></a><a accesskey="n" href="tutorial.html"><img src="../images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>

Added: sandbox/contract/libs/contract/doc/html/contract__/grammar.html
==============================================================================
--- (empty file)
+++ sandbox/contract/libs/contract/doc/html/contract__/grammar.html 2011-06-28 20:54:41 EDT (Tue, 28 Jun 2011)
@@ -0,0 +1,739 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
+<title>Appendix: Grammar</title>
+<link rel="stylesheet" href="../doc/html/boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
+<link rel="home" href="../index.html" title="Contract++ 0.3.490">
+<link rel="up" href="../index.html" title="Contract++ 0.3.490">
+<link rel="prev" href="contract_programming.html" title="Annex: Contract Programming">
+<link rel="next" href="../reference.html" title="Reference">
+</head>
+<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
+<table cellpadding="2" width="100%"><tr><td valign="top"></td></tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="contract_programming.html"><img src="../images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../images/home.png" alt="Home"></a><a accesskey="n" href="../reference.html"><img src="../images/next.png" alt="Next"></a>
+</div>
+<div class="section">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="contract__.Grammar"></a><a class="link" href="Grammar.html" title="Appendix: Grammar">Appendix: Grammar</a>
+</h2></div></div></div>
+<div class="toc"><dl>
+<dt><span class="section">Contract Macros</span></dt>
+<dt><span class="section">Terminals</span></dt>
+<dt><span class="section">Lexical Conventions</span></dt>
+<dt><span class="section">Class Signature</span></dt>
+<dt><span class="section"><a href="Grammar.html#contract__.Grammar.constructor_signature">Constructor
+ Signature</a></span></dt>
+<dt><span class="section">Destructor Signature</span></dt>
+<dt><span class="section">Function Signature</span></dt>
+<dt><span class="section"><a href="Grammar.html#contract__.Grammar.postcondition_s_result_and_old_of">Postcondition's
+ Result and Old-Of</a></span></dt>
+<dt><span class="section"><a href="Grammar.html#contract__.Grammar.positional_function_parameters">Positional
+ Function Parameters</a></span></dt>
+<dt><span class="section"><a href="Grammar.html#contract__.Grammar.named_function_parameters">Named Function
+ Parameters</a></span></dt>
+<dt><span class="section">Template Parameters</span></dt>
+<dt><span class="section">Assertions</span></dt>
+<dt><span class="section">Loop Variant</span></dt>
+<dt><span class="section">New Keywords</span></dt>
+</dl></div>
+<div class="section">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="contract__.Grammar.contract_macros"></a><a class="link" href="Grammar.html#contract__.Grammar.contract_macros" title="Contract Macros">Contract Macros</a>
+</h3></div></div></div>
+<pre class="programlisting"><span class="identifier">CONTRACT_CLASS</span><span class="special">(</span> <span class="emphasis"><em>parenthesized-class-signature</em></span> <span class="special">)</span>
+
+<span class="identifier">CONTRACT_CONSTRUCTOR</span><span class="special">(</span> <span class="emphasis"><em>parenthesized-constructor-signature</em></span> <span class="special">)</span>
+<span class="identifier">CONTRACT_DESTRUCTOR</span><span class="special">(</span> <span class="emphasis"><em>parenthesized-destructor-signature</em></span> <span class="special">)</span>
+<span class="identifier">CONTRACT_FUNCTION</span><span class="special">(</span> <span class="emphasis"><em>parenthesized-function-signature</em></span> <span class="special">)</span> <span class="comment">// Used for both member and non-member functions.</span>
+
+<span class="identifier">CONTRACT_CLASS_INVARIANT</span><span class="special">(</span> <span class="emphasis"><em>parenthesized-assertions</em></span> <span class="special">)</span>
+<span class="identifier">CONTRACT_STATIC_CLASS_INVARIANT</span><span class="special">(</span> <span class="emphasis"><em>parenthesized-assertions</em></span> <span class="special">)</span>
+<span class="identifier">CONTRACT_BLOCK_INVARIANT</span><span class="special">(</span> <span class="emphasis"><em>parenthesized-assertions</em></span> <span class="special">)</span>
+
+<span class="identifier">CONTRACT_LOOP</span><span class="special">(</span> <span class="bold"><strong>loop-signature</strong></span> <span class="special">)</span>
+<span class="identifier">CONTRACT_LOOP_END</span>
+<span class="identifier">CONTRACT_LOOP_VARIANT</span><span class="special">(</span> <span class="emphasis"><em>parenthesized-variant</em></span> <span class="special">)</span>
+
+<span class="identifier">CONTRACT_CONSTRUCTOR_BODY</span><span class="special">(</span><span class="bold"><strong>class-type</strong></span><span class="special">,</span> <span class="bold"><strong>class-name</strong></span><span class="special">)</span>
+<span class="identifier">CONTRACT_DESTRUCTOR_BODY</span><span class="special">(</span><span class="bold"><strong>class-type</strong></span><span class="special">,</span> <span class="bold"><strong>class-name</strong></span><span class="special">)</span>
+<span class="identifier">CONTRACT_MEMBER_BODY</span><span class="special">(</span><span class="emphasis"><em>function-name</em></span><span class="special">)</span>
+<span class="identifier">CONTRACT_NONMEMBER_BODY</span><span class="special">(</span><span class="emphasis"><em>function-name</em></span><span class="special">)</span>
+</pre>
+</div>
+<div class="section">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="contract__.Grammar.terminals"></a><a class="link" href="Grammar.html#contract__.Grammar.terminals" title="Terminals">Terminals</a>
+</h3></div></div></div>
+<div class="informaltable"><table class="table">
+<colgroup>
+<col>
+<col>
+</colgroup>
+<thead><tr>
+<th>
+ <p>
+ Terminal
+ </p>
+ </th>
+<th>
+ <p>
+ Description
+ </p>
+ </th>
+</tr></thead>
+<tbody><tr>
+<td>
+ <p>
+ <code class="literal"><span class="bold"><strong>class-name</strong></span></code>
+ </p>
+ </td>
+<td>
+ <p>
+ The name of a class. It is never prefixed by <code class="computeroutput"><span class="special">~</span></code>
+ not even when specified within destructor contract macros. It does
+ not specify the class namespace or eventual template parameters
+ for a class template, just the class name.
+ </p>
+ </td>
+</tr></tbody>
+</table></div>
+</div>
+<div class="section"><div class="titlepage"><div><div><h3 class="title">
+<a name="contract__.Grammar.lexical_conventions"></a><a class="link" href="Grammar.html#contract__.Grammar.lexical_conventions" title="Lexical Conventions">Lexical Conventions</a>
+</h3></div></div></div></div>
+<div class="section">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="contract__.Grammar.class_signature"></a><a class="link" href="Grammar.html#contract__.Grammar.class_signature" title="Class Signature">Class Signature</a>
+</h3></div></div></div>
+<pre class="programlisting"><span class="emphasis"><em>parenthesized-class-signature:</em></span>
+ /[/<span class="special">(</span><span class="keyword">template</span><span class="special">)(</span> <span class="emphasis"><em>template-parameter+</em></span> <span class="special">)</span>
+ /[/<span class="special">(</span><span class="identifier">requires</span><span class="special">)(</span> <span class="special">(</span><span class="bold"><strong>concept</strong></span><span class="special">)</span><span class="emphasis"><em>+</em></span> <span class="special">)</span>/]]/
+ <span class="emphasis"><em>class-specifier</em></span> <span class="special">(</span><span class="bold"><strong>class-name</strong></span><span class="special">)</span>
+ /[/<span class="special">(</span><span class="identifier">extends</span><span class="special">)(</span> <span class="emphasis"><em>base-class+</em></span> <span class="special">)</span>/]/
+
+<span class="emphasis"><em>class-specifier:</em></span>
+ <span class="special">(</span><span class="keyword">class</span><span class="special">)</span> <span class="emphasis"><em>|</em></span> <span class="special">(</span><span class="keyword">struct</span><span class="special">)</span>
+
+<span class="emphasis"><em>base-class:</em></span>
+ /[/<span class="special">(</span><span class="keyword">virtual</span><span class="special">)</span>/]/
+ /[access-level]/
+ <span class="special">(</span><span class="bold"><strong>base-class-type</strong></span><span class="special">)</span>
+
+<span class="emphasis"><em>access-level:</em></span>
+ <span class="special">(</span><span class="keyword">public</span><span class="special">)</span> <span class="emphasis"><em>|</em></span> <span class="special">(</span><span class="keyword">protected</span><span class="special">)</span> <span class="emphasis"><em>|</em></span> <span class="special">(</span><span class="keyword">private</span><span class="special">)</span>
+</pre>
+<p>
+ As usual in C++, classes (or structures) are specified by using the <code class="computeroutput"><span class="special">(</span><span class="keyword">class</span><span class="special">)</span></code>
+ (or <code class="computeroutput"><span class="special">(</span><span class="keyword">struct</span><span class="special">)</span></code>) keyword, base classes without an explicit
+ access level are inherited privately (or publicly), and members access levels
+ start as private (or public) within the class (or structure) declaration
+ body until otherwise specified. Contracts are not supported for <code class="computeroutput"><span class="keyword">union</span></code>s (this limitation might be relaxed in
+ future revisions of this library).
+ </p>
+</div>
+<div class="section">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="contract__.Grammar.constructor_signature"></a><a class="link" href="Grammar.html#contract__.Grammar.constructor_signature" title="Constructor Signature">Constructor
+ Signature</a>
+</h3></div></div></div>
+<pre class="programlisting"><span class="emphasis"><em>parenthesized-constructor-signature:</em></span>
+ <span class="emphasis"><em>access-level</em></span>
+ /[/<span class="special">(</span><span class="keyword">template</span><span class="special">)(</span> <span class="emphasis"><em>template-parameters</em></span> <span class="special">)</span>
+ /[/<span class="special">(</span><span class="identifier">requires</span><span class="special">)(</span> <span class="special">(</span><span class="bold"><strong>concept</strong></span><span class="special">)</span><span class="emphasis"><em>+</em></span> <span class="special">)</span>/]]/
+ /[/<span class="special">(</span><span class="keyword">explicit</span><span class="special">)</span>/]/
+ /[/<span class="special">(</span><span class="keyword">inline</span><span class="special">)</span>/]/
+ <span class="special">(</span><span class="bold"><strong>class-name</strong></span><span class="special">)(</span> <span class="emphasis"><em>parameters</em></span> <span class="special">)</span>
+ /[/<span class="special">(</span><span class="keyword">throw</span><span class="special">)(</span> <span class="emphasis"><em>exceptions</em></span> <span class="special">)</span>/]/
+ /[/<span class="special">(</span><span class="identifier">initialize</span><span class="special">)(</span> <span class="special">(</span><span class="bold"><strong>member-initializer</strong></span><span class="special">)</span><span class="emphasis"><em>+</em></span> <span class="special">)</span>/]/
+ /[/<span class="special">(</span><span class="identifier">precondition</span><span class="special">)(</span> <span class="emphasis"><em>parenthesized-assertions</em></span> <span class="special">)</span>/]/
+ /[/<span class="special">(</span><span class="identifier">postcondition</span> <span class="emphasis"><em>oldof-assignments</em></span><span class="special">)(</span> <span class="emphasis"><em>parenthesized-assertions</em></span> <span class="special">)</span>/]/
+
+<span class="emphasis"><em>parameters:</em></span>
+ <span class="special">(</span><span class="keyword">void</span><span class="special">)</span> <span class="comment">// Mandatory for no parameters.</span>
+ <span class="emphasis"><em>| positional-parameters</em></span>
+ <span class="emphasis"><em>| named-parameters</em></span>
+
+<span class="emphasis"><em>exceptions:</em></span>
+ <span class="special">(</span><span class="keyword">void</span><span class="special">)</span> <span class="comment">// Specify the function throws no exception.</span>
+ <span class="emphasis"><em>|</em></span> <span class="special">(</span><span class="bold"><strong>exception-type</strong></span><span class="special">)</span><span class="emphasis"><em>+</em></span>
+</pre>
+<div class="itemizedlist"><ul class="itemizedlist" type="disc">
+<li class="listitem">
+ Constructor preconditions cannot access the object <code class="computeroutput"><span class="keyword">this</span></code>
+ (because there is no object before constructor body execution).
+ </li>
+<li class="listitem">
+ Constructor postcondition <code class="literal"><span class="emphasis"><em>oldof-assignments</em></span></code>
+ cannot access the object <code class="computeroutput"><span class="keyword">this</span></code>
+ (because there was no object before constructor body execution).
+ </li>
+</ul></div>
+</div>
+<div class="section">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="contract__.Grammar.destructor_signature"></a><a class="link" href="Grammar.html#contract__.Grammar.destructor_signature" title="Destructor Signature">Destructor Signature</a>
+</h3></div></div></div>
+<pre class="programlisting"><span class="emphasis"><em>parenthesized-destructor-signature:</em></span>
+ <span class="emphasis"><em>access-level</em></span>
+ /[/<span class="special">(</span><span class="keyword">inline</span><span class="special">)</span>/]/
+ /[/<span class="special">(</span><span class="keyword">virtual</span><span class="special">)</span>/]/
+ <span class="special">(</span><span class="bold"><strong>class-name</strong></span><span class="special">)(</span> <span class="special">(</span><span class="keyword">void</span><span class="special">)</span> <span class="special">)</span>
+ /[/<span class="special">(</span><span class="keyword">throw</span><span class="special">)(</span> <span class="emphasis"><em>exceptions</em></span> <span class="special">)</span>/]/
+</pre>
+<p>
+ Destructors have no preconditions and no postconditions (but they have a
+ contract because they check the class invariants).
+ </p>
+</div>
+<div class="section">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="contract__.Grammar.function_signature"></a><a class="link" href="Grammar.html#contract__.Grammar.function_signature" title="Function Signature">Function Signature</a>
+</h3></div></div></div>
+<pre class="programlisting"><span class="emphasis"><em>parenthesized-function-signature:</em></span>
+ <span class="emphasis"><em>member-function-signature</em></span>
+ <span class="emphasis"><em>| non-member-function-signature</em></span>
+
+<span class="emphasis"><em>member-function-signature:</em></span>
+ <span class="emphasis"><em>access-level</em></span>
+ /[/<span class="special">(</span><span class="keyword">template</span><span class="special">)(</span> <span class="emphasis"><em>required-template-parameter+</em></span> <span class="special">)</span>
+ /[/<span class="special">(</span><span class="identifier">requires</span><span class="special">)(</span> <span class="special">(</span><span class="bold"><strong>concept</strong></span><span class="special">)</span><span class="emphasis"><em>+</em></span> <span class="special">)</span>/]]/
+ /[/<span class="special">(</span><span class="keyword">inline</span><span class="special">)</span>/]/
+ /[/<span class="special">(</span><span class="keyword">static</span><span class="special">)</span>/]/
+ /[/<span class="special">(</span><span class="keyword">virtual</span><span class="special">)</span>/]/
+ <span class="special">(</span><span class="bold"><strong>result-type</strong></span><span class="special">)</span> <span class="special">(</span><span class="emphasis"><em>function-name</em></span><span class="special">)(</span> <span class="emphasis"><em>parameters</em></span> <span class="special">)</span>
+ /[/<span class="special">(</span><span class="keyword">const</span><span class="special">)</span>/]/
+ /[/<span class="special">(</span><span class="keyword">volatile</span><span class="special">)</span>/]/
+ /[/<span class="special">(</span><span class="keyword">throw</span><span class="special">)(</span> <span class="emphasis"><em>exceptions</em></span> <span class="special">)</span>/]/
+ /[/<span class="special">(</span><span class="identifier">precondition</span><span class="special">)(</span> <span class="emphasis"><em>parenthesized-assertions</em></span> <span class="special">)</span>/]/
+ /[/<span class="special">(</span><span class="identifier">postcondition</span> <span class="emphasis"><em>result-assignment oldof-assignments</em></span><span class="special">)(</span> <span class="emphasis"><em>parenthesized-assertions</em></span> <span class="special">)</span>/]/
+
+<span class="emphasis"><em>non-member-function-signature:</em></span>
+ /[/<span class="special">(</span><span class="keyword">export</span><span class="special">)</span>/]/
+ /[/<span class="special">(</span><span class="keyword">template</span><span class="special">)(</span> <span class="emphasis"><em>required-template-parameter+</em></span> <span class="special">)</span>
+ /[/<span class="special">(</span><span class="identifier">requires</span><span class="special">)(</span> <span class="special">(</span><span class="bold"><strong>concept</strong></span><span class="special">)</span><span class="emphasis"><em>+</em></span> <span class="special">)</span>/]]/
+ /[/<span class="special">(</span><span class="keyword">inline</span><span class="special">)</span>/]/
+ /[/<span class="special">(</span><span class="keyword">extern</span><span class="special">)</span> <span class="emphasis"><em>|</em></span> <span class="special">(</span><span class="keyword">static</span><span class="special">)</span>/]/
+ <span class="special">(</span><span class="bold"><strong>result-type</strong></span><span class="special">)</span> <span class="special">(</span><span class="emphasis"><em>function-name</em></span><span class="special">)(</span> <span class="emphasis"><em>parameters</em></span> <span class="special">)</span>
+ /[/<span class="special">(</span><span class="keyword">throw</span><span class="special">)(</span> <span class="emphasis"><em>exceptions</em></span> <span class="special">)</span>/]/
+ /[/<span class="special">(</span><span class="identifier">precondition</span><span class="special">)(</span> <span class="emphasis"><em>parenthesized-assertions</em></span> <span class="special">)</span>/]/
+ /[/<span class="special">(</span><span class="identifier">postcondition</span> <span class="emphasis"><em>result-assignment oldof-assignments</em></span><span class="special">)(</span> <span class="emphasis"><em>parenthesized-assertions</em></span> <span class="special">)</span>/]/
+
+<span class="emphasis"><em>function-name:</em></span>
+ <span class="bold"><strong>non-operator-name</strong></span>
+ <span class="emphasis"><em>|</em></span> <span class="keyword">operator</span> <span class="special">(</span><span class="bold"><strong>operator-symbol</strong></span><span class="special">,</span> <span class="bold"><strong>alphanumeric-operator-name</strong></span><span class="special">)</span>
+</pre>
+</div>
+<div class="section">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="contract__.Grammar.postcondition_s_result_and_old_of"></a><a class="link" href="Grammar.html#contract__.Grammar.postcondition_s_result_and_old_of" title="Postcondition's Result and Old-Of">Postcondition's
+ Result and Old-Of</a>
+</h3></div></div></div>
+<pre class="programlisting"><span class="emphasis"><em>result-assignment:</em></span>
+ /[/<span class="special">(</span><span class="bold"><strong>result-variable-name</strong></span> <span class="special">=</span> <span class="keyword">return</span><span class="special">)</span>/]/
+</pre>
+<div class="itemizedlist"><ul class="itemizedlist" type="disc">
+<li class="listitem">
+ The result assignment allows the postcondition assertions to access the
+ return value of the function using the specified result variable name.
+ </li>
+<li class="listitem">
+ The result assignment is optional and it can be specified only for non-void
+ functions.
+ </li>
+<li class="listitem">
+ This assignment requires the return type to have a copy constructor and
+ it introduces an extra copy operation to store the return value (with
+ related performance impact) -- @tdodo Can I get rid of this extra copy
+ operation passing around references to the return value?
+ </li>
+</ul></div>
+<pre class="programlisting"><span class="emphasis"><em>oldof-assignments:</em></span>
+ <span class="special">(</span><span class="bold"><strong>oldof-variable-name</strong></span> <span class="special">=</span> CONTRACT_OLDOF<span class="special">(</span><span class="bold"><strong>oldof-expression</strong></span><span class="special">))</span><span class="emphasis"><em>*</em></span>
+</pre>
+<div class="itemizedlist"><ul class="itemizedlist" type="disc">
+<li class="listitem">
+ No type but old-of expression evaluated twice (instead of just one time
+ to make the copy).
+ </li>
+<li class="listitem">
+ The type of old-of expression must have an accessible copy constructor
+ (otherwise compile-time error).
+ </li>
+<li class="listitem">
+ <code class="computeroutput">CONTRACT_OLDOF</code>
+ macro can only be used within the old-of assignments (and not within
+ the postcondition assertions, otherwise compile-time error).
+ </li>
+<li class="listitem">
+ The old-of variable can be accessed only within the postcondition assertion
+ and only in a constant-correct context (otherwise, compile-time error).
+ </li>
+</ul></div>
+</div>
+<div class="section">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="contract__.Grammar.positional_function_parameters"></a><a class="link" href="Grammar.html#contract__.Grammar.positional_function_parameters" title="Positional Function Parameters">Positional
+ Function Parameters</a>
+</h3></div></div></div>
+<pre class="programlisting"><span class="emphasis"><em>positional-parameters:</em></span>
+ <span class="emphasis"><em>positional-required-parameter+</em></span>
+ <span class="emphasis"><em>| positional-optional-parameter+</em></span>
+ <span class="emphasis"><em>| positional-required-parameter+ positional-optional-parameter+</em></span>
+
+<span class="emphasis"><em>positional-required-parameter:</em></span>
+ /[/<span class="special">(</span><span class="keyword">auto</span><span class="special">)</span> <span class="emphasis"><em>|</em></span> <span class="special">(</span><span class="keyword">register</span><span class="special">)</span>/]/
+ <span class="special">(</span><span class="bold"><strong>parameter-type</strong></span><span class="special">)</span> <span class="special">(</span><span class="bold"><strong>parameter-name</strong></span><span class="special">)</span>
+
+<span class="emphasis"><em>positional-optional-parameter:</em></span>
+ <span class="emphasis"><em>required-parameter</em></span>
+ <span class="special">(</span><span class="keyword">default</span><span class="special">)(</span><span class="bold"><strong>parameter-default</strong></span><span class="special">)</span>
+</pre>
+</div>
+<div class="section">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="contract__.Grammar.named_function_parameters"></a><a class="link" href="Grammar.html#contract__.Grammar.named_function_parameters" title="Named Function Parameters">Named Function
+ Parameters</a>
+</h3></div></div></div>
+<pre class="programlisting"><span class="emphasis"><em>named-parameters:</em></span>
+ /[/<span class="special">(</span><span class="keyword">namespace</span><span class="special">)(</span><span class="bold"><strong>tag-namespace</strong></span><span class="special">)</span>/]/
+ <span class="emphasis"><em>induced-named-parameters</em></span>
+ <span class="emphasis"><em>| deduced-named-parameters</em></span>
+ <span class="emphasis"><em>| induced-named-parameters deduced-named-parameters</em></span>
+
+<span class="emphasis"><em>induced-named-parameters:</em></span>
+ <span class="emphasis"><em>required-named-parameter+</em></span>
+ <span class="emphasis"><em>| optional-named-parameter+</em></span>
+ <span class="emphasis"><em>| required-named-parameter+ optional-named-parameter+</em></span>
+
+<span class="emphasis"><em>deduced-named-parameters:</em></span>
+ <span class="special">(</span><span class="identifier">deduce</span><span class="special">)(</span> <span class="emphasis"><em>induced-named-parameters</em></span> <span class="special">)</span>
+
+<span class="emphasis"><em>required-named-parameter:</em></span>
+ <span class="emphasis"><em>inout-classifier</em></span>
+ <span class="emphasis"><em>named-parameter-type</em></span> <span class="special">(</span><span class="bold"><strong>parameter-name</strong></span><span class="special">)</span>
+
+<span class="emphasis"><em>optional-named-parameter:</em></span>
+ <span class="emphasis"><em>required-named-parameter</em></span>
+ <span class="special">(</span><span class="keyword">default</span><span class="special">)(</span><span class="bold"><strong>parameter-default</strong></span><span class="special">)</span>
+
+<span class="emphasis"><em>inout-classifier:</em></span>
+ <span class="special">(</span><span class="identifier">in</span><span class="special">)</span> <span class="emphasis"><em>|</em></span> <span class="special">(</span><span class="identifier">out</span><span class="special">)</span> <span class="emphasis"><em>|</em></span> <span class="special">(</span><span class="identifier">inout</span><span class="special">)</span>
+
+<span class="emphasis"><em>named-parameter-type:</em></span>
+ <span class="special">(</span><span class="keyword">auto</span><span class="special">)</span> <span class="comment">// Any type.</span>
+ <span class="emphasis"><em>|</em></span> <span class="special">(</span><span class="bold"><strong>parameter-type</strong></span><span class="special">)</span> <span class="comment">// Only the exact type specification.</span>
+ <span class="emphasis"><em>|</em></span> <span class="special">(</span><span class="identifier">requires</span> <span class="special">(</span><span class="bold"><strong>parameter-type-predicate</strong></span><span class="special">))</span> <span class="comment">// Any type matching the specified predicate.</span>
+</pre>
+<p>
+ If the tag-namespace is not specified, <code class="literal"><span class="emphasis"><em>current-namespace</em></span>::tag</code>
+ is used by default.
+ </p>
+<p>
+ Named parameters cannot be specified for function templates. Note that this
+ is not a limitation because named parameters specified to match any type
+ using <code class="computeroutput"><span class="special">(</span><span class="keyword">auto</span><span class="special">)</span></code> are equivalent to template parameters. Furthermore,
+ named parameters specified to match a parameter type predicate using <code class="computeroutput"><span class="special">(</span><span class="identifier">requires</span> <span class="special">(</span> <span class="special">...</span> <span class="special">))</span></code>
+ are equivalent to template parameters with concept requirements.
+ </p>
+</div>
+<div class="section">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="contract__.Grammar.template_parameters"></a><a class="link" href="Grammar.html#contract__.Grammar.template_parameters" title="Template Parameters">Template Parameters</a>
+</h3></div></div></div>
+<pre class="programlisting"><span class="emphasis"><em>template-parameters:</em></span>
+ <span class="emphasis"><em>required-template-parameter+</em></span>
+ <span class="emphasis"><em>| optional-template-parameter+</em></span>
+ <span class="emphasis"><em>| required-template-parameter+ optional-template-parameter+</em></span>
+
+<span class="emphasis"><em>required-template-parameter:</em></span>
+ <span class="emphasis"><em>template-parameter-kind</em></span> <span class="special">(</span><span class="bold"><strong>template-parameter-name</strong></span><span class="special">)</span>
+
+<span class="emphasis"><em>template-parameter-kind:</em></span>
+ <span class="special">(</span><span class="keyword">typename</span><span class="special">)</span> <span class="emphasis"><em>|</em></span> <span class="special">(</span><span class="keyword">class</span><span class="special">)</span> <span class="comment">// For type template parameters.</span>
+ <span class="emphasis"><em>|</em></span> <span class="special">(</span><span class="bold"><strong>template-parameter-type</strong></span><span class="special">)</span> <span class="comment">// For value template parameters.</span>
+
+<span class="emphasis"><em>optional-template-parameter:</em></span>
+ <span class="emphasis"><em>required-template-parameter</em></span>
+ <span class="special">(</span><span class="keyword">default</span><span class="special">)(</span><span class="bold"><strong>template-parameter-default</strong></span><span class="special">)</span>
+</pre>
+<p>
+ As usual in C++, template parameters with defaults must appear at the end
+ of the template parameter list and they cannot be specified for function
+ templates.
+ </p>
+</div>
+<div class="section">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="contract__.Grammar.assertions"></a><a class="link" href="Grammar.html#contract__.Grammar.assertions" title="Assertions">Assertions</a>
+</h3></div></div></div>
+<pre class="programlisting"><span class="emphasis"><em>parenthesized-assertions:</em></span>
+ <span class="emphasis"><em>parenthesized-assertion+</em></span>
+
+<span class="emphasis"><em>parenthesized-assertion:</em></span>
+ <span class="emphasis"><em>runtime-assertion</em></span>
+ <span class="emphasis"><em>| static-assertion</em></span>
+
+<span class="emphasis"><em>runtime-assertion:</em></span>
+ <span class="emphasis"><em>assertion</em></span>
+ <span class="emphasis"><em>| constant-assertion</em></span>
+ <span class="emphasis"><em>| conditional-assertion</em></span>
+
+<span class="emphasis"><em>assertion:</em></span>
+ <span class="special">(</span><span class="bold"><strong>boolean-expression</strong></span><span class="special">)</span>
+ /[/<span class="special">(</span><span class="identifier">importance</span> <span class="special">(</span><span class="bold"><strong>natural-number</strong></span><span class="special">))</span>/]/
+
+<span class="comment">// Only the specified variable names can be used to assert the condition and they must be used in as constants.</span>
+<span class="emphasis"><em>constant-assertion:</em></span>
+ <span class="special">(</span><span class="keyword">const</span> <span class="special">(</span><span class="bold"><strong>in-scope-variable-name</strong></span><span class="special">)</span><span class="emphasis"><em>+</em></span> <span class="special">(</span><span class="bold"><strong>constant-boolean-expression</strong></span><span class="special">))</span>
+ /[/<span class="special">(</span><span class="identifier">importance</span> <span class="special">(</span><span class="bold"><strong>natural-number</strong></span><span class="special">))</span>/]/
+
+<span class="emphasis"><em>conditional-assertion:</em></span>
+ <span class="special">(</span><span class="keyword">if</span> <span class="special">(</span><span class="bold"><strong>boolean-expression</strong></span><span class="special">)</span> <span class="special">(</span>
+ <span class="emphasis"><em>runtime-assertion+</em></span>
+ <span class="special">))</span>
+ /[/<span class="special">(</span><span class="keyword">else</span> <span class="special">(</span> <span class="comment">// This parenthesized else statement is optional.</span>
+ <span class="emphasis"><em>runtime-assertion+</em></span>
+ <span class="special">))</span>/]/
+
+<span class="emphasis"><em>static-assertion:</em></span>
+ <span class="special">(</span><span class="keyword">static</span> <span class="special">(</span><span class="bold"><strong>static-boolean-expression</strong></span><span class="special">))</span>
+ /[/<span class="special">(</span><span class="identifier">importance</span> <span class="special">(</span><span class="bold"><strong>natural-number</strong></span><span class="special">))</span>/]/
+</pre>
+<p>
+ Note that the boolean condition of the if-statement of a conditional-assertion
+ is not evaluated in constant-correct context for loop invariants. This limitation
+ could have been removed by allowing conditional-assertions to be specified
+ within a constant-assertion however that would complicate the syntax significantly
+ making conditional-assertions within constant-assertions very hard to read
+ and creating confusion when importance is specified in both the inner assertions
+ within the conditional-assertion and the outer constant-assertion. Therefore,
+ constant-assertions only allow to specify a single boolean expression. However,
+ the <code class="computeroutput"><span class="special">?:</span></code> operator can be used
+ within a constant-assertion to check the if-condition in a constant correct
+ context:
+ </p>
+<pre class="programlisting"><span class="special">(</span><span class="keyword">const</span> <span class="special">(</span><span class="identifier">x</span><span class="special">)(</span><span class="identifier">y</span><span class="special">)</span> <span class="special">(</span><span class="identifier">x</span> <span class="special">==</span> <span class="identifier">y</span> <span class="special">?</span> <span class="identifier">x</span> <span class="special">&gt;</span> <span class="number">0</span> <span class="special">:</span> <span class="identifier">x</span> <span class="special">&lt;</span> <span class="number">0</span><span class="special">))</span>
+</pre>
+<p>
+ The downside of this approach is that the if-condition will have to be repeated
+ multiple times (with some lost in performance) for different constant-assertions
+ when they need to be wrapped by the same if-condition:
+ </p>
+<pre class="programlisting"><span class="special">(</span><span class="keyword">const</span> <span class="special">(</span><span class="identifier">x</span><span class="special">)(</span><span class="identifier">y</span><span class="special">)</span> <span class="special">(</span><span class="identifier">x</span> <span class="special">==</span> <span class="identifier">y</span> <span class="special">?</span> <span class="identifier">x</span> <span class="special">&gt;</span> <span class="number">0</span> <span class="special">:</span> <span class="identifier">x</span> <span class="special">&lt;</span> <span class="number">0</span><span class="special">))</span>
+<span class="special">(</span><span class="keyword">const</span> <span class="special">(</span><span class="identifier">x</span><span class="special">)(</span><span class="identifier">y</span><span class="special">)</span> <span class="special">(</span><span class="identifier">x</span> <span class="special">==</span> <span class="identifier">y</span> <span class="special">?</span> <span class="identifier">y</span> <span class="special">&gt;</span> <span class="number">0</span> <span class="special">:</span> <span class="identifier">y</span> <span class="special">&lt;</span> <span class="number">0</span><span class="special">))</span> <span class="comment">// Checking `x == y` a second time...</span>
+</pre>
+<p>
+ Alternatively, the multiple assertion conditions can be joined in <code class="computeroutput"><span class="special">&amp;&amp;</span></code> so to be checked within the same
+ <code class="computeroutput"><span class="special">?:</span></code> operator:
+ </p>
+<pre class="programlisting"><span class="special">(</span><span class="keyword">const</span> <span class="special">(</span><span class="identifier">x</span><span class="special">)(</span><span class="identifier">y</span><span class="special">)</span> <span class="special">(</span><span class="identifier">x</span> <span class="special">==</span> <span class="identifier">y</span> <span class="special">?</span> <span class="special">(</span><span class="identifier">x</span> <span class="special">&gt;</span> <span class="number">0</span> <span class="special">&amp;&amp;</span> <span class="identifier">y</span> <span class="special">&gt;</span> <span class="number">0</span><span class="special">)</span> <span class="special">:</span> <span class="special">(</span><span class="identifier">x</span> <span class="special">&lt;</span> <span class="number">0</span> <span class="special">&amp;&amp;</span> <span class="identifier">y</span> <span class="special">&lt;</span> <span class="number">0</span><span class="speci
al">)))</span> <span class="comment">// Cannot see which of the two conditions in and is failing...</span>
+</pre>
+<p>
+ The downside in this case is that if the asserted condition fails it is not
+ clear which one of the two anded condition actually failed.
+ </p>
+</div>
+<div class="section">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="contract__.Grammar.loop_variant"></a><a class="link" href="Grammar.html#contract__.Grammar.loop_variant" title="Loop Variant">Loop Variant</a>
+</h3></div></div></div>
+<pre class="programlisting"><span class="emphasis"><em>parenthesized-variant:</em></span>
+ <span class="emphasis"><em>variant</em></span>
+ <span class="emphasis"><em>| constant-variant</em></span>
+
+<span class="emphasis"><em>variant:</em></span>
+ <span class="special">(</span><span class="bold"><strong>decreasing-natural-expression</strong></span><span class="special">)</span>
+ /[/<span class="special">(</span><span class="identifier">importance</span> <span class="special">(</span><span class="bold"><strong>natural-number</strong></span><span class="special">))</span>/]/
+
+<span class="emphasis"><em>constant-variant:</em></span>
+ <span class="special">(</span><span class="keyword">const</span> <span class="special">(</span><span class="bold"><strong>in-scope-variable-name</strong></span><span class="special">)</span><span class="emphasis"><em>+</em></span> <span class="special">(</span><span class="bold"><strong>constant-decreasing-natural-expression</strong></span><span class="special">))</span>
+ /[/<span class="special">(</span><span class="identifier">importance</span> <span class="special">(</span><span class="bold"><strong>natural-number</strong></span><span class="special">))</span>/]/
+</pre>
+<p>
+ By definition, a variant expression can never be static because it must monotonically
+ decrease at run-time (that is why there is no static-variant).
+ </p>
+</div>
+<div class="section">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="contract__.Grammar.new_keywords"></a><a class="link" href="Grammar.html#contract__.Grammar.new_keywords" title="New Keywords">New Keywords</a>
+</h3></div></div></div>
+<div class="table">
+<a name="id957233"></a><p class="title"><b>Table&#160;2.&#160;Keywords replacing C++ non alphanumeric symbols.</b></p>
+<div class="table-contents"><table class="table" summary="Keywords replacing C++ non alphanumeric symbols.">
+<colgroup>
+<col>
+<col>
+</colgroup>
+<thead><tr>
+<th>
+ <p>
+ Parenthesized Keyword
+ </p>
+ </th>
+<th>
+ <p>
+ Description
+ </p>
+ </th>
+</tr></thead>
+<tbody>
+<tr>
+<td>
+ <p>
+ <code class="computeroutput"><span class="special">(</span><span class="identifier">extends</span><span class="special">)</span></code>
+ </p>
+ </td>
+<td>
+ <p>
+ This parenthesized keyword is used to specify base classes instead
+ of the usual C++ symbol <code class="computeroutput"><span class="special">:</span></code>.
+ The "extends" word was chosen because it is alphanumeric
+ and already used by Java.
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ <code class="computeroutput"><span class="special">(</span><span class="identifier">initialize</span><span class="special">)</span></code>
+ </p>
+ </td>
+<td>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ <code class="computeroutput"><span class="special">(</span><span class="keyword">default</span><span class="special">)</span></code>
+ </p>
+ </td>
+<td>
+ <p>
+ This parenthesized keyword is used to specify defaults for function
+ and template parameters instead of the usual C++ symbol <code class="computeroutput"><span class="special">=</span></code>. The "default" word
+ was chose because it is alphanumeric and it is already a C++ keyword
+ (used to specify default action within a <code class="computeroutput"><span class="keyword">switch</span></code>
+ statement).
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ <code class="computeroutput"><span class="special">(</span><span class="keyword">void</span><span class="special">)</span></code>
+ </p>
+ </td>
+<td>
+ <p>
+ In addition to the usual C++ contexts where <code class="computeroutput"><span class="keyword">void</span></code>
+ is used, this parenthesized keyword is used to specify a function
+ that takes no parameter (instead of <code class="literal"><span class="bold"><strong>function-name</strong></span>()</code>),
+ a function that does not throw (instead of the exeception specification
+ <code class="computeroutput"><span class="keyword">throw</span><span class="special">()</span></code>),
+ no result within postconditions for a function with a type expression
+ not using the <code class="computeroutput"><span class="keyword">void</span></code>
+ token but evaluating to the <code class="computeroutput"><span class="keyword">void</span></code>
+ type.
+ </p>
+ </td>
+</tr>
+</tbody>
+</table></div>
+</div>
+<br class="table-break"><div class="table">
+<a name="id957545"></a><p class="title"><b>Table&#160;3.&#160;Keywords for new features.</b></p>
+<div class="table-contents"><table class="table" summary="Keywords for new features.">
+<colgroup>
+<col>
+<col>
+</colgroup>
+<thead><tr>
+<th>
+ <p>
+ Parenthesized Keyword
+ </p>
+ </th>
+<th>
+ <p>
+ Description
+ </p>
+ </th>
+</tr></thead>
+<tbody>
+<tr>
+<td>
+ <p>
+ <code class="computeroutput"><span class="special">(</span><span class="identifier">importance</span>
+ <span class="special">...)</span></code>
+ </p>
+ </td>
+<td>
+ <p>
+ This parenthesized keyword is used to specify assertion importance.
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ <code class="computeroutput"><span class="special">(</span><span class="identifier">precondition</span><span class="special">)</span></code>
+ </p>
+ </td>
+<td>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ <code class="computeroutput"><span class="special">(</span><span class="identifier">postcondition</span>
+ <span class="special">...)</span></code>
+ </p>
+ </td>
+<td>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ <code class="computeroutput"><span class="special">(</span><span class="keyword">static</span>
+ <span class="special">...)</span></code>
+ </p>
+ </td>
+<td>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ <code class="computeroutput"><span class="special">(</span><span class="keyword">const</span>
+ <span class="special">...)</span></code>
+ </p>
+ </td>
+<td>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ <code class="computeroutput"><span class="special">(</span><span class="keyword">if</span>
+ <span class="special">...)</span></code>
+ </p>
+ </td>
+<td>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ <code class="computeroutput"><span class="special">(</span><span class="keyword">else</span>
+ <span class="special">...)</span></code>
+ </p>
+ </td>
+<td>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ <code class="computeroutput"><span class="special">(</span><span class="keyword">namespace</span><span class="special">)</span></code>
+ </p>
+ </td>
+<td>
+ <p>
+ This parenthesized keyword is used to specify the tag namespace
+ where named parameter classes are defined.
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ <code class="computeroutput"><span class="special">(</span><span class="identifier">deduce</span><span class="special">)</span></code>
+ </p>
+ </td>
+<td>
+ <p>
+ This parenthesized keyword is used to specify a list of deduced
+ named parameters.
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ <code class="computeroutput"><span class="special">(</span><span class="identifier">in</span><span class="special">)</span></code>
+ </p>
+ </td>
+<td>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ <code class="computeroutput"><span class="special">(</span><span class="identifier">out</span><span class="special">)</span></code>
+ </p>
+ </td>
+<td>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ <code class="computeroutput"><span class="special">(</span><span class="identifier">inout</span><span class="special">)</span></code>
+ </p>
+ </td>
+<td>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ <code class="computeroutput"><span class="special">(</span><span class="keyword">auto</span><span class="special">)</span></code>
+ </p>
+ </td>
+<td>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ <code class="computeroutput"><span class="special">(</span><span class="identifier">requires</span>
+ <span class="special">...)</span></code>
+ </p>
+ </td>
+<td>
+ <p>
+ This parenthesized keyword is used to specify template parameter
+ concepts using the syntax <code class="computeroutput"><span class="special">(</span><span class="identifier">requires</span><span class="special">)(</span>
+ <span class="special">(</span></code><code class="literal"><span class="bold"><strong>concept</strong></span></code><code class="computeroutput"><span class="special">)</span></code><code class="literal"><span class="emphasis"><em>+</em></span></code><code class="computeroutput">
+ <span class="special">)</span></code>. It is also similarly
+ used to specify type constraints for named parameters using the
+ syntax <code class="computeroutput"><span class="special">(</span><span class="identifier">requires</span>
+ <span class="special">(</span></code><code class="literal"><span class="bold"><strong>parameter-type-predicate</strong></span></code><code class="computeroutput"><span class="special">))</span></code>.
+ </p>
+ </td>
+</tr>
+</tbody>
+</table></div>
+</div>
+<br class="table-break">
+</div>
+</div>
+<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
+<td align="left"></td>
+<td align="right"><div class="copyright-footer">Copyright &#169; 2009, 2010 Lorenzo Caminiti<p>
+ Distributed under the Contract++ Software License, Version 1.0 (see accompanying
+ file LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="contract_programming.html"><img src="../images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../images/home.png" alt="Home"></a><a accesskey="n" href="../reference.html"><img src="../images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>

Added: sandbox/contract/libs/contract/doc/html/contract__/license.html
==============================================================================
--- (empty file)
+++ sandbox/contract/libs/contract/doc/html/contract__/license.html 2011-06-28 20:54:41 EDT (Tue, 28 Jun 2011)
@@ -0,0 +1,68 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
+<title>License</title>
+<link rel="stylesheet" href="../doc/html/boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
+<link rel="home" href="../index.html" title="Contract++ 0.3.490">
+<link rel="up" href="../index.html" title="Contract++ 0.3.490">
+<link rel="prev" href="bibliography.html" title="Bibliography">
+<link rel="next" href="release_history.html" title="Release History">
+</head>
+<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
+<table cellpadding="2" width="100%"><tr><td valign="top"></td></tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="bibliography.html"><img src="../images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../images/home.png" alt="Home"></a><a accesskey="n" href="release_history.html"><img src="../images/next.png" alt="Next"></a>
+</div>
+<div class="section">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="contract__.license"></a><a class="link" href="license.html" title="License">License</a>
+</h2></div></div></div>
+<pre class="programlisting">Copyright (C) 2009-2010 Lorenzo Caminiti.
+Use, modification, and distribution is subject to the
+Contract++ Software License, Version 1.0.
+(See accompanying file LICENSE_1_0.txt.)
+</pre>
+<pre class="programlisting">(File: LICENSE_1_0.txt)
+
+Contract Programming for C++ (Contract++) Software License, Version 1.0
+April 19th, 2009
+
+Permission is hereby granted, free of charge, to any person or organization
+obtaining a copy of the software and accompanying documentation covered by
+this license (the "Software") to use, reproduce, display, distribute,
+execute, and transmit the Software, and to prepare derivative works of the
+Software, and to permit third-parties to whom the Software is furnished to
+do so, all subject to the following:
+
+The copyright notices in the Software and this entire statement, including
+the above license grant, this restriction and the following disclaimer,
+must be included in all copies of the Software, in whole or in part, and
+all derivative works of the Software, unless such copies or derivative
+works are solely in the form of machine-executable object code generated by
+a source language processor.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
+SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
+FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
+ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+DEALINGS IN THE SOFTWARE.
+</pre>
+</div>
+<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
+<td align="left"></td>
+<td align="right"><div class="copyright-footer">Copyright &#169; 2009, 2010 Lorenzo Caminiti<p>
+ Distributed under the Contract++ Software License, Version 1.0 (see accompanying
+ file LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="bibliography.html"><img src="../images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../images/home.png" alt="Home"></a><a accesskey="n" href="release_history.html"><img src="../images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>

Added: sandbox/contract/libs/contract/doc/html/contract__/release_history.html
==============================================================================
--- (empty file)
+++ sandbox/contract/libs/contract/doc/html/contract__/release_history.html 2011-06-28 20:54:41 EDT (Tue, 28 Jun 2011)
@@ -0,0 +1,191 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
+<title>Release History</title>
+<link rel="stylesheet" href="../doc/html/boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
+<link rel="home" href="../index.html" title="Contract++ 0.3.490">
+<link rel="up" href="../index.html" title="Contract++ 0.3.490">
+<link rel="prev" href="license.html" title="License">
+</head>
+<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
+<table cellpadding="2" width="100%"><tr><td valign="top"></td></tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="license.html"><img src="../images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../images/home.png" alt="Home"></a>
+</div>
+<div class="section">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="contract__.release_history"></a><a class="link" href="release_history.html" title="Release History">Release History</a>
+</h2></div></div></div>
+<div class="toc"><dl>
+<dt><span class="section">Release <NEXT></span></dt>
+<dt><span class="section"><a href="release_history.html#contract__.release_history.release_0_3_490__2010_03_07_">Release
+ 0.3.490 (2010-03-07)</a></span></dt>
+<dt><span class="section"><a href="release_history.html#contract__.release_history.release_0_3_469__2010_02_21_">Release
+ 0.3.469 (2010-02-21)</a></span></dt>
+<dt><span class="section"><a href="release_history.html#contract__.release_history.release_0_2_190__2009_11_21_">Release
+ 0.2.190 (2009-11-21)</a></span></dt>
+<dt><span class="section"><a href="release_history.html#contract__.release_history.release_0_1_26__2009_06_17_">Release
+ 0.1.26 (2009-06-17)</a></span></dt>
+<dt><span class="section"><a href="release_history.html#contract__.release_history.release_0_1_55__2009_04_19_">Release
+ 0.1.55 (2009-04-19)</a></span></dt>
+<dt><span class="section"><a href="release_history.html#contract__.release_history.release_0_1_50__2009_04_19_">Release
+ 0.1.50 (2009-04-19)</a></span></dt>
+</dl></div>
+<p>
+ List of releases from the newest to the oldest.
+ </p>
+<pre class="programlisting"><span class="emphasis"><em>release-number</em></span> := <span class="emphasis"><em>major</em></span>.<span class="emphasis"><em>minor</em></span>.<span class="emphasis"><em>subversion-revision</em></span>
+</pre>
+<div class="section">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="contract__.release_history.release__next_"></a><a class="link" href="release_history.html#contract__.release_history.release__next_" title="Release &lt;NEXT&gt;">Release &lt;NEXT&gt;</a>
+</h3></div></div></div>
+<div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem">
+ Bugfix: Contract macros did not repeat volatile in old object argument
+ of postconditions when volatile object was tagged copyable. Added examples
+ and docs on how to handle old values for volatile types -- programmers
+ must provide T(const volatileT&amp;) const-correct copy constructor for
+ volatile type and then contract::copy automatically uses it.
+ </li></ol></div>
+</div>
+<div class="section">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="contract__.release_history.release_0_3_490__2010_03_07_"></a><a class="link" href="release_history.html#contract__.release_history.release_0_3_490__2010_03_07_" title="Release 0.3.490 (2010-03-07)">Release
+ 0.3.490 (2010-03-07)</a>
+</h3></div></div></div>
+<div class="orderedlist"><ol class="orderedlist" type="1">
+<li class="listitem">
+ Added support and examples for <code class="computeroutput"><span class="keyword">volatile</span></code>,
+ <code class="computeroutput"><span class="keyword">auto</span></code>, <code class="computeroutput"><span class="keyword">explicit</span></code>,
+ <code class="computeroutput"><span class="keyword">export</span></code>, <code class="computeroutput"><span class="keyword">extern</span></code>,
+ <code class="computeroutput"><span class="keyword">friend</span></code>, <code class="computeroutput"><span class="keyword">inline</span></code>,
+ <code class="computeroutput"><span class="keyword">struct</span></code>, and <code class="computeroutput"><span class="keyword">throw</span></code> (for exception specifications).
+ </li>
+<li class="listitem">
+ Documented that <code class="computeroutput"><span class="keyword">union</span></code> cannot
+ be contracted.
+ </li>
+</ol></div>
+</div>
+<div class="section">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="contract__.release_history.release_0_3_469__2010_02_21_"></a><a class="link" href="release_history.html#contract__.release_history.release_0_3_469__2010_02_21_" title="Release 0.3.469 (2010-02-21)">Release
+ 0.3.469 (2010-02-21)</a>
+</h3></div></div></div>
+<div class="orderedlist"><ol class="orderedlist" type="1">
+<li class="listitem">
+ Removed use of <code class="computeroutput"><span class="identifier">self</span></code>,
+ <span class="emphasis"><em>variable</em></span><code class="computeroutput"><span class="special">.</span><span class="identifier">now</span></code>, and <span class="emphasis"><em>variable</em></span><code class="computeroutput"><span class="special">.</span><span class="identifier">old</span></code>
+ in writing contracts. Object (this) and variables are now accessed as
+ usual in member functions. <code class="computeroutput"><span class="identifier">CONTRACT_OLDOF</span><span class="special">(</span></code><span class="emphasis"><em>variable</em></span><code class="computeroutput"><span class="special">)</span></code> is used to access old values in postconditions.
+ </li>
+<li class="listitem">
+ Added <code class="computeroutput"><span class="special">(</span><span class="identifier">precondition</span><span class="special">)</span></code>, <code class="computeroutput"><span class="special">(</span><span class="identifier">postcondition</span><span class="special">)</span></code>,
+ and <code class="computeroutput"><span class="special">(</span><span class="identifier">body</span><span class="special">)</span></code> to specify contracts within the function
+ signature sequence. If no preconditions then <code class="computeroutput"><span class="special">(</span><span class="identifier">precondition</span><span class="special">)</span>
+ <span class="special">({...})</span></code> is simply omitted from
+ <code class="computeroutput"><span class="identifier">sequence</span></code> (same for postconditions,
+ body is mandatory instead). For non-void functions, user can name the
+ result argument with <code class="computeroutput"><span class="special">(</span><span class="identifier">postcondition</span><span class="special">)</span> <span class="special">(</span></code><span class="emphasis"><em>result-name</em></span><code class="computeroutput"><span class="special">)</span> <span class="special">({...})</span></code>.
+ </li>
+<li class="listitem">
+ Changed contract class template to use same syntax as Boost.Function
+ (i.e., <code class="computeroutput"><span class="identifier">F</span></code> function type).
+ </li>
+<li class="listitem">
+ Added support for non-member and static functions.
+ </li>
+<li class="listitem">
+ Added support for subcontracting with multiple inheritance.
+ </li>
+<li class="listitem">
+ Added static class invariants which are always checked (also at constructors
+ entry, destructor exit, and by static member functions).
+ </li>
+<li class="listitem">
+ Added block invariants and Eiffel-like loop variants.
+ </li>
+<li class="listitem">
+ Added functions to customize action on contract failure (default to
+ <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">terminate</span><span class="special">()</span></code>).
+ </li>
+<li class="listitem">
+ Removed feature for automatic contract documentation using Doxygen (this
+ is not compatible with added <code class="computeroutput"><span class="special">(</span><span class="identifier">precondition</span><span class="special">)</span></code>,
+ <code class="computeroutput"><span class="special">(</span><span class="identifier">postcondition</span><span class="special">)</span></code>, and <code class="computeroutput"><span class="special">(</span><span class="identifier">body</span><span class="special">)</span></code>
+ because Doxygen preprocessor is not intended to handle Boost.Preprocessor
+ sequences).
+ </li>
+<li class="listitem">
+ Rewritten entire documentation (now using Boost.QuickBook instead of
+ Doxygen).
+ </li>
+</ol></div>
+</div>
+<div class="section">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="contract__.release_history.release_0_2_190__2009_11_21_"></a><a class="link" href="release_history.html#contract__.release_history.release_0_2_190__2009_11_21_" title="Release 0.2.190 (2009-11-21)">Release
+ 0.2.190 (2009-11-21)</a>
+</h3></div></div></div>
+<div class="orderedlist"><ol class="orderedlist" type="1">
+<li class="listitem">
+ Compiled on both GCC (Linux and Cygwin) and Microsoft Visual C++ (Windows
+ XP).
+ </li>
+<li class="listitem">
+ Required to use <code class="computeroutput"><span class="keyword">void</span></code> to
+ specify empty function argument list. This is to comply with C++ ISO
+ standard that does not allow to pass empty macro parameters so it does
+ not support empty preprocessor sequence elements <code class="computeroutput"><span class="special">()</span></code>.
+ </li>
+</ol></div>
+</div>
+<div class="section">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="contract__.release_history.release_0_1_26__2009_06_17_"></a><a class="link" href="release_history.html#contract__.release_history.release_0_1_26__2009_06_17_" title="Release 0.1.26 (2009-06-17)">Release
+ 0.1.26 (2009-06-17)</a>
+</h3></div></div></div>
+<div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem">
+ Completed first documentation draft.
+ </li></ol></div>
+</div>
+<div class="section">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="contract__.release_history.release_0_1_55__2009_04_19_"></a><a class="link" href="release_history.html#contract__.release_history.release_0_1_55__2009_04_19_" title="Release 0.1.55 (2009-04-19)">Release
+ 0.1.55 (2009-04-19)</a>
+</h3></div></div></div>
+<div class="orderedlist"><ol class="orderedlist" type="1">
+<li class="listitem">
+ Reorganized files to cleanup root directory.
+ </li>
+<li class="listitem">
+ Added installation program.
+ </li>
+</ol></div>
+</div>
+<div class="section">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="contract__.release_history.release_0_1_50__2009_04_19_"></a><a class="link" href="release_history.html#contract__.release_history.release_0_1_50__2009_04_19_" title="Release 0.1.50 (2009-04-19)">Release
+ 0.1.50 (2009-04-19)</a>
+</h3></div></div></div>
+<div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem">
+ First public release.
+ </li></ol></div>
+</div>
+</div>
+<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
+<td align="left"></td>
+<td align="right"><div class="copyright-footer">Copyright &#169; 2009, 2010 Lorenzo Caminiti<p>
+ Distributed under the Contract++ Software License, Version 1.0 (see accompanying
+ file LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="license.html"><img src="../images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../images/home.png" alt="Home"></a>
+</div>
+</body>
+</html>

Added: sandbox/contract/libs/contract/doc/html/contract__/throw_on_failure.html
==============================================================================
--- (empty file)
+++ sandbox/contract/libs/contract/doc/html/contract__/throw_on_failure.html 2011-06-28 20:54:41 EDT (Tue, 28 Jun 2011)
@@ -0,0 +1,144 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
+<title>Annex: Throw on Failure</title>
+<link rel="stylesheet" href="../doc/html/boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
+<link rel="home" href="../index.html" title="Contract++ 0.3.490">
+<link rel="up" href="../index.html" title="Contract++ 0.3.490">
+<link rel="prev" href="examples.html" title="Examples">
+<link rel="next" href="contract_programming.html" title="Annex: Contract Programming">
+</head>
+<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
+<table cellpadding="2" width="100%"><tr><td valign="top"></td></tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="examples.html"><img src="../images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../images/home.png" alt="Home"></a><a accesskey="n" href="contract_programming.html"><img src="../images/next.png" alt="Next"></a>
+</div>
+<div class="section">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="contract__.throw_on_failure"></a><a class="link" href="throw_on_failure.html" title="Annex: Throw on Failure">Annex: Throw on Failure</a>
+</h2></div></div></div>
+<p>
+ This example shows how to setup the library to throw exceptions on contract
+ condition failure (overriding the library default behaviour to call <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">terminate</span><span class="special">()</span></code> to handle contract failures).
+ </p>
+<p>
+ Specifically:
+ </p>
+<div class="orderedlist"><ol class="orderedlist" type="1">
+<li class="listitem">
+ Any exception (including user defined ones) that is thrown when checking
+ a contract condition is re-thrown by the contract failure handlers defined
+ below.
+ </li>
+<li class="listitem">
+ However, if a contract condition fails from a destructor, exceptions cannot
+ be thrown (to comply with C++ STL exception safety requirements) so a message
+ is logged to <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">clog</span></code> and the program execution continues.
+ <sup>[<a name="id949379" href="#ftn.id949379" class="footnote">18</a>]</sup>
+ </li>
+<li class="listitem">
+ In addition, the postcondition failure handler catches any exception derived
+ from <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">exception</span></code> to print the exception description
+ <code class="computeroutput"><span class="identifier">what</span><span class="special">()</span></code>
+ on <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">clog</span></code> before re-throwing it (this is to
+ show how the contract failure handlers can selectively catch exceptions).
+ </li>
+</ol></div>
+<p>
+
+</p>
+<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">contract</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span>
+<span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">iostream</span><span class="special">&gt;</span>
+
+<span class="comment">// User defined exception (not even derived from `std::exception`).</span>
+<span class="keyword">class</span> <span class="identifier">not_a_number</span> <span class="special">{};</span>
+
+<span class="identifier">CONTRACT_FUNCTION</span><span class="special">(</span>
+<span class="special">(</span><span class="keyword">double</span><span class="special">)</span> <span class="special">(</span><span class="identifier">sqrt</span><span class="special">)(</span> <span class="special">(</span><span class="keyword">double</span><span class="special">)(</span><span class="identifier">x</span><span class="special">)</span> <span class="special">)</span>
+ <span class="special">(</span><span class="identifier">precondition</span><span class="special">)(</span>
+ <span class="comment">// Throw user-defined exception if contract is broken.</span>
+ <span class="special">(</span><span class="identifier">x</span> <span class="special">&gt;=</span> <span class="number">0.0</span> <span class="special">?</span> <span class="keyword">true</span> <span class="special">:</span> <span class="keyword">throw</span> <span class="identifier">not_a_number</span><span class="special">())</span>
+ <span class="special">)</span>
+ <span class="special">(</span><span class="identifier">postcondition</span><span class="special">)(</span><span class="identifier">root</span><span class="special">)(</span>
+ <span class="comment">// Defatul throws library defined exception `contract::failure`.</span>
+ <span class="special">(</span><span class="identifier">x</span> <span class="special">==</span> <span class="special">(</span><span class="identifier">root</span> <span class="special">*</span> <span class="identifier">root</span><span class="special">))</span>
+ <span class="special">)</span>
+<span class="special">({</span>
+ <span class="keyword">return</span> <span class="number">0.0</span><span class="special">;</span> <span class="comment">// Intentionally incorrect to fail postcondition.</span>
+<span class="special">})</span> <span class="special">)</span>
+
+<span class="comment">// Handler that re-throws contract broken exception instead of terminating.</span>
+<span class="keyword">void</span> <span class="identifier">throwing_handler</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">contract</span><span class="special">::</span><span class="identifier">from</span><span class="special">&amp;</span> <span class="identifier">context</span><span class="special">)</span> <span class="special">{</span>
+ <span class="keyword">if</span> <span class="special">(</span><span class="identifier">context</span> <span class="special">==</span> <span class="identifier">contract</span><span class="special">::</span><span class="identifier">FROM_DESTRUCTOR</span><span class="special">)</span> <span class="special">{</span>
+ <span class="comment">// Cannot throw from within destructor for STL exception safety.</span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">clog</span> <span class="special">&lt;&lt;</span> <span class="string">"Ignored destructor contract failure"</span> <span class="special">&lt;&lt;</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">endl</span><span class="special">;</span>
+ <span class="special">}</span> <span class="keyword">else</span> <span class="special">{</span>
+ <span class="comment">// Failure handlers always called with active an exception.</span>
+ <span class="keyword">throw</span><span class="special">;</span> <span class="comment">// Re-throw active exception thrown by precondition.</span>
+ <span class="special">}</span>
+<span class="special">}</span>
+
+<span class="comment">// Handler showing how to catch contract broken exception.</span>
+<span class="keyword">void</span> <span class="identifier">postcondition_throwing_handler</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">contract</span><span class="special">::</span><span class="identifier">from</span><span class="special">&amp;</span> <span class="identifier">context</span><span class="special">)</span> <span class="special">{</span>
+ <span class="comment">// try/catch/re-throw to get active exception (for logging, etc.).</span>
+ <span class="keyword">try</span> <span class="special">{</span>
+ <span class="keyword">throw</span><span class="special">;</span> <span class="comment">// Re-throw active exception thrown by precondition.</span>
+ <span class="special">}</span> <span class="keyword">catch</span> <span class="special">(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">exception</span><span class="special">&amp;</span> <span class="identifier">error</span><span class="special">)</span> <span class="special">{</span> <span class="comment">// Get exception object.</span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">clog</span> <span class="special">&lt;&lt;</span> <span class="string">"Throwing '"</span> <span class="special">&lt;&lt;</span> <span class="identifier">error</span><span class="special">.</span><span class="identifier">what</span><span class="special">()</span> <span class="special">&lt;&lt;</span> <span class="string">"'"</span> <span class="special">&lt;&lt;</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">endl</span><span class="special">;</span>
+ <span class="keyword">throw</span><span class="special">;</span> <span class="comment">// Re-throw active exception thrown by precondition.</span>
+ <span class="special">}</span> <span class="comment">// Non standard exception also thrown.</span>
+<span class="special">}</span>
+
+<span class="keyword">int</span> <span class="identifier">main</span><span class="special">()</span> <span class="special">{</span>
+ <span class="comment">// Setup contract failure handlers that throw (instead of terminate).</span>
+ <span class="identifier">contract</span><span class="special">::</span><span class="identifier">set_precondition_broken</span><span class="special">(&amp;</span><span class="identifier">throwing_handler</span><span class="special">);</span>
+ <span class="identifier">contract</span><span class="special">::</span><span class="identifier">set_postcondition_broken</span><span class="special">(&amp;</span><span class="identifier">postcondition_throwing_handler</span><span class="special">);</span>
+ <span class="identifier">contract</span><span class="special">::</span><span class="identifier">set_class_invariant_broken</span><span class="special">(&amp;</span><span class="identifier">throwing_handler</span><span class="special">);</span>
+ <span class="identifier">contract</span><span class="special">::</span><span class="identifier">set_block_invariant_broken</span><span class="special">(&amp;</span><span class="identifier">throwing_handler</span><span class="special">);</span>
+
+ <span class="keyword">try</span> <span class="special">{</span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special">&lt;&lt;</span> <span class="identifier">sqrt</span><span class="special">(-</span><span class="number">1.0</span><span class="special">)</span> <span class="special">&lt;&lt;</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">endl</span><span class="special">;</span>
+ <span class="special">}</span> <span class="keyword">catch</span> <span class="special">(</span><span class="identifier">not_a_number</span><span class="special">&amp;)</span> <span class="special">{</span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">clog</span> <span class="special">&lt;&lt;</span> <span class="string">"Ignored not a number exception"</span> <span class="special">&lt;&lt;</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">endl</span><span class="special">;</span>
+ <span class="special">}</span>
+
+ <span class="keyword">try</span> <span class="special">{</span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special">&lt;&lt;</span> <span class="identifier">sqrt</span><span class="special">(</span><span class="number">4.0</span><span class="special">)</span> <span class="special">&lt;&lt;</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">endl</span><span class="special">;</span>
+ <span class="special">}</span> <span class="keyword">catch</span> <span class="special">(...)</span> <span class="special">{</span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">clog</span> <span class="special">&lt;&lt;</span> <span class="string">"Unable to calculate square root"</span> <span class="special">&lt;&lt;</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">endl</span><span class="special">;</span>
+ <span class="special">}</span>
+
+ <span class="keyword">return</span> <span class="identifier">EXIT_SUCCESS</span><span class="special">;</span>
+<span class="special">}</span>
+
+</pre>
+<p>
+ </p>
+<div class="footnotes">
+<br><hr width="100" align="left">
+<div class="footnote"><p><sup>[<a id="ftn.id949379" href="#id949379" class="para">18</a>] </sup>
+ Continuing the program in this case assumes that the destructors body
+ will be able to somehow execute correctly even if the class invariants
+ do not hold true. This is usually <span class="emphasis"><em>not</em></span> a safe assumption
+ and it is made here only for simplicity. You could chose to still terminate
+ in case class invariants fail for a destructor or to attempt to recover
+ from such an error in some other, more sophisticated, way.
+ </p></div>
+</div>
+</div>
+<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
+<td align="left"></td>
+<td align="right"><div class="copyright-footer">Copyright &#169; 2009, 2010 Lorenzo Caminiti<p>
+ Distributed under the Contract++ Software License, Version 1.0 (see accompanying
+ file LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="examples.html"><img src="../images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../images/home.png" alt="Home"></a><a accesskey="n" href="contract_programming.html"><img src="../images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>

Added: sandbox/contract/libs/contract/doc/html/contract__/todo.html
==============================================================================
--- (empty file)
+++ sandbox/contract/libs/contract/doc/html/contract__/todo.html 2011-06-28 20:54:41 EDT (Tue, 28 Jun 2011)
@@ -0,0 +1,881 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>TODO</title>
+<link rel="stylesheet" href="../doc/html/boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.73.2">
+<link rel="start" href="../index.html" title="Contract++ 0.3.490">
+<link rel="up" href="../index.html" title="Contract++ 0.3.490">
+<link rel="prev" href="release_history.html" title="Release History">
+</head>
+<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
+<div class="spirit-nav">
+<a accesskey="p" href="release_history.html"><img src=".././doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src=".././doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src=".././doc/html/images/home.png" alt="Home"></a>
+</div>
+<hr>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="contract__.todo"></a><a class="link" href="todo.html" title="TODO">TODO</a>
+</h2></div></div></div>
+<div class="toc"><dl>
+<dt><span class="section"><a href="todo.html#contract__.todo.improve_contract_macros__sequence__error_detection_and_reporting">Improve
+ contract macros <code class="computeroutput"><span class="identifier">sequence</span></code> error
+ detection and reporting</a></span></dt>
+<dt><span class="section"><a href="todo.html#contract__.todo.can_block_invariants_and_loop_variants_be_made_constant_correct_">Can
+ block invariants and loop variants be made constant-correct?</a></span></dt>
+<dt><span class="section"><a href="todo.html#contract__.todo.improve_compile_time_performances">Improve
+ compile-time performances</a></span></dt>
+<dt><span class="section"><a href="todo.html#contract__.todo.analyze_run_time_performances">Analyze
+ run-time performances</a></span></dt>
+<dt><span class="section"><a href="todo.html#contract__.todo.always_check_contract_assertion_syntax">Always
+ check contract assertion syntax</a></span></dt>
+<dt><span class="section">Support concurrency</span></dt>
+<dt><span class="section"><a href="todo.html#contract__.todo.can_constructor_member_initialization_list_limitation_be_removed_">Can
+ constructor member initialization list limitation be removed?</a></span></dt>
+<dt><span class="section"><a href="todo.html#contract__.todo.should_preconditions_be_checked_before_constructor_member_initialization_list_">Should
+ preconditions be checked before constructor member initialization list?</a></span></dt>
+<dt><span class="section"><a href="todo.html#contract__.todo.can_syntax_of_contract_macros_be_unified_with_other_boost_libraries_">Can
+ syntax of contract macros be unified with other Boost libraries?</a></span></dt>
+<dt><span class="section"><a href="todo.html#contract__.todo.consider_allowing_optional_contract_checking_based_on_assertion_importance_and_or_class_name">Consider
+ allowing optional contract checking based on assertion importance and/or class
+ name</a></span></dt>
+<dt><span class="section"><a href="todo.html#contract__.todo.consider_adding_contracts_to_all_stl_classes_and_functions_in__contract__std___">Consider
+ adding contracts to all STL classes and functions in <code class="computeroutput"><span class="identifier">contract</span><span class="special">::</span><span class="identifier">std</span><span class="special">::</span></code></a></span></dt>
+<dt><span class="section"><a href="todo.html#contract__.todo.should_i_provide__contract_xyz_decl____macros_">Should
+ I provide <code class="computeroutput"><span class="identifier">CONTRACT_XYZ_DECL</span><span class="special">()</span></code> macros?</a></span></dt>
+<dt><span class="section"><a href="todo.html#contract__.todo.shall_i_remove_the__assert____macros_">Shall
+ I remove the <code class="computeroutput"><span class="identifier">ASSERT</span><span class="special">()</span></code>
+ macros?</a></span></dt>
+<dt><span class="section"><a href="todo.html#contract__.todo.fusing_contracts__concepts__named_parameters__etc_">Fusing
+ contracts, concepts, named parameters, etc.</a></span></dt>
+</dl></div>
+<p>
+ This section lists open items under consideration for future development of
+ this library. It is mainly intended as a memorandum for the library authors.
+ </p>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="contract__.todo.improve_contract_macros__sequence__error_detection_and_reporting"></a><a class="link" href="todo.html#contract__.todo.improve_contract_macros__sequence__error_detection_and_reporting" title="Improve contract macros sequence error detection and reporting">Improve
+ contract macros <code class="computeroutput"><span class="identifier">sequence</span></code> error
+ detection and reporting</a>
+</h3></div></div></div>
+<p>
+ The current implementation for syntax error detection and reporting for the
+ <code class="computeroutput"><span class="identifier">sequence</span></code> parameter of the
+ contract macros should be improved.
+ </p>
+<p>
+ For example, if I forget the sequence element for the result type <code class="computeroutput"><span class="special">(</span><span class="identifier">result</span><span class="special">-</span><span class="identifier">type</span><span class="special">)</span></code>,
+ the preprocessor gives a ton of errors most of which are about Boost.Preprocessor
+ internal macros and make no sense to the user. While using the C++ preprocessor
+ imposes some fundamental limitations on the amount of syntax checking I can
+ implement for the <code class="computeroutput"><span class="identifier">sequence</span></code>
+ macro parameter, I should be able to improve the current library implementation.
+ </p>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="contract__.todo.can_block_invariants_and_loop_variants_be_made_constant_correct_"></a><a class="link" href="todo.html#contract__.todo.can_block_invariants_and_loop_variants_be_made_constant_correct_" title="Can block invariants and loop variants be made constant-correct?">Can
+ block invariants and loop variants be made constant-correct?</a>
+</h3></div></div></div>
+<p>
+ Currently block invariants and loop variants are <span class="emphasis"><em>not</em></span>
+ constant-correct. Class invariants, preconditions, and postconditions instead
+ are constant-correct so to ensure that the state of the system is not changed
+ while checking the contract.
+ </p>
+<p>
+ Can block invariants and loop variants be made constant-correct also?
+ </p>
+<p>
+ This seems difficult because C++ does not allow to specify "constant-block":
+ </p>
+<pre class="programlisting"><span class="special">{</span> <span class="comment">// Some existing block.
+</span> <span class="keyword">const</span> <span class="special">{</span> <span class="comment">// A constant block -- BUT NOT SUPPORTED!!
+</span> <span class="comment">// Assert here block invariants and loop variants ensuring
+</span> <span class="comment">// const correctness.
+</span> <span class="special">...</span>
+ <span class="special">}</span>
+ <span class="special">...</span>
+<span class="special">}</span>
+</pre>
+<p>
+ Therefore, the code asserting block invariants and loop variants has the
+ same constant constraints (possibly none!) on object, function arguments,
+ result, etc as the enclosing code block... Is there a way around this? If
+ not, shall I still provide block invariants and loop variants (documenting
+ this limitation) or not?
+ </p>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="contract__.todo.improve_compile_time_performances"></a><a class="link" href="todo.html#contract__.todo.improve_compile_time_performances" title="Improve compile-time performances">Improve
+ compile-time performances</a>
+</h3></div></div></div>
+<p>
+ The library significantly increases compile-time (and compiler memory usage)
+ when compiling the code with contracts turned on, compared with compilation
+ with contracts off. Investigate what is stressing compiler performances and
+ see if the library implementation can be optimized to improve compile-time
+ performances.
+ </p>
+<p>
+ The baseline should be compilation with all contracts turned off. There might
+ be different reasons for the increased compilation-time/memory:
+ </p>
+<div class="orderedlist"><ol type="1">
+<li>
+ Contract assertions are programmed in header files so they are recompiled
+ for each translation unit. I can test the effect of this by disabling pre/postcondition
+ compilation (so the library contract templates will still be compiled by
+ the user contracts will compile much less code in the header files because
+ there will be no pre/postcondition).
+ </li>
+<li>
+ The preprocessing time needed for the contract macros expansion and to
+ parse the <code class="computeroutput"><span class="identifier">sequence</span></code> macro
+ parameter. I can check this by stopping compilation after preprocessing
+ (<code class="computeroutput"><span class="special">-</span><span class="identifier">E</span></code>
+ compiler option) and measure how long preprocessing takes compared with
+ compilation.
+ </li>
+<li>
+ The library uses quite a bit of template metaprogramming (metafunctions,
+ etc). See how the compile-time effects of template metaprogramming were
+ analyzed for the Boost.MSM library and performance a similar analysis for
+ this library. Also study carefully the chapter on compile-time performances
+ of the Boost.MPL book.
+ </li>
+<li>
+ The library is intentionally making all the contract classes always templates
+ (using the artificial <code class="computeroutput"><span class="identifier">ZERO</span></code>
+ template argument so the library can internally use <code class="computeroutput"><span class="keyword">template</span><span class="special">/</span><span class="keyword">typename</span></code>
+ keywords regardless of the template context). What is the compile-time
+ effect of these extra contract template classes compared with the effect
+ if they have not been made templates using <code class="computeroutput"><span class="identifier">ZERO</span></code>?
+ <code class="computeroutput"><span class="identifier">ZERO</span></code> can be removed and
+ contract classes (for non-template functions) can be made non-template
+ but this comes at the cost of having the user specify <code class="computeroutput"><span class="special">(</span><span class="keyword">template</span><span class="special">)</span></code>
+ instead of <code class="computeroutput"><span class="special">(</span><span class="keyword">class</span><span class="special">)</span></code> for template classes (this complicates
+ the <code class="computeroutput"><span class="identifier">sequence</span></code> syntax) --
+ so the <code class="computeroutput"><span class="identifier">ZERO</span></code> workaround
+ should be removed only if there is evidence that it will help compile-time.
+ </li>
+<li>
+ More?
+ </li>
+</ol></div>
+<p>
+ Ultimately, this analysis should be added to the documentation.
+ </p>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="contract__.todo.analyze_run_time_performances"></a><a class="link" href="todo.html#contract__.todo.analyze_run_time_performances" title="Analyze run-time performances">Analyze
+ run-time performances</a>
+</h3></div></div></div>
+<p>
+ Provide some data to show run-time performances of contract checking -- the
+ baseline should be run-time performance with all contracts turned off.
+ </p>
+<p>
+ The library current implementation should be optimized to minimize run-time
+ overhead of contract checking. Preliminary data shows that the library run-time
+ performance impact (execution time, CPU usage, and memory usage) is acceptable.
+ However, data should be systematically collected and analyzed to verify this
+ (and then added to the documentation).
+ </p>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="contract__.todo.always_check_contract_assertion_syntax"></a><a class="link" href="todo.html#contract__.todo.always_check_contract_assertion_syntax" title="Always check contract assertion syntax">Always
+ check contract assertion syntax</a>
+</h3></div></div></div>
+<p>
+ If the precondition, postcondition, and invariant (dynamic and static) functions
+ are always left in the code, they are compiled and their assertions are check
+ for syntax errors. If they are not called, they add no run-time and/or object-size
+ overhead -- see the "test/check" analysis. The contract class should
+ be removed form the code instead when there is no contract and it should
+ only have pre/post when these are checked.
+ </p>
+<p>
+ A configuration macro <code class="computeroutput"><span class="identifier">CONTRACT_CONFIG_ALWAYS_CHECK_ASSERTION_SYNTAX</span></code>,
+ with default value 1, can be provided for programmers to disable assertion
+ syntax checking in order to reduce compilation time.
+ </p>
+<p>
+ How can I do this for <code class="computeroutput"><span class="identifier">CONTRACT_ASSERT_BLOCK_INVARIANT</span><span class="special">()</span></code> and <code class="computeroutput"><span class="identifier">CONTRACT_ASSERT_LOOP_VARIANT</span><span class="special">()</span></code>?
+ </p>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="contract__.todo.support_concurrency"></a><a class="link" href="todo.html#contract__.todo.support_concurrency" title="Support concurrency">Support concurrency</a>
+</h3></div></div></div>
+<p>
+ Understand what needs to be done to support concurrency.
+ </p>
+<p>
+ <a class="link" href="bibliography.html" title="Bibliography">[Meyer1997]</a> discusses issues
+ associated with Contract Programming and concurrency when, for example, a
+ precondition is first checked true but then the sate of the object is changed
+ asynchronously after the precondition check and before body execution so
+ at the time the body executes the checked precondition is no longer true.
+ Eiffel addresses this issue using the SCOOP concurrency model and implementing
+ waiting contract conditions.
+ </p>
+<p>
+ In general, it seems inappropriate for this library to force <span class="emphasis"><em>one</em></span>
+ concurrency model for Contract Programming in C++ (SCOOP, or any other).
+ Synchronization, including the one of contracts, might be best left up to
+ programmers as usual in C++. However, currently it is not possible to lock
+ a mutex at function entry and release it at function exit when using the
+ contract macros. This is because programmers can only program the body so
+ they can lock at body scope but not at the scope of the contracted function.
+ </p>
+<p>
+ More in general, the library could provide a mechanism to:
+ </p>
+<div class="orderedlist"><ol type="1">
+<li>
+ Acquire resources (including a locks) at function entry.
+ </li>
+<li>
+ Check invariants/preconditions, execute body, check invariants/postconditions
+ via calling contract's <code class="computeroutput"><span class="identifier">call</span><span class="special">()</span></code>.
+ </li>
+<li>
+ Release the acquired resources at function exit.
+ </li>
+</ol></div>
+<p>
+ For example:
+ </p>
+<pre class="programlisting"><span class="keyword">void</span> <span class="identifier">f</span><span class="special">(</span><span class="keyword">void</span><span class="special">)</span>
+<span class="identifier">CONTRACT_FUNCTION</span><span class="special">(</span> <span class="special">(</span><span class="keyword">void</span><span class="special">)</span> <span class="special">(</span><span class="identifier">f</span><span class="special">)(</span> <span class="special">(</span><span class="keyword">void</span><span class="special">)</span> <span class="special">)</span>
+<span class="bold"><strong>(scoped)</strong></span> <span class="special">(</span> <span class="comment">// In general, no `{` parenthesis here.
+</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">recursive_mutex</span><span class="special">::</span><span class="identifier">scoped_lock</span> <span class="identifier">lock</span><span class="special">(</span><span class="identifier">mutex</span><span class="special">);</span>
+ <span class="special">...</span> <span class="comment">// Eventually more here.
+</span><span class="special">)</span>
+<span class="special">(</span><span class="identifier">precondition</span><span class="special">)</span> <span class="special">({</span>
+ <span class="special">...</span>
+<span class="special">})</span>
+<span class="special">(</span><span class="identifier">postcondition</span><span class="special">)</span> <span class="special">({</span>
+ <span class="special">...</span>
+<span class="special">})</span>
+<span class="special">(</span><span class="identifier">body</span><span class="special">)</span> <span class="special">({</span>
+ <span class="special">...</span>
+<span class="special">})</span> <span class="special">)</span>
+
+<span class="comment">// If contracts compilation on, expands to something like this:
+</span><span class="keyword">void</span> <span class="identifier">f</span><span class="special">(</span><span class="keyword">void</span><span class="special">)</span>
+<span class="special">{</span>
+ <span class="identifier">boost</span><span class="special">::</span><span class="identifier">recursive_mutex</span><span class="special">::</span><span class="identifier">scoped_lock</span> <span class="identifier">lock</span><span class="special">(</span><span class="identifier">mutex</span><span class="special">);</span> <span class="comment">// Scoped resources.
+</span> <span class="identifier">contract_f_</span><span class="special">().</span><span class="identifier">call</span><span class="special">();</span> <span class="comment">// Contract call.
+</span><span class="special">}</span> <span class="comment">// Releases scoped resources via their destructors.
+</span><span class="special">...</span>
+
+<span class="comment">// If contracts compilation off, expands to something like this:
+</span><span class="keyword">void</span> <span class="identifier">f</span><span class="special">(</span><span class="keyword">void</span><span class="special">)</span>
+<span class="special">{</span>
+ <span class="identifier">boost</span><span class="special">::</span><span class="identifier">recursive_mutex</span><span class="special">::</span><span class="identifier">scoped_lock</span> <span class="identifier">lock</span><span class="special">(</span><span class="identifier">mutex</span><span class="special">);</span> <span class="comment">// Scoped resources.
+</span> <span class="special">...</span> <span class="comment">// Body code
+</span><span class="special">}</span> <span class="comment">// Releases scoped resources via their destructors.
+</span><span class="special">...</span>
+</pre>
+<p>
+ Note:
+ </p>
+<div class="itemizedlist"><ul type="disc">
+<li>
+ Even when contract compilation is turned off, the scoped code should be
+ part of the contract macro expansion together with the body code block.
+ </li>
+<li>
+ In general, the scoped code is <span class="emphasis"><em>not</em></span> a code block <code class="computeroutput"><span class="special">{</span> <span class="special">...</span> <span class="special">}</span></code>
+ (otherwise the acquired resources will be released at scope exit of the
+ code block before calling <code class="computeroutput"><span class="identifier">call</span><span class="special">()</span></code>) but multiple instructions can still
+ be specified.
+ </li>
+<li>
+ Should this scoped code be enforced constant-correct? Maybe not, it should
+ be contract-correct only if the contracted function is a <code class="computeroutput"><span class="keyword">const</span></code> member (same as for the body)... but
+ think more about this.
+ </li>
+</ul></div>
+<p>
+ In addition:
+ </p>
+<div class="orderedlist"><ol type="1">
+<li>
+ The library uses a global variable to "globally disable assertion
+ checking within assertion checking". This boolean variable should
+ be synchronized by the library in a concurrent context. However, this will
+ require a global lock... Can I implement "global disabling of assertion
+ checking within assertion checking" without a global state?
+ </li>
+<li>
+ The library uses the object member variable <code class="computeroutput"><span class="identifier">contract_state_</span></code>
+ to disable assertions within nested function calls for a given object.
+ This boolean member variable should be synchronized by the library in a
+ concurrent context. This synchronization is between object member functions,
+ it is not global, so it might be OK...
+ </li>
+<li>
+ If implemented, both global and object synchronizations should be enabled
+ only if a macro symbol <code class="computeroutput"><span class="identifier">CONTRACT_THREADING</span></code>
+ is #defined (#undef by default).
+ </li>
+<li>
+ Can I allow the user to configure how to synchronize global/object state?
+ For example, I could use a configuration macro that by default uses <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">recursive_mutex</span><span class="special">::</span><span class="identifier">lock</span><span class="special">()</span></code>
+ but it can be #redefined by the user...
+ </li>
+</ol></div>
+<p>
+ Most of these are open issues that need to be analysed in greater detail.
+ </p>
+<p>
+ <span class="bold"><strong>Or</strong></span>, probably a better approach is to add
+ a Concurrency subsection to the Contract Programming annex. This section
+ can be inspired by <a class="link" href="bibliography.html" title="Bibliography">[Meyer1997]</a>
+ and explain the issues of concurrency with respect to pre/post conditions
+ and inv checking. The section can then present the ideas of sync every function
+ call so to make sure that contract checking remains consistent with the body
+ execution during the entire function call. Also waiting conditions can be
+ explained here. Then this section can show how to implement this in C++ at
+ a level higher than the contracts (e.g., manually wrapping the contracted
+ function call):
+ </p>
+<pre class="programlisting"><span class="keyword">class</span> <span class="identifier">c</span> <span class="special">{</span>
+<span class="keyword">public</span><span class="special">:</span>
+ <span class="comment">// Just a wrap around f() that takes care of synchronization.
+</span> <span class="keyword">void</span> <span class="identifier">f</span><span class="special">(</span><span class="keyword">int</span> <span class="identifier">x</span><span class="special">)</span> <span class="special">{</span>
+ <span class="identifier">boost</span><span class="special">::</span><span class="identifier">recursive_mutex</span><span class="special">::</span><span class="identifier">scoped_lock</span> <span class="identifier">lock</span><span class="special">(</span><span class="identifier">mutex</span><span class="special">);</span>
+ <span class="identifier">f_sync</span><span class="special">(</span><span class="identifier">x</span><span class="special">);</span>
+ <span class="special">}</span>
+
+<span class="keyword">protected</span><span class="special">:</span>
+ <span class="comment">// Actual f() with its contract.
+</span> <span class="keyword">void</span> <span class="identifier">f_sync</span><span class="special">(</span><span class="keyword">int</span> <span class="identifier">x</span><span class="special">)</span>
+ <span class="identifier">CONTRACT_FUNCTION</span><span class="special">(</span> <span class="special">...</span> <span class="special">)</span>
+<span class="special">};</span>
+</pre>
+<p>
+ And maybe also suggest how to implement waiting conditions using a try-catch
+ statement (after contract are changed to throw instead of terminate). Then
+ it should be explained that while Eiffel supports sync and waiting conditions
+ by default using SCOOP, it is not appropriate for this library to enforce
+ one single concurrency schema (SCCOP, or any other) so concurrency is left
+ up to programmers handle outside the library.
+ </p>
+<p>
+ But what about the object state variable and the global assertion checking
+ variable? Are those also sync'ed by the muted above? Maybe the object state
+ is but the global assertion checking variable is probably not sync'ed...
+ </p>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="contract__.todo.can_constructor_member_initialization_list_limitation_be_removed_"></a><a class="link" href="todo.html#contract__.todo.can_constructor_member_initialization_list_limitation_be_removed_" title="Can constructor member initialization list limitation be removed?">Can
+ constructor member initialization list limitation be removed?</a>
+</h3></div></div></div>
+<p>
+ Can the contract macros overcome the constructor member initialization list
+ limitation when separating constructor definition from declaration? See current
+ workaround for this as documented in <code class="computeroutput"><span class="identifier">CONTRACT_CONSTRUCTOR_BODY</span><span class="special">()</span></code>.
+ </p>
+<p>
+ However, this would have to work for all combinations of the followings
+ </p>
+<div class="orderedlist"><ol type="1">
+<li>
+ With and without contracts.
+ </li>
+<li>
+ Definition together and separated from declaration.
+ </li>
+<li>
+ With and without member initialization list.
+ </li>
+</ol></div>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="contract__.todo.should_preconditions_be_checked_before_constructor_member_initialization_list_"></a><a class="link" href="todo.html#contract__.todo.should_preconditions_be_checked_before_constructor_member_initialization_list_" title="Should preconditions be checked before constructor member initialization list?">Should
+ preconditions be checked before constructor member initialization list?</a>
+</h3></div></div></div>
+<p>
+ The library checks constructor preconditions after executing the member initialization
+ list: {Default AND Pre}Body{Post AND Inv} (Default is the member initialization
+ list).
+ </p>
+<p>
+ This is essentially what Eiffel does but constructors (and member initialization
+ lists) are different in C++ than Eiffel. Is this what C++ should do or {Pre
+ AND Default} is a better approach for C++? Why does Eiffel do {Default AND
+ Pre}? Does any of the Contract Programming proposals for C++ mention this
+ issue explicitly? Implementing {Pre AND Default} for this library might present
+ similar challenges to separating constructor definition when member initialization
+ list is specified (so it might not be possible given the lack of delegating
+ constructors in C++...).
+ </p>
+<p>
+ If {Pre AND Default} is a better approach, {Default AND Pre} should be documented
+ as a library limitation. If {Default and Pre} is a better approach, I should
+ document why.
+ </p>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="contract__.todo.can_syntax_of_contract_macros_be_unified_with_other_boost_libraries_"></a><a class="link" href="todo.html#contract__.todo.can_syntax_of_contract_macros_be_unified_with_other_boost_libraries_" title="Can syntax of contract macros be unified with other Boost libraries?">Can
+ syntax of contract macros be unified with other Boost libraries?</a>
+</h3></div></div></div>
+<p>
+ Look if the contract macro <code class="computeroutput"><span class="identifier">sequence</span></code>
+ syntax can be unified with the one of other Boost libraries.
+ </p>
+<p>
+ Specifically, is this possible with respect to Boost.ConceptCheck and how
+ concept checking interacts with this Contract Programming library? Same questions
+ respect to Boost.Parameter. Any other Boost library I should study with respect
+ to this issue?
+ </p>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="contract__.todo.consider_allowing_optional_contract_checking_based_on_assertion_importance_and_or_class_name"></a><a class="link" href="todo.html#contract__.todo.consider_allowing_optional_contract_checking_based_on_assertion_importance_and_or_class_name" title="Consider allowing optional contract checking based on assertion importance and/or class name">Consider
+ allowing optional contract checking based on assertion importance and/or class
+ name</a>
+</h3></div></div></div>
+<p>
+ Let's assume I have a template library that is well tested so I want to disable
+ postcondition checking for it. However, this is a template library so it
+ cannot be precompiled separately with postconditions off. I must compile
+ it together with the rest of the code. Therefore, if the rest of the code
+ needs to check postconditions, I must check postconditions for the well tested
+ template library as well... The extra contract checking for the template
+ library introduces both compile-time and run-time overhead.
+ </p>
+<div class="itemizedlist"><ul type="disc"><li>
+ I could address this if the library allowed to disable contract checking
+ (at least at run-time) based on class and function name.
+ </li></ul></div>
+<p>
+ Moreover, there might be contract conditions which are very inefficient to
+ test so I might want to turn off checking <span class="emphasis"><em>only</em></span> for the
+ inefficient conditions. With respect to this issue, <a class="link" href="bibliography.html" title="Bibliography">[Mitchell2002]</a>
+ recommends to only program preconditions in Eiffel that can be checked efficiently
+ (as preconditions are usually left also in production code) and leave inefficient
+ preconditions documented as code comments.
+ </p>
+<div class="itemizedlist"><ul type="disc"><li>
+ I could address this by disabling contract checking (at least at run-time)
+ based on some assertion <span class="emphasis"><em>importance ordering</em></span> (assertion
+ importance ordering was removed from <a class="link" href="bibliography.html" title="Bibliography">[Crowl2006]</a>
+ but is was present in [Crowl2005]).
+ </li></ul></div>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="contract__.todo.consider_adding_contracts_to_all_stl_classes_and_functions_in__contract__std___"></a><a class="link" href="todo.html#contract__.todo.consider_adding_contracts_to_all_stl_classes_and_functions_in__contract__std___" title="Consider adding contracts to all STL classes and functions in contract::std::">Consider
+ adding contracts to all STL classes and functions in <code class="computeroutput"><span class="identifier">contract</span><span class="special">::</span><span class="identifier">std</span><span class="special">::</span></code></a>
+</h3></div></div></div>
+<p>
+ All <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span></code>
+ classes and functions could be wrapped by classes and functions in a namespace
+ <code class="computeroutput"><span class="identifier">contract</span><span class="special">::</span><span class="identifier">std</span><span class="special">::</span></code> declaring
+ contracts for all the STL classes and functions. The <code class="computeroutput"><span class="identifier">contract</span><span class="special">::</span><span class="identifier">std</span><span class="special">::</span></code>
+ namespace should have the <span class="emphasis"><em>exact</em></span> same structure as <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span></code> (so
+ it is easy to use for C++ programmers familiar with STL).
+ </p>
+<p>
+ For example a <code class="computeroutput"><span class="identifier">contract</span><span class="special">::</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">vector</span></code>
+ class can wrap <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">vector</span></code> providing the exact same API but
+ adding contracts to it (similar to the STL Vector <a class="link" href="examples.html" title="Examples">Example</a>
+ but int the <code class="computeroutput"><span class="identifier">contract</span><span class="special">::</span><span class="identifier">std</span><span class="special">::</span></code> namespace).
+ </p>
+<div class="itemizedlist"><ul type="disc">
+<li>
+ The contracts could assert all the STL standard guarantees.
+ </li>
+<li>
+ Postcondition and invariant checking might not add much value given that
+ STL implementations are usually well tested, documented, and work well.
+ </li>
+<li>
+ Precondition checking might instead be valuable as they will check that
+ the STL is not misused by the callers.
+ </li>
+</ul></div>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="contract__.todo.should_i_provide__contract_xyz_decl____macros_"></a><a class="link" href="todo.html#contract__.todo.should_i_provide__contract_xyz_decl____macros_" title="Should I provide CONTRACT_XYZ_DECL() macros?">Should
+ I provide <code class="computeroutput"><span class="identifier">CONTRACT_XYZ_DECL</span><span class="special">()</span></code> macros?</a>
+</h3></div></div></div>
+<p>
+ Two family of macros could be provided:
+ </p>
+<div class="orderedlist"><ol type="1">
+<li>
+<code class="computeroutput"><span class="identifier">CONTRACT_CLASS</span><span class="special">()</span></code>
+ and <code class="computeroutput"><span class="identifier">CONTRACT_FUNCTION</span><span class="special">()</span></code>
+ which follow the relative class and function declarations as coded by the
+ programmers.
+ </li>
+<li>
+<code class="computeroutput"><span class="identifier">CONTRACT_CLASS_DECL</span><span class="special">()</span></code>
+ and <code class="computeroutput"><span class="identifier">CONTRACT_FUNCTION_DECL</span><span class="special">()</span></code> which also automatically program the
+ class and function declarations so programmers do not have to code the
+ declarations manually outside the contracts.
+ </li>
+</ol></div>
+<p>
+ The <code class="computeroutput"><span class="identifier">CONTRACT_XYZ_DECL</span><span class="special">()</span></code>
+ macros have the following pro (+) and cons (-) compared to the <code class="computeroutput"><span class="identifier">CONTRACT_XYZ</span><span class="special">()</span></code>
+ macros:
+ </p>
+<div class="orderedlist"><ol type="1">
+<li>
+ (+) There is no code duplication when using <code class="computeroutput"><span class="identifier">CONTRACT_XYZ_DECL</span><span class="special">()</span></code> (because the signature tokens only appear
+ within the macro and not also before the macro).
+ </li>
+<li>
+ (+) When using <code class="computeroutput"><span class="identifier">CONTRACT_XYZ_DECL</span><span class="special">()</span></code>, the declarations tokens will always
+ match the ones in the contract because they are not duplicated. When using
+ the <code class="computeroutput"><span class="identifier">CONTRACT_XYZ</span><span class="special">()</span></code>
+ macros instead, a mismatch between the declaration and the contract signature
+ tokens will generate a compiler error in most, but not all, cases.
+ </li>
+<li>
+ (-) The code using <code class="computeroutput"><span class="identifier">CONTRACT_XYZ_DECL</span><span class="special">()</span></code> is more difficult to read to whom does
+ not know the library syntax because all usual C++ syntax is gone.
+ </li>
+<li>
+ (-) All compiler errors for the class will appear with the same line number
+ because the <code class="computeroutput"><span class="identifier">CONTRACT_CLASS_DECL</span><span class="special">()</span></code> macro will expand on a single line. I
+ think this is a major defect of the <code class="computeroutput"><span class="identifier">CONTRACT_XYZ_DECL</span><span class="special">()</span></code> macros because it will make C++ compiler
+ error even harder to track than they currently are.
+ </li>
+<li>
+ (~) The <code class="computeroutput"><span class="identifier">CONTRACT_XYZ_DECL</span><span class="special">()</span></code> macros will need to accept additional
+ information like inheritance access level, default parameter values, exception
+ specifications, etc. However, the <code class="computeroutput"><span class="identifier">CONTRACT_XYZ</span><span class="special">()</span></code> macros already contain most of the syntactic
+ token of class and function declarations so this is not much of a complication
+ of the macro signature syntax.
+ </li>
+</ol></div>
+<div class="table">
+<a name="id2674416"></a><p class="title"><b>Table 2. Example with and without the macros.</b></p>
+<div class="table-contents"><table class="table" summary="Example with and without the macros.">
+<colgroup>
+<col>
+<col>
+</colgroup>
+<thead><tr>
+<th>
+ <p>
+ <code class="computeroutput"><span class="identifier">CONTRACT_XYZ</span><span class="special">()</span></code>
+ Macros
+ </p>
+ </th>
+<th>
+ <p>
+ <code class="computeroutput"><span class="identifier">CONTRACT_XYZ_DECL</span><span class="special">()</span></code>
+ Macros
+ </p>
+ </th>
+</tr></thead>
+<tbody><tr>
+<td>
+ <p>
+
+</p>
+<pre class="programlisting"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> <span class="identifier">T</span><span class="special">&gt;</span>
+<span class="keyword">class</span> <span class="identifier">myvector</span><span class="special">:</span> <span class="keyword">public</span> <span class="identifier">pushable</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">&gt;</span> <span class="special">{</span>
+
+ <span class="identifier">CONTRACT_CLASS</span><span class="special">(</span> <span class="special">(</span><span class="identifier">myvector</span><span class="special">)</span> <span class="special">(</span><span class="keyword">public</span><span class="special">)(</span><span class="identifier">pushable</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">&gt;)</span>
+ <span class="special">(</span><span class="identifier">invariant</span><span class="special">)</span> <span class="special">({</span>
+ <span class="identifier">CONTRACT_ASSERT</span><span class="special">(</span> <span class="special">(</span><span class="identifier">size</span><span class="special">()</span> <span class="special">==</span> <span class="number">0</span><span class="special">)</span> <span class="special">==</span> <span class="identifier">empty</span><span class="special">()</span> <span class="special">);</span>
+ <span class="special">})</span> <span class="special">)</span>
+
+<span class="keyword">public</span><span class="special">:</span>
+ <span class="keyword">void</span> <span class="identifier">push_back</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">T</span><span class="special">&amp;</span> <span class="identifier">element</span><span class="special">)</span>
+ <span class="identifier">CONTRACT_FUNCTION</span><span class="special">(</span>
+ <span class="special">(</span><span class="keyword">public</span><span class="special">)</span> <span class="special">(</span><span class="keyword">void</span><span class="special">)</span> <span class="special">(</span><span class="identifier">push_back</span><span class="special">)(</span> <span class="special">(</span><span class="keyword">const</span> <span class="identifier">T</span><span class="special">&amp;)(</span><span class="identifier">element</span><span class="special">)</span> <span class="special">)</span> <span class="special">(</span><span class="identifier">copyable</span><span class="special">)</span>
+ <span class="special">(</span><span class="identifier">precondition</span><span class="special">)</span> <span class="special">({</span>
+ <span class="identifier">CONTRACT_ASSERT</span><span class="special">(</span> <span class="identifier">size</span><span class="special">()</span> <span class="special">&lt;</span> <span class="identifier">max_size</span><span class="special">()</span> <span class="special">);</span>
+ <span class="special">})</span>
+ <span class="special">(</span><span class="identifier">postcondition</span><span class="special">)</span> <span class="special">({</span>
+ <span class="identifier">CONTRACT_ASSERT</span><span class="special">(</span> <span class="identifier">size</span><span class="special">()</span> <span class="special">==</span> <span class="special">(</span><span class="identifier">CONTRACT_OLDOF</span><span class="special">(</span><span class="keyword">this</span><span class="special">)-&gt;</span><span class="identifier">size</span><span class="special">()</span> <span class="special">+</span> <span class="number">1</span><span class="special">)</span> <span class="special">);</span>
+ <span class="special">})</span>
+ <span class="special">(</span><span class="identifier">body</span><span class="special">)</span> <span class="special">({</span>
+ <span class="identifier">vector_</span><span class="special">.</span><span class="identifier">push_back</span><span class="special">(</span><span class="identifier">element</span><span class="special">);</span>
+ <span class="special">})</span> <span class="special">)</span>
+
+ <span class="keyword">typedef</span> <span class="keyword">typename</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">vector</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">&gt;::</span><span class="identifier">size_type</span> <span class="identifier">size_type</span><span class="special">;</span>
+ <span class="identifier">size_type</span> <span class="identifier">size</span><span class="special">(</span><span class="keyword">void</span><span class="special">)</span> <span class="keyword">const</span> <span class="special">{</span> <span class="keyword">return</span> <span class="identifier">vector_</span><span class="special">.</span><span class="identifier">size</span><span class="special">();</span> <span class="special">}</span>
+ <span class="identifier">size_type</span> <span class="identifier">max_size</span><span class="special">(</span><span class="keyword">void</span><span class="special">)</span> <span class="keyword">const</span> <span class="special">{</span> <span class="keyword">return</span> <span class="identifier">vector_</span><span class="special">.</span><span class="identifier">max_size</span><span class="special">();</span> <span class="special">}</span>
+ <span class="keyword">bool</span> <span class="identifier">empty</span><span class="special">(</span><span class="keyword">void</span><span class="special">)</span> <span class="keyword">const</span> <span class="special">{</span> <span class="keyword">return</span> <span class="identifier">vector_</span><span class="special">.</span><span class="identifier">empty</span><span class="special">();</span> <span class="special">}</span>
+ <span class="keyword">const</span> <span class="identifier">T</span><span class="special">&amp;</span> <span class="identifier">back</span><span class="special">(</span><span class="keyword">void</span><span class="special">)</span> <span class="keyword">const</span> <span class="special">{</span> <span class="keyword">return</span> <span class="identifier">vector_</span><span class="special">.</span><span class="identifier">back</span><span class="special">();</span> <span class="special">}</span>
+<span class="keyword">private</span><span class="special">:</span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">vector</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">&gt;</span> <span class="identifier">vector_</span><span class="special">;</span>
+<span class="special">};</span>
+</pre>
+<p>
+ </p>
+ </td>
+<td>
+ <p>
+
+</p>
+<pre class="programlisting"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> <span class="identifier">T</span><span class="special">&gt;</span>
+<span class="identifier">CONTRACT_CLASS_DECL</span><span class="special">(</span> <span class="special">(</span><span class="identifier">myvector</span><span class="special">)</span> <span class="special">(</span><span class="keyword">public</span><span class="special">)(</span><span class="identifier">pushable</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">&gt;)</span>
+
+ <span class="special">(</span><span class="identifier">invariant</span><span class="special">)</span> <span class="special">({</span>
+ <span class="identifier">CONTRACT_ASSERT</span><span class="special">(</span> <span class="special">(</span><span class="identifier">size</span><span class="special">()</span> <span class="special">==</span> <span class="number">0</span><span class="special">)</span> <span class="special">==</span> <span class="identifier">empty</span><span class="special">()</span> <span class="special">);</span>
+ <span class="special">})</span>
+
+<span class="special">(</span> <span class="comment">// No class `{};` parenthesis.
+</span>
+ <span class="identifier">CONTRACT_FUNCTION_DECL</span><span class="special">(</span>
+ <span class="special">(</span><span class="keyword">public</span><span class="special">)</span> <span class="special">(</span><span class="keyword">void</span><span class="special">)</span> <span class="special">(</span><span class="identifier">push_back</span><span class="special">)(</span> <span class="special">(</span><span class="keyword">const</span> <span class="identifier">T</span><span class="special">&amp;)(</span><span class="identifier">element</span><span class="special">)</span> <span class="special">)</span> <span class="special">(</span><span class="identifier">copyable</span><span class="special">)</span>
+ <span class="special">(</span><span class="identifier">precondition</span><span class="special">)</span> <span class="special">({</span>
+ <span class="identifier">CONTRACT_ASSERT</span><span class="special">(</span> <span class="identifier">size</span><span class="special">()</span> <span class="special">&lt;</span> <span class="identifier">max_size</span><span class="special">()</span> <span class="special">);</span>
+ <span class="special">})</span>
+ <span class="special">(</span><span class="identifier">postcondition</span><span class="special">)</span> <span class="special">({</span>
+ <span class="identifier">CONTRACT_ASSERT</span><span class="special">(</span> <span class="identifier">size</span><span class="special">()</span> <span class="special">==</span> <span class="special">(</span><span class="identifier">CONTRACT_OLDOF</span><span class="special">(</span><span class="keyword">this</span><span class="special">)-&gt;</span><span class="identifier">size</span><span class="special">()</span> <span class="special">+</span> <span class="number">1</span><span class="special">)</span> <span class="special">);</span>
+ <span class="special">})</span>
+ <span class="special">(</span><span class="identifier">body</span><span class="special">)</span> <span class="special">({</span>
+ <span class="identifier">vector_</span><span class="special">.</span><span class="identifier">push_back</span><span class="special">(</span><span class="identifier">element</span><span class="special">);</span>
+ <span class="special">})</span> <span class="special">)</span>
+
+ <span class="comment">// Usual C++ class-scope code still works.
+</span> <span class="keyword">typedef</span> <span class="keyword">typename</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">vector</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">&gt;::</span><span class="identifier">size_type</span> <span class="identifier">size_type</span><span class="special">;</span>
+ <span class="identifier">size_type</span> <span class="identifier">size</span><span class="special">(</span><span class="keyword">void</span><span class="special">)</span> <span class="keyword">const</span> <span class="special">{</span> <span class="keyword">return</span> <span class="identifier">vector_</span><span class="special">.</span><span class="identifier">size</span><span class="special">();</span> <span class="special">}</span>
+ <span class="identifier">size_type</span> <span class="identifier">max_size</span><span class="special">(</span><span class="keyword">void</span><span class="special">)</span> <span class="keyword">const</span> <span class="special">{</span> <span class="keyword">return</span> <span class="identifier">vector_</span><span class="special">.</span><span class="identifier">max_size</span><span class="special">();</span> <span class="special">}</span>
+ <span class="keyword">bool</span> <span class="identifier">empty</span><span class="special">(</span><span class="keyword">void</span><span class="special">)</span> <span class="keyword">const</span> <span class="special">{</span> <span class="keyword">return</span> <span class="identifier">vector_</span><span class="special">.</span><span class="identifier">empty</span><span class="special">();</span> <span class="special">}</span>
+ <span class="keyword">const</span> <span class="identifier">T</span><span class="special">&amp;</span> <span class="identifier">back</span><span class="special">(</span><span class="keyword">void</span><span class="special">)</span> <span class="keyword">const</span> <span class="special">{</span> <span class="keyword">return</span> <span class="identifier">vector_</span><span class="special">.</span><span class="identifier">back</span><span class="special">();</span> <span class="special">}</span>
+<span class="keyword">private</span><span class="special">:</span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">vector</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">&gt;</span> <span class="identifier">vector_</span><span class="special">;</span>
+<span class="special">)</span> <span class="special">)</span>
+</pre>
+<p>
+ </p>
+ </td>
+</tr></tbody>
+</table></div>
+</div>
+<br class="table-break"><p>
+ The syntax of <code class="computeroutput"><span class="identifier">CONTRACT_XYZ_DECL</span><span class="special">()</span></code>, and consequently <code class="computeroutput"><span class="identifier">CONTRACT_XYZ</span><span class="special">()</span></code>, needs to be extended to include <span class="emphasis"><em>all</em></span>
+ class and function signature tokens:
+ </p>
+<pre class="programlisting"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> <span class="identifier">T</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">U</span><span class="special">&gt;</span>
+<span class="comment">// class z: public x, protected y
+</span><span class="identifier">CONTRACT_CLASS_DECL</span><span class="special">(</span> <span class="special">(</span><span class="identifier">z</span><span class="special">)</span> <span class="special">(</span><span class="keyword">public</span><span class="special">)(</span><span class="identifier">x</span><span class="special">)</span> <span class="special">(</span><span class="keyword">public</span><span class="special">)(</span><span class="identifier">y</span><span class="special">)</span>
+
+ <span class="special">(</span><span class="keyword">static</span><span class="special">)</span> <span class="special">(</span><span class="identifier">invariant</span><span class="special">)</span> <span class="special">({</span>
+ <span class="special">...</span>
+ <span class="special">})</span>
+ <span class="special">(</span><span class="identifier">invariant</span><span class="special">)</span> <span class="special">({</span>
+ <span class="special">...</span>
+ <span class="special">})</span>
+
+<span class="special">(</span>
+ <span class="keyword">class</span> <span class="identifier">X</span> <span class="special">{};</span> <span class="keyword">class</span> <span class="identifier">Y</span><span class="special">{};</span>
+
+ <span class="comment">// void f(register int i = 0, auto double d = 0.0) throw(X, Y)
+</span> <span class="identifier">CONTRACT_FUNCTION_DECL</span><span class="special">(</span>
+ <span class="special">(</span><span class="keyword">public</span><span class="special">)</span> <span class="special">(</span><span class="keyword">void</span><span class="special">)</span> <span class="special">(</span><span class="identifier">f</span><span class="special">)(</span>
+ <span class="special">(</span><span class="keyword">register</span><span class="special">)(</span><span class="keyword">int</span><span class="special">)</span> <span class="special">(</span><span class="identifier">x</span><span class="special">)</span> <span class="special">(</span><span class="keyword">default</span><span class="special">)(</span><span class="number">0</span><span class="special">)</span>
+ <span class="special">(</span><span class="keyword">auto</span><span class="special">)(</span><span class="keyword">double</span><span class="special">)</span> <span class="special">(</span><span class="identifier">d</span><span class="special">)</span> <span class="special">(</span><span class="keyword">default</span><span class="special">)(</span><span class="number">0.0</span><span class="special">)</span>
+ <span class="special">)</span> <span class="special">(</span><span class="keyword">throw</span><span class="special">)(</span> <span class="special">(</span><span class="identifier">X</span><span class="special">)</span> <span class="special">(</span><span class="identifier">Y</span><span class="special">)</span> <span class="special">)</span>
+ <span class="special">(</span><span class="identifier">precondition</span><span class="special">)</span> <span class="special">({</span>
+ <span class="special">...</span>
+ <span class="special">})</span>
+ <span class="special">(</span><span class="identifier">postcondition</span><span class="special">)</span> <span class="special">({</span>
+ <span class="special">...</span>
+ <span class="special">})</span>
+ <span class="special">(</span><span class="identifier">body</span><span class="special">)</span> <span class="special">(</span>
+ <span class="special">...</span>
+ <span class="special">)</span> <span class="special">)</span>
+
+ <span class="special">...</span>
+<span class="special">)</span> <span class="special">)</span>
+</pre>
+<div class="itemizedlist"><ul type="disc">
+<li>
+ Default function parameters indicated using <code class="computeroutput"><span class="keyword">default</span></code>
+ (<code class="computeroutput"><span class="special">=</span></code> symbol cannot be used because
+ it cannot be parsed by the preprocessor). Default is already a keyword
+ (for <code class="computeroutput"><span class="keyword">switch</span><span class="special">()</span></code>)
+ so it works nicely as it already know by programmers (even if in a different
+ context), it will be highlighted by most editors, etc.
+ </li>
+<li>
+ Exceptions specifications are supported using a preprocessor sequence (instead
+ of the usual comma-separated syntax). This is the same syntax already used
+ for both function arguments and template parameters.
+ </li>
+<li>
+ Auto and register qualifier are added to the the function argument list
+ (before the type).
+ </li>
+<li>
+ The <code class="computeroutput"><span class="keyword">friend</span></code> keyword still does
+ not need to be supported because contracts must appear with the class/function
+ declaration. Therefore, friend is used to forward declare the class/function
+ and then contracts are specified where the class/function is actually defined.
+ This approach still maintain the friend functionality with the only limitation
+ that friend functions cannot be defined where they are declared friends
+ (C++ already enforces this constraint but only for classes).
+ </li>
+<li>
+ The <code class="computeroutput"><span class="keyword">union</span></code> keyword is still
+ not supported for <code class="computeroutput"><span class="identifier">CONTRACT_CLASS</span><span class="special">()</span><span class="identifier">_DECL</span></code>
+ because contracts are not supported for unions (only for classes and structs).
+ </li>
+<li>
+ All other C++ keywords are already included in the class/function signatures
+ even if not shown in the example above.
+ </li>
+</ul></div>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="contract__.todo.shall_i_remove_the__assert____macros_"></a><a class="link" href="todo.html#contract__.todo.shall_i_remove_the__assert____macros_" title="Shall I remove the ASSERT() macros?">Shall
+ I remove the <code class="computeroutput"><span class="identifier">ASSERT</span><span class="special">()</span></code>
+ macros?</a>
+</h3></div></div></div>
+<p>
+ I am not sure if this would make the syntax better or worst...
+ </p>
+<p>
+ Would removing the <code class="computeroutput"><span class="identifier">CONTRACT_ASSERT</span><span class="special">()</span></code> "simplify" the syntax making
+ it more inline with [Crowl2006]? It might not because the code would look
+ more like [Crowl2006] but it might look less like C++ and be harder to understand...
+ </p>
+<p>
+ Removing the macros will enforce the constraint that contract code is kept
+ simple and to just a list of assertions (with eventual if-guards). However,
+ this constraint makes 100% sense for CP language support but a library might
+ be better off leaving this up to the programmer as a good practice.
+ </p>
+<p>
+ Furthermore, the assertion if-guard imposes the limit that all assertion
+ must start with a word (no symbol). For istance <code class="computeroutput"><span class="special">(</span><span class="identifier">x</span> <span class="special">==</span> <span class="number">3</span><span class="special">)</span> <span class="special">&amp;&amp;</span> <span class="special">(</span><span class="identifier">y</span> <span class="special">==</span>
+ <span class="number">4</span><span class="special">)</span></code>
+ is not a valid assertion (it will not pass the preprocessor). However, these
+ assertions could be wrapped by <code class="computeroutput"><span class="identifier">contract</span><span class="special">::</span><span class="identifier">identity</span><span class="special">((</span><span class="identifier">x</span> <span class="special">==</span>
+ <span class="number">3</span><span class="special">)</span> <span class="special">&amp;&amp;</span> <span class="special">(</span><span class="identifier">y</span> <span class="special">==</span> <span class="number">4</span><span class="special">))</span></code> as a workaround... would this acceptable?
+ </p>
+<pre class="programlisting"><span class="keyword">namespace</span> <span class="identifier">contract</span> <span class="special">{</span>
+<span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> <span class="identifier">T</span><span class="special">&gt;</span>
+<span class="keyword">const</span> <span class="identifier">T</span><span class="special">&amp;</span> <span class="identifier">identity</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">T</span><span class="special">&amp;</span> <span class="identifier">condition</span><span class="special">)</span> <span class="special">{</span> <span class="keyword">return</span> <span class="identifier">condition</span><span class="special">;</span> <span class="special">}</span>
+<span class="special">}</span> <span class="comment">// namespace
+</span>
+<span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">T</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Alloc</span> <span class="special">=</span> <span class="identifier">allocator</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">&gt;</span> <span class="special">&gt;</span>
+<span class="identifier">CONTRACT_CLASS_DECL</span><span class="special">(</span> <span class="special">(</span><span class="identifier">vector</span><span class="special">)</span>
+
+ <span class="special">(</span><span class="identifier">invariant</span><span class="special">)</span> <span class="special">(</span>
+ <span class="special">(</span> <span class="special">(</span><span class="identifier">size</span><span class="special">()</span> <span class="special">==</span> <span class="number">0</span><span class="special">)</span> <span class="special">==</span> <span class="identifier">empty</span><span class="special">()</span> <span class="special">)</span>
+ <span class="special">)</span>
+
+<span class="special">(</span>
+
+<span class="keyword">public</span><span class="special">:</span>
+ <span class="keyword">typedef</span> <span class="keyword">typename</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">vector</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">&gt;::</span><span class="identifier">iterator</span> <span class="identifier">iterator</span><span class="special">;</span>
+
+ <span class="identifier">CONTRACT_FUNCTION_DECL</span><span class="special">(</span>
+ <span class="special">(</span><span class="keyword">public</span><span class="special">)</span> <span class="special">(</span><span class="identifier">iterator</span><span class="special">)</span> <span class="special">(</span><span class="identifier">erase</span><span class="special">)(</span>
+ <span class="special">(</span><span class="identifier">iterator</span><span class="special">)(</span><span class="identifier">first</span><span class="special">)</span> <span class="special">(</span><span class="identifier">iterator</span><span class="special">)(</span><span class="identifier">last</span><span class="special">)</span> <span class="special">)</span> <span class="special">(</span><span class="identifier">copyable</span><span class="special">)</span>
+ <span class="special">(</span><span class="identifier">precondition</span><span class="special">)</span> <span class="special">(</span>
+ <span class="comment">// No code block `({ ... })`. Assertions are just a sequence
+</span> <span class="comment">// of booleanable expressions.
+</span> <span class="special">(</span> <span class="identifier">size</span><span class="special">()</span> <span class="special">&gt;=</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">distance</span><span class="special">(</span><span class="identifier">first</span><span class="special">,</span> <span class="identifier">last</span><span class="special">)</span> <span class="special">)</span>
+ <span class="special">)</span>
+ <span class="special">(</span><span class="identifier">postcondition</span><span class="special">)</span> <span class="special">(</span><span class="identifier">result</span><span class="special">)</span> <span class="special">(</span>
+ <span class="special">(</span> <span class="identifier">size</span><span class="special">()</span> <span class="special">==</span> <span class="identifier">CONTRACT_OLDOF</span><span class="special">(</span><span class="keyword">this</span><span class="special">)-&gt;</span><span class="identifier">size</span><span class="special">()</span> <span class="special">-</span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">distance</span><span class="special">(</span><span class="identifier">first</span><span class="special">,</span> <span class="identifier">last</span><span class="special">)</span> <span class="special">)</span>
+ <span class="special">(</span> <span class="keyword">if</span> <span class="special">(</span><span class="identifier">empty</span><span class="special">())</span> <span class="special">(</span><span class="identifier">result</span> <span class="special">==</span> <span class="identifier">end</span><span class="special">())</span> <span class="special">)</span> <span class="comment">// Assertion with if-guard.
+</span> <span class="special">)</span>
+ <span class="special">(</span>
+ <span class="keyword">return</span> <span class="identifier">vector_</span><span class="special">.</span><span class="identifier">erase</span><span class="special">(</span><span class="identifier">first</span><span class="special">,</span> <span class="identifier">last</span><span class="special">);</span>
+ <span class="special">)</span> <span class="special">)</span>
+
+<span class="keyword">private</span><span class="special">:</span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">vector</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">&gt;</span> <span class="identifier">vector_</span><span class="special">;</span>
+<span class="special">)</span> <span class="special">)</span>
+</pre>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="contract__.todo.fusing_contracts__concepts__named_parameters__etc_"></a><a class="link" href="todo.html#contract__.todo.fusing_contracts__concepts__named_parameters__etc_" title="Fusing contracts, concepts, named parameters, etc.">Fusing
+ contracts, concepts, named parameters, etc.</a>
+</h3></div></div></div>
+<p>
+ Consider the following C++0x-like example (inspired from ConceptC++ http://www.generic-programming.org/languages/conceptcpp class="emphasis"><em>tutorial</em></span>
+ and C++ Contract Programming proposal [Crowl2006]):
+ </p>
+<pre class="programlisting"><span class="comment">// Example strangely uses pointers instead of iterators just to have preconditions.
+</span><span class="keyword">template</span><span class="special">&lt;</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">CopyConstructible</span> <span class="identifier">T</span><span class="special">&gt;</span>
+ <span class="identifier">requires</span> <span class="identifier">Addable</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">&gt;,</span> <span class="identifier">Assignable</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">&gt;</span> <span class="comment">// Concepts.
+</span><span class="identifier">T</span> <span class="identifier">sum</span><span class="special">(</span><span class="identifier">T</span><span class="special">*</span> <span class="identifier">first</span><span class="special">,</span> <span class="identifier">T</span><span class="special">*</span> <span class="identifier">last</span><span class="special">,</span> <span class="identifier">T</span> <span class="identifier">result</span><span class="special">)</span>
+ <span class="identifier">preconditions</span> <span class="special">{</span> <span class="identifier">first</span><span class="special">;</span> <span class="identifier">last</span><span class="special">;</span> <span class="special">}</span> <span class="comment">// Pointer not null.
+</span> <span class="identifier">postconditions</span> <span class="special">(</span><span class="identifier">total</span><span class="special">)</span> <span class="special">{</span> <span class="identifier">total</span> <span class="special">==</span> <span class="identifier">result</span><span class="special">;</span> <span class="special">}</span> <span class="comment">// Returning result.
+</span><span class="special">{</span>
+ <span class="keyword">for</span> <span class="special">(;</span> <span class="identifier">first</span> <span class="special">!=</span> <span class="identifier">last</span><span class="special">;</span> <span class="special">++</span><span class="identifier">first</span><span class="special">)</span>
+ <span class="identifier">result</span> <span class="special">=</span> <span class="identifier">result</span> <span class="special">+</span> <span class="special">*</span><span class="identifier">first</span><span class="special">;</span>
+ <span class="keyword">return</span> <span class="identifier">result</span><span class="special">;</span>
+<span class="special">}</span>
+</pre>
+<p>
+ "What do you think of the following macro that implements this in ISO
+ standard C++ by wrapping the above C++0x-like syntax within a preprocessor
+ sequence?" I have asked this question to Boosters.
+ </p>
+<pre class="programlisting"><span class="identifier">CPP0X_FUNCTION</span><span class="special">(</span>
+<span class="special">(</span><span class="keyword">template</span><span class="special">)(</span> <span class="special">(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">CopyConstructible</span><span class="special">)(</span><span class="identifier">T</span><span class="special">)</span> <span class="special">)</span>
+ <span class="special">(</span><span class="identifier">requires</span><span class="special">)(</span> <span class="special">(</span><span class="identifier">Addable</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">&gt;)</span> <span class="special">(</span><span class="identifier">Assignable</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">&gt;)</span> <span class="special">)</span>
+<span class="special">(</span><span class="identifier">T</span><span class="special">)</span> <span class="special">(</span><span class="identifier">sum</span><span class="special">)(</span> <span class="special">(</span><span class="identifier">T</span><span class="special">*)(</span><span class="identifier">first</span><span class="special">)</span> <span class="special">(</span><span class="identifier">T</span><span class="special">*)(</span><span class="identifier">last</span><span class="special">)</span> <span class="special">(</span><span class="identifier">T</span><span class="special">)(</span><span class="identifier">result</span><span class="special">)</span> <span class="special">)</span>
+ <span class="special">(</span><span class="identifier">preconditions</span><span class="special">)(</span> <span class="special">(</span><span class="identifier">first</span><span class="special">)</span> <span class="special">(</span><span class="identifier">last</span><span class="special">)</span> <span class="special">)</span>
+ <span class="special">(</span><span class="identifier">postconditions</span><span class="special">)(</span><span class="identifier">total</span><span class="special">)(</span> <span class="special">(</span><span class="identifier">total</span> <span class="special">==</span> <span class="identifier">result</span><span class="special">)</span> <span class="special">)</span>
+<span class="special">({</span>
+ <span class="keyword">for</span> <span class="special">(;</span> <span class="identifier">first</span> <span class="special">!=</span> <span class="identifier">last</span><span class="special">;</span> <span class="special">++</span><span class="identifier">first</span><span class="special">)</span>
+ <span class="identifier">result</span> <span class="special">=</span> <span class="identifier">result</span> <span class="special">+</span> <span class="special">*</span><span class="identifier">first</span><span class="special">;</span>
+ <span class="keyword">return</span> <span class="identifier">result</span><span class="special">;</span>
+<span class="special">})</span> <span class="special">)</span>
+</pre>
+<p>
+ The idea is that using the preprocessor I can parse the signature-sequence
+ so I have all the tokens needed to declare/define the C++ function plus its
+ concepts (Boost.Concept), contracts (Boost.Contract), named parameters (Boost.Parameter),
+ etc. Furthermore, the syntax of signature-sequence can be any valid preprocessor
+ sequence that uses words (not symbols) for keywords (e.g., (requires) and
+ (preconditions) are OK but (=) is not). So I can define the signature-sequence
+ syntax to closely match the syntax of C++0x and of other C++ standard proposals
+ (like [Crowl2006]).
+ </p>
+<p>
+ This syntax is not worst than the current Contract++ one. Therefore, it would
+ seem that at least the Contract++ macros should be extended to support concepts
+ (interfacing with Boost.Concept) and possibly also named parameters (interfacing
+ with Boost.Parameter).
+ </p>
+</div>
+</div>
+<table xmlns:rev="
http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
+<td align="left"></td>
+<td align="right"><div class="copyright-footer">Copyright © 2009 -2010 Lorenzo Caminiti<p>
+ Distributed under the Contract++ Software License, Version 1.0 (see accompanying
+ file LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="release_history.html"><img src=".././doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src=".././doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src=".././doc/html/images/home.png" alt="Home"></a>
+</div>
+</body>
+</html>

Added: sandbox/contract/libs/contract/doc/html/contract__/tutorial.html
==============================================================================
--- (empty file)
+++ sandbox/contract/libs/contract/doc/html/contract__/tutorial.html 2011-06-28 20:54:41 EDT (Tue, 28 Jun 2011)
@@ -0,0 +1,3343 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
+<title>Tutorial</title>
+<link rel="stylesheet" href="../doc/html/boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
+<link rel="home" href="../index.html" title="Contract++ 0.3.490">
+<link rel="up" href="../index.html" title="Contract++ 0.3.490">
+<link rel="prev" href="getting_started.html" title="Getting Started">
+<link rel="next" href="without_the_macros.html" title="Without the Macros">
+</head>
+<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
+<table cellpadding="2" width="100%"><tr><td valign="top"></td></tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="getting_started.html"><img src="../images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../images/home.png" alt="Home"></a><a accesskey="n" href="without_the_macros.html"><img src="../images/next.png" alt="Next"></a>
+</div>
+<div class="section">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="contract__.tutorial"></a><a class="link" href="tutorial.html" title="Tutorial">Tutorial</a>
+</h2></div></div></div>
+<div class="toc"><dl>
+<dt><span class="section"><a href="tutorial.html#contract__.tutorial.contract_programming_overview">Contract
+ Programming Overview</a></span></dt>
+<dt><span class="section">Checking Contracts</span></dt>
+<dt><span class="section">Contract Macros</span></dt>
+<dt><span class="section">Signature Sequence</span></dt>
+<dt><span class="section">Function Arguments</span></dt>
+<dt><span class="section">Inheritance</span></dt>
+<dt><span class="section">Operators</span></dt>
+<dt><span class="section"><a href="tutorial.html#contract__.tutorial.overloaded_functions">Overloaded
+ Functions</a></span></dt>
+<dt><span class="section">Function Templates</span></dt>
+<dt><span class="section"><a href="tutorial.html#contract__.tutorial.deferring_the_body">Deferring the
+ Body</a></span></dt>
+<dt><span class="section">Friends</span></dt>
+<dt><span class="section">Structs and Unions</span></dt>
+<dt><span class="section">Qualifiers</span></dt>
+<dt><span class="section">Blocks and Loops</span></dt>
+<dt><span class="section"><a href="tutorial.html#contract__.tutorial.exception_specifications">Exception
+ Specifications</a></span></dt>
+<dt><span class="section"><a href="tutorial.html#contract__.tutorial.commas_within_macro_parameters">Commas
+ Within Macro Parameters</a></span></dt>
+<dt><span class="section"><a href="tutorial.html#contract__.tutorial.a_fully_working_example">A Fully
+ Working Example</a></span></dt>
+</dl></div>
+<p>
+ This section gives an overview of Contract Programming and explains how this
+ library can be used to write contracts. At the end of the section there is
+ a fully working example that can be compiled and executed.
+ </p>
+<div class="section">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="contract__.tutorial.contract_programming_overview"></a><a class="link" href="tutorial.html#contract__.tutorial.contract_programming_overview" title="Contract Programming Overview">Contract
+ Programming Overview</a>
+</h3></div></div></div>
+<p>
+ Contract Programming is characterized at least by the following assertion
+ mechanisms (see <a class="link" href="bibliography.html" title="Bibliography">[Meyer1997]</a>,
+ <a class="link" href="bibliography.html" title="Bibliography">[Ottosen2004]</a>, or <a class="link" href="bibliography.html" title="Bibliography">[Crowl2006]</a>):
+ </p>
+<div class="orderedlist"><ol class="orderedlist" type="1">
+<li class="listitem">
+ It is possible to describe <span class="bold"><strong>class invariants</strong></span>.
+ These are logical conditions that programmers expect to be true after
+ the constructor has been executed successfully, before and after the
+ execution of every non-static member function with a contract, and before
+ the destructor is executed (e.g., class invariants can define a valid
+ state for all objects of a class). It is possible to describe <span class="bold"><strong>static class invariants</strong></span> also which are expected
+ to be true before and after the execution of any member function with
+ a contract (including static member functions, constructor entry, and
+ destructor exit).
+ </li>
+<li class="listitem">
+ It is possible to describe function <span class="bold"><strong>preconditions</strong></span>.
+ These are logical conditions that programmers except to be true when
+ the function is called (e.g., to check constraints on input function
+ arguments).
+ </li>
+<li class="listitem">
+ It is possible to describe function <span class="bold"><strong>postconditions</strong></span>.
+ These are logical conditions that programmers expect to be true when
+ the function has ended normally (e.g., to check the result and any side
+ effect that a function might have).
+ </li>
+<li class="listitem">
+ It is possible to formalize the notion of overriding a virtual member
+ function via <span class="bold"><strong>subcontracting</strong></span>. Subcontracting
+ can be justified by substitution principles and it consists of the following
+ rules that the overriding function must obey:
+ <div class="orderedlist"><ol class="orderedlist" type="a">
+<li class="listitem">
+ Preconditions cannot be strengthen.
+ </li>
+<li class="listitem">
+ Postconditions cannot be weaken.
+ </li>
+<li class="listitem">
+ Class invariants cannot be weaken.
+ </li>
+</ol></div>
+ </li>
+<li class="listitem">
+ It is possible to describe <span class="bold"><strong>block invariants</strong></span>.
+ These are logical conditions that programmes except to be true every
+ time the execution reaches the point where the condition is asserted.
+ When used within a loop (i.e., a block of code that can be executed in
+ iteration), block invariants function like <span class="emphasis"><em>loop invariants</em></span>
+ asserting conditions that are excepted to be true for every loop iteration.
+ </li>
+<li class="listitem">
+ It is possible to describe a <span class="bold"><strong>loop variant</strong></span>.
+ This a positive integer expression with a value that is expected to decrease
+ at every subsequent loop iteration.
+ </li>
+</ol></div>
+<p>
+ Based on these definitions of invariants, preconditions, postconditions,
+ and subcontracting it is possible to specify the semantics of the invocation
+ of a function for which a contract has been specified.
+ </p>
+<a name="contract__.tutorial.contract_programming_overview.non_member_function_call_semantics"></a><h6>
+<a name="contract__.tutorial.contract_programming_overview.non_member_function_call_semantics-heading"></a>
+ <a class="link" href="tutorial.html#contract__.tutorial.contract_programming_overview.non_member_function_call_semantics">Non-Member
+ Function Call Semantics</a>
+ </h6>
+<p>
+ A non-member function call should execute the following steps:
+ </p>
+<div class="orderedlist"><ol class="orderedlist" type="1">
+<li class="listitem">
+ Check preconditions.
+ </li>
+<li class="listitem">
+ Execute function body.
+ </li>
+<li class="listitem">
+ Check postconditions.
+ </li>
+</ol></div>
+<a name="contract__.tutorial.contract_programming_overview.member_function_call_semantics"></a><h6>
+<a name="contract__.tutorial.contract_programming_overview.member_function_call_semantics-heading"></a>
+ <a class="link" href="tutorial.html#contract__.tutorial.contract_programming_overview.member_function_call_semantics">Member
+ Function Call Semantics</a>
+ </h6>
+<p>
+ A member function call should execute the following steps:
+ </p>
+<div class="orderedlist"><ol class="orderedlist" type="1">
+<li class="listitem">
+ Check static class invariants.
+ </li>
+<li class="listitem">
+ Check non-static class invariants <span class="emphasis"><em>AND</em></span>, when subcontracting,
+ check the base class invariants (for non-static member functions only
+ <sup>[<a name="id866529" href="#ftn.id866529" class="footnote">2</a>]</sup>).
+ </li>
+<li class="listitem">
+ Check preconditions <span class="emphasis"><em>OR</em></span>, when subcontracting, check
+ the overridden function preconditions.
+ </li>
+<li class="listitem">
+ Execute function body.
+ </li>
+<li class="listitem">
+ Check static class invariants (even if body throws an exception).
+ </li>
+<li class="listitem">
+ Check non-static class invariants <span class="emphasis"><em>AND</em></span>, when subcontracting,
+ check base class invariants (for non-static member functions only plus
+ checked even if body throws an exception).
+ </li>
+<li class="listitem">
+ Check postconditions <span class="emphasis"><em>AND</em></span>, when subcontracting, check
+ overridden function postconditions (only if body did not throw an exception).
+ </li>
+</ol></div>
+<p>
+ Where <span class="emphasis"><em>AND</em></span> and <span class="emphasis"><em>OR</em></span> are the logical
+ "and" and "or" operators evaluated in short-circuit (i.e.,
+ A <span class="emphasis"><em>AND</em></span> B evaluates B only if A is evaluated to be true,
+ A <span class="emphasis"><em>OR</em></span> B evaluates B only if A is evaluated to be false).
+ </p>
+<p>
+ When a member function overrides more than one virtual function due to multiple
+ inheritance:
+ </p>
+<div class="itemizedlist"><ul class="itemizedlist" type="disc">
+<li class="listitem">
+ Class invariants are checked in <span class="emphasis"><em>AND</em></span> with the invariants
+ of <span class="emphasis"><em>all</em></span> the base classes (following the inheritance
+ order).
+ </li>
+<li class="listitem">
+ Preconditions are checked in <span class="emphasis"><em>OR</em></span> with the preconditions
+ of <span class="emphasis"><em>all</em></span> the overridden functions (following the inheritance
+ order).
+ </li>
+<li class="listitem">
+ Postconditions are checked in <span class="emphasis"><em>AND</em></span> with the postconditions
+ of <span class="emphasis"><em>all</em></span> the overridden functions (following the inheritance
+ order).
+ </li>
+</ul></div>
+<a name="contract__.tutorial.contract_programming_overview.constructor_call_semantics"></a><h6>
+<a name="contract__.tutorial.contract_programming_overview.constructor_call_semantics-heading"></a>
+ <a class="link" href="tutorial.html#contract__.tutorial.contract_programming_overview.constructor_call_semantics">Constructor
+ Call Semantics</a>
+ </h6>
+<p>
+ A constructor call should execute the following steps:
+ </p>
+<div class="orderedlist"><ol class="orderedlist" type="1">
+<li class="listitem">
+ Initialize member variables via the constructor member initialization
+ list (if such a list is specified).
+ </li>
+<li class="listitem">
+ Check static class invariants (but not the non-static class invariants).
+ </li>
+<li class="listitem">
+ Check preconditions.
+ </li>
+<li class="listitem">
+ Execute constructor body.
+ </li>
+<li class="listitem">
+ Check static class invariants (even if body throws an exception).
+ </li>
+<li class="listitem">
+ Check class invariants (even if body throws an exception).
+ </li>
+<li class="listitem">
+ Check postconditions (only if body did not throw an exception).
+ </li>
+</ol></div>
+<p>
+ Before constructor body execution, there is no object therefore:
+ </p>
+<div class="itemizedlist"><ul class="itemizedlist" type="disc">
+<li class="listitem">
+ Non-static class invariants do not have to hold true and they are not
+ checked at constructor entry.
+ </li>
+<li class="listitem">
+ Preconditions cannot access the object.
+ </li>
+<li class="listitem">
+ Postconditions cannot access the old object value (as it was before body
+ execution).
+ </li>
+</ul></div>
+<a name="contract__.tutorial.contract_programming_overview.destructor_call_semantics"></a><h6>
+<a name="contract__.tutorial.contract_programming_overview.destructor_call_semantics-heading"></a>
+ <a class="link" href="tutorial.html#contract__.tutorial.contract_programming_overview.destructor_call_semantics">Destructor
+ Call Semantics</a>
+ </h6>
+<p>
+ A destructor call should execute the following steps:
+ </p>
+<div class="orderedlist"><ol class="orderedlist" type="1">
+<li class="listitem">
+ Check static class invariants.
+ </li>
+<li class="listitem">
+ Check class invariants.
+ </li>
+<li class="listitem">
+ Execute destructor body.
+ </li>
+<li class="listitem">
+ Check static class invariants (but not the non-static class invariants
+ plus checked even if body throws an exception <sup>[<a name="id866892" href="#ftn.id866892" class="footnote">3</a>]</sup>).
+ </li>
+</ol></div>
+<p>
+ Note that:
+ </p>
+<div class="itemizedlist"><ul class="itemizedlist" type="disc">
+<li class="listitem">
+ Destructors have no arguments so they have no preconditions.
+ </li>
+<li class="listitem">
+ After destructor body execution, there is no object anymore (because
+ it has been destroyed) so non-static class invariants do not have to
+ hold true and they are not checked at destructor exit.
+ </li>
+<li class="listitem">
+ Destructors have no postconditions as there is no function argument and
+ after body execution there is no object.
+ </li>
+</ul></div>
+</div>
+<div class="section">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="contract__.tutorial.checking_contracts"></a><a class="link" href="tutorial.html#contract__.tutorial.checking_contracts" title="Checking Contracts">Checking Contracts</a>
+</h3></div></div></div>
+<p>
+ After programmers specify contracts, this library provides a mechanism to
+ automatically check if class invariants, preconditions, postconditions, block
+ invariants, and loop variants hold true at run-time or not.
+ </p>
+<p>
+ If a class invariant, precondition, postcondition, block invariant, or loop
+ variant asserted via <code class="computeroutput">CONTRACT_ASSERT<span class="special">()</span></code>, <code class="computeroutput">CONTRACT_ASSERT_BLOCK_INVARIANT<span class="special">()</span></code>, or <code class="computeroutput">CONTRACT_ASSERT_LOOP_VARIANT<span class="special">()</span></code> is checked to be false, the library invokes
+ the <code class="computeroutput"><span class="identifier">contract</span><span class="special">::</span>class_invariant_failed<span class="special">()</span></code>, <code class="computeroutput"><span class="identifier">contract</span><span class="special">::</span>precondition_failed<span class="special">()</span></code>, <code class="computeroutput"><span class="identifier">contract</span><span class="special">::</span>postcondition_failed<span class="special">()</span></code>, <code class="computeroutput"><span class="identifier">contract</span><span class="special">::</span>block_invariant_failed<span class="special">()</span></code> (for both block invariant and loop variant
+ failures) function respectively. These functions invoke <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">terminate</span><span class="special">()</span></code> by default but programmers can redefine
+ them to take a different action using <code class="computeroutput"><span class="identifier">contract</span><span class="special">::</span>set_class_invariant_failed<span class="special">()</span></code>, <code class="computeroutput"><span class="identifier">contract</span><span class="special">::</span>set_precondition_failed<span class="special">()</span></code>, <code class="computeroutput"><span class="identifier">contract</span><span class="special">::</span>set_postcondition_failed<span class="special">()</span></code>, and <code class="computeroutput"><span class="identifier">contract</span><span class="special">::</span>set_block_invariant_failed<span class="special">()</span></code>.
+ </p>
+<p>
+ This mechanism is similarly to the one of C++ <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">set_terminate</span><span class="special">()</span></code> (see <a class="link" href="throw_on_failure.html" title="Annex: Throw on Failure">Throw
+ on Failure</a> for an example).
+ </p>
+<a name="contract__.tutorial.checking_contracts.constant_correctness"></a><h6>
+<a name="contract__.tutorial.checking_contracts.constant_correctness-heading"></a>
+ <a class="link" href="tutorial.html#contract__.tutorial.checking_contracts.constant_correctness">Constant-Correctness</a>
+ </h6>
+<p>
+ Contracts are only supposed to <span class="emphasis"><em>check</em></span> the object state
+ in order to ensure its compliance with the software specifications. Therefore,
+ contract checking should not be allowed to modify the object state and exclusively
+ "read-only" operations (or <span class="emphasis"><em>queries</em></span>) should
+ be used to specify contracts.
+ </p>
+<p>
+ This library enforces <sup>[<a name="id867319" href="#ftn.id867319" class="footnote">4</a>]</sup> this constraint at compile-time using the C++ <code class="computeroutput"><span class="keyword">const</span></code>
+ qualifier. Contracts only have access to the object, function arguments,
+ and return value via constant references thus only constant members can be
+ accessed when checking contracts. Furthermore, pointers are passed as <code class="computeroutput"><span class="keyword">const</span> <span class="identifier">T</span><span class="special">*</span></code> so the pointed object is constants and cannot
+ be changed (note that the pointer value itself is not constant, because it
+ is not passed as <code class="computeroutput"><span class="keyword">const</span> <span class="identifier">T</span><span class="special">*</span> <span class="keyword">const</span></code>, and
+ it could be changed by the contract but such a change will be local to the
+ contract function therefore still ensuring the const-correctness of the contract).
+ </p>
+</div>
+<div class="section">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="contract__.tutorial.contract_macros"></a><a class="link" href="tutorial.html#contract__.tutorial.contract_macros" title="Contract Macros">Contract Macros</a>
+</h3></div></div></div>
+<p>
+ The following overview of the contract macros and their usages should be
+ enough to understand the working example at the end of this section, most
+ of the examples in the <a class="link" href="examples.html" title="Examples">Examples</a>
+ annex, and to start writing contracts on your own. Consult the library Reference documentation for more information.
+ <sup>[<a name="id867446" href="#ftn.id867446" class="footnote">5</a>]</sup>.
+ </p>
+<p>
+ <span class="bold"><strong><code class="literal">CONTRACT_INVARIANT(
+ (static)({ ... }) ({ ... }) )</code></strong></span>
+ </p>
+<p>
+ This macro is used to program class invariants. It should appear within a
+ private section in the class declaration. It takes one parameter which is
+ a Boost.Preprocessor
+ sequence of the following elements:
+ </p>
+<div class="itemizedlist"><ul class="itemizedlist" type="disc">
+<li class="listitem">
+ <code class="computeroutput"><span class="special">(</span><span class="keyword">static</span><span class="special">)</span> <span class="special">({</span> <span class="special">...</span> <span class="special">})</span></code>:
+ The code block <code class="computeroutput"><span class="special">{</span> <span class="special">...</span>
+ <span class="special">}</span></code> <sup>[<a name="id867766" href="#ftn.id867766" class="footnote">6</a>]</sup> asserting static class invariants. This is optional and it
+ can be omitted.
+ </li>
+<li class="listitem">
+ <code class="computeroutput"><span class="special">({</span> <span class="special">...</span>
+ <span class="special">})</span></code>: A secondary code block <code class="computeroutput"><span class="special">{</span> <span class="special">...</span> <span class="special">}</span></code> asserting non-static class invariants.
+ This is mandatory but an empty code block <code class="computeroutput"><span class="special">({})</span></code>
+ can be specified if there are no class invariants (using <code class="computeroutput">CONTRACT_INVARIANT<span class="special">()</span></code>
+ instead of <code class="computeroutput">CONTRACT_INVARIANT<span class="special">(</span> <span class="special">({})</span> <span class="special">)</span></code> will generate a preprocessor error).
+ </li>
+</ul></div>
+<p>
+ If contract compilation is turned off, this macro expands to nothing (and
+ no contract overhead is added). Otherwise, it expands to code that checks
+ the class invariants (see <a class="link" href="without_the_macros.html" title="Without the Macros">Without
+ the Macros</a> for details).
+ </p>
+<p>
+ <span class="bold"><strong><code class="literal">CONTRACT_FUNCTION(
+ <span class="emphasis"><em>signature-sequence</em></span> (precondition)({ ... }) (postcondition)(<span class="emphasis"><em>result-name</em></span>)({
+ ... }) (body)({ ... }) )</code></strong></span>
+ </p>
+<p>
+ <span class="bold"><strong><code class="literal">CONTRACT_CONSTRUCTOR(
+ <span class="emphasis"><em>signature-sequence</em></span> (precondition)({ ... }) (postcondition)({
+ ... }) (body)({ ... }) )</code></strong></span>
+ </p>
+<p>
+ These macros are used to program preconditions and postconditions for functions
+ (members and non) and constructors respectively. They should appear right
+ after the function and constructor declaration, and after the constructor
+ members initialization list when such a list is specified. They both take
+ the following parameters:
+ </p>
+<div class="itemizedlist"><ul class="itemizedlist" type="disc">
+<li class="listitem">
+ <span class="emphasis"><em>signature-sequence</em></span>: A Boost.Preprocessor
+ sequence with the function or constructor signature tokens (see subsections
+ below).
+ </li>
+<li class="listitem">
+ <code class="computeroutput"><span class="special">(</span><span class="identifier">precondition</span><span class="special">)</span> <span class="special">({</span> <span class="special">...</span> <span class="special">})</span></code>:
+ An optional code block <code class="computeroutput"><span class="special">{</span> <span class="special">...</span> <span class="special">}</span></code>
+ asserting the preconditions.
+ </li>
+<li class="listitem">
+ <code class="computeroutput"><span class="special">(</span><span class="identifier">postcondition</span><span class="special">)</span> <span class="special">(</span></code><span class="emphasis"><em>result-name</em></span><code class="computeroutput"><span class="special">)</span> <span class="special">({</span> <span class="special">...</span> <span class="special">})</span></code>:
+ An optional code block <code class="computeroutput"><span class="special">{</span> <span class="special">...</span> <span class="special">}</span></code>
+ asserting the postconditions. The <code class="computeroutput"><span class="special">(</span></code><span class="emphasis"><em>result-name</em></span><code class="computeroutput"><span class="special">)</span></code> element is only specified for non-void
+ functions (so never for constructors) and it names the variable used
+ to access the return value within postconditions (e.g., <code class="computeroutput"><span class="identifier">result</span></code>).
+ </li>
+<li class="listitem">
+ <code class="computeroutput"><span class="special">(</span><span class="identifier">body</span><span class="special">)({</span> <span class="special">...</span> <span class="special">})</span></code>: A mandatory code block <code class="computeroutput"><span class="special">{</span> <span class="special">...</span> <span class="special">}</span></code> implementing the function or constructor
+ body.
+ </li>
+</ul></div>
+<p>
+ If contract compilation is turned off, these macros simply expand to the
+ body code block (and no contract overhead is added). Otherwise, they expand
+ to code that implements the <a class="link" href="tutorial.html#contract__.tutorial.contract_programming_overview.member_function_call_semantics">Member
+ Function Call Semantics</a> and <a class="link" href="tutorial.html#contract__.tutorial.contract_programming_overview.constructor_call_semantics">Constructor
+ Call Semantics</a> respectively thus checking class invariants, preconditions,
+ and postconditions (see <a class="link" href="without_the_macros.html" title="Without the Macros">Without
+ the Macros</a> for details).
+ </p>
+<p>
+ <span class="bold"><strong><code class="literal">CONTRACT_DESTRUCTOR(
+ <span class="emphasis"><em>signature-sequence</em></span> (body)({ ... }) )</code></strong></span>
+ </p>
+<p>
+ This macro is used to program destructor contracts. It should appear right
+ after the destructor declaration. It takes the following parameters:
+ </p>
+<div class="itemizedlist"><ul class="itemizedlist" type="disc">
+<li class="listitem">
+ <span class="emphasis"><em>signature-sequence</em></span>: The destructor signature tokens
+ (see below).
+ </li>
+<li class="listitem">
+ <code class="computeroutput"><span class="special">(</span><span class="identifier">body</span><span class="special">)</span> <span class="special">({</span> <span class="special">...</span> <span class="special">})</span></code>:
+ A mandatory code block <code class="computeroutput"><span class="special">{</span> <span class="special">...</span> <span class="special">}</span></code>
+ implementing the destructor body.
+ </li>
+</ul></div>
+<p>
+ If contract compilation is turned off, this macro simply expands to the body
+ code block (and no contract overhead is added). Otherwise, it expands to
+ code that implements the <a class="link" href="tutorial.html#contract__.tutorial.contract_programming_overview.destructor_call_semantics">Destructor
+ Call Semantics</a> checking the class invariants (see <a class="link" href="without_the_macros.html" title="Without the Macros">Without
+ the Macros</a> for details).
+ </p>
+<p>
+ <span class="bold"><strong><code class="literal">CONTRACT_OLDOF(
+ variable_name )</code></strong></span>
+ </p>
+<p>
+ This macro is used to access the old value for the variable with the specified
+ name in postconditions. It takes the following parameter:
+ </p>
+<div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem">
+ <code class="computeroutput"><span class="identifier">name</span></code>: The name of the
+ variable. As usual, <code class="computeroutput"><span class="keyword">this</span></code>
+ can be used as the variable name for the object so <code class="computeroutput"><span class="identifier">CONTRACT_OLDOF</span><span class="special">(</span><span class="keyword">this</span><span class="special">)</span></code> is used to access the object old value.
+ Otherwise, any of the function argument variable names can be specified.
+ The variable type (class or argument type) must be tagged copyable in
+ the signature sequence for the variable old value to be available (see
+ below). The library generates a compile-time error (containing the text
+ <code class="computeroutput"><span class="identifier">contract</span><span class="special">::</span><span class="identifier">noold</span></code>) if this macro is used on a variable
+ name of a type which was not tagged copyable.
+ </li></ul></div>
+<div class="note"><table border="0" summary="Note">
+<tr>
+<td rowspan="2" align="center" valign="top" width="25"><img alt="[Note]" src="../images/note.png"></td>
+<th align="left">Note</th>
+</tr>
+<tr><td align="left" valign="top"><p>
+ This library does not support old values for <span class="emphasis"><em>any</em></span> expression
+ that can be evaluated in postcondition as supported by Eiffel and required
+ <a class="link" href="bibliography.html" title="Bibliography">[Crowl2006]</a> instead. The
+ library supports old values for the object and all the function argument
+ types, and this is a subset of the old values supported by Eiffel and required
+ by <a class="link" href="bibliography.html" title="Bibliography">[Crowl2006]</a>. However,
+ the old values supported by the library are usually enough to program the
+ postconditions (e.g., all Eiffel examples from <a class="link" href="bibliography.html" title="Bibliography">[Meyer1997]</a>,
+ <a class="link" href="bibliography.html" title="Bibliography">[Mitchell2002]</a>, and all
+ C++ examples from <a class="link" href="bibliography.html" title="Bibliography">[Crowl2006]</a>
+ were successfully programmed using just these old values, see the <a class="link" href="examples.html" title="Examples">Examples</a> section).
+ </p></td></tr>
+</table></div>
+<p>
+ The old value variable are only declared locally within postconditions therefore
+ they cannot be mistakenly accessed outside the related postcondition code
+ block (see <a class="link" href="without_the_macros.html" title="Without the Macros">Without the Macros</a>
+ for details).
+ </p>
+<div class="note"><table border="0" summary="Note">
+<tr>
+<td rowspan="2" align="center" valign="top" width="25"><img alt="[Note]" src="../images/note.png"></td>
+<th align="left">Note</th>
+</tr>
+<tr><td align="left" valign="top">
+<p>
+ If pointer types are tagged copyable, then the pointer value, and <span class="emphasis"><em>not</em></span>
+ the pointed value, is copied. Therefore the old pointer value will be available
+ in postconditions via <code class="computeroutput">CONTRACT_OLDOF<span class="special">()</span></code> and <span class="emphasis"><em>not</em></span> the old
+ pointed value. In other words, as usual, shallow copies are performed for
+ pointers (unless the pointed type defines a different copy operation).
+ Be careful as this might not be what you intended when using <code class="computeroutput">CONTRACT_OLDOF<span class="special">()</span></code>
+ on a pointer <sup>[<a name="id868651" href="#ftn.id868651" class="footnote">7</a>]</sup>.
+ </p>
+<p>
+ The notable exception is the object <code class="computeroutput"><span class="keyword">this</span></code>
+ which is passed to the contract functions by pointer but its old value
+ is automatically deep copied by the library.
+ </p>
+</td></tr>
+</table></div>
+<p>
+ <span class="bold"><strong><code class="literal">CONTRACT_ASSERT(
+ boolean_condition )</code></strong></span>
+ </p>
+<p>
+ This macro is used to assert conditions within the class invariant, precondition,
+ and postcondition code blocks (see also CONTRACT_ASSERT_MSG()).
+ It takes the following parameter:
+ </p>
+<div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem">
+ <code class="computeroutput"><span class="identifier">boolean_condition</span></code>: The
+ boolean condition being asserted.
+ </li></ul></div>
+<p>
+ If contract compilation is turned off, this macro expands to nothing (and
+ no contract overhead is added). Otherwise, this macro expands to code that
+ triggers the invocation of <code class="computeroutput"><span class="identifier">contract</span><span class="special">::</span>class_invariant_failed<span class="special">()</span></code>, <code class="computeroutput"><span class="identifier">contract</span><span class="special">::</span>precondition_failed<span class="special">()</span></code>, or <code class="computeroutput"><span class="identifier">contract</span><span class="special">::</span>postcondition_failed<span class="special">()</span></code> in case the asserted boolean condition
+ is evaluated to be false at run-time from within invariants, preconditions,
+ or postconditions respectively (see <a class="link" href="without_the_macros.html" title="Without the Macros">Without
+ the Macros</a> for details).
+ </p>
+<p>
+ <span class="bold"><strong><code class="literal">CONTRACT_ASSERT_BLOCK_INVARIANT(
+ boolean_condition )</code></strong></span>
+ </p>
+<p>
+ This macro is used to assert invariant within a generic code block (see also
+ CONTRACT_ASSERT_BLOCK_INVARIANT_MSG()).
+ This macro can also be used within loops to assert loop invariants. It takes
+ the following parameter:
+ </p>
+<div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem">
+ <code class="computeroutput"><span class="identifier">boolean_condition</span></code>: The
+ boolean condition being asserted.
+ </li></ul></div>
+<p>
+ If contract compilation is turned off, this macro expands to nothing (and
+ no contract overhead is added). Otherwise, this macro expands to code that
+ triggers the invocation of <code class="computeroutput"><span class="identifier">contract</span><span class="special">::</span>block_invariant_failed<span class="special">()</span></code> in case the asserted boolean condition
+ is evaluated to be false at run-time (see <a class="link" href="without_the_macros.html" title="Without the Macros">Without
+ the Macros</a> for details).
+ </p>
+<div class="note"><table border="0" summary="Note">
+<tr>
+<td rowspan="2" align="center" valign="top" width="25"><img alt="[Note]" src="../images/note.png"></td>
+<th align="left">Note</th>
+</tr>
+<tr><td align="left" valign="top"><p>
+ This macro is similar to the C <code class="computeroutput"><span class="identifier">assert</span><span class="special">()</span></code> macro as it can be used at any point
+ within a block of code. However, in case the asserted condition either
+ throws an exception or it is evaluated to be <code class="computeroutput"><span class="keyword">false</span></code>,
+ this macro invokes <code class="computeroutput"><span class="identifier">contract</span><span class="special">::</span>block_invariant_failed<span class="special">()</span></code> instead of calling <code class="computeroutput"><span class="identifier">abort</span><span class="special">()</span></code>.
+ </p></td></tr>
+</table></div>
+<p>
+ <span class="bold"><strong><code class="literal">CONTRACT_ASSERT_LOOP_VARIANT(
+ integer_expression )</code></strong></span>
+ </p>
+<p>
+ <span class="bold"><strong><code class="literal">CONTRACT_INIT_LOOP_VARIANT</code></strong></span>
+ </p>
+<p>
+ This macro is used to assert loop variants (see also CONTRACT_ASSERT_LOOP_VARIANT_MSG()).
+ It must be used <span class="emphasis"><em>after</em></span> <code class="computeroutput">CONTRACT_INIT_LOOP_VARIANT</code>
+ has been called once within the same code block scope (see below).
+ </p>
+<div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem">
+ <code class="computeroutput"><span class="identifier">integer_expression</span></code>: An
+ integer expression which is evaluated at each loop iteration as the loop
+ variant. It must be always positive (not negative and not zero) and it
+ must strictly decrease at each subsequent loop iteration (of <code class="computeroutput"><span class="number">1</span></code> or more).
+ </li></ul></div>
+<p>
+ If contract compilation is turned off, this macro expands to nothing (and
+ no contract overhead is added). Otherwise, this macro expands to code that
+ triggers the invocation of <code class="computeroutput"><span class="identifier">contract</span><span class="special">::</span>block_invariant_failed<span class="special">()</span></code> at run-time in case the specified variant
+ expression is either not positive or it does not decrease from one loop iteration
+ to the next (see <a class="link" href="without_the_macros.html" title="Without the Macros">Without the
+ Macros</a> for details).
+ </p>
+<a name="contract__.tutorial.contract_macros.step_by_step_example"></a><h6>
+<a name="contract__.tutorial.contract_macros.step_by_step_example-heading"></a>
+ <a class="link" href="tutorial.html#contract__.tutorial.contract_macros.step_by_step_example">Step-by-Step
+ Example</a>
+ </h6>
+<p>
+ Let's assume we want to write a <code class="computeroutput"><span class="identifier">myvector</span></code>
+ class template that wraps the C++ STL vector template <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">vector</span></code>
+ adding contracts to it. Here we show, step-by-step, how to program a contract
+ for the <code class="computeroutput"><span class="identifier">push_back</span><span class="special">()</span></code>
+ function.
+ </p>
+<p>
+ <span class="bold"><strong>Step 1)</strong></span> First, we implement <code class="computeroutput"><span class="identifier">myvector</span><span class="special">::</span><span class="identifier">push_back</span><span class="special">()</span></code>
+ to call <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">vector</span><span class="special">::</span><span class="identifier">push_back</span><span class="special">()</span></code>
+ and we can sketch the contract using comments.
+ </p>
+<pre class="programlisting"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> <span class="identifier">T</span><span class="special">&gt;</span>
+<span class="keyword">class</span> <span class="identifier">myvector</span> <span class="special">{</span>
+ <span class="comment">// Invariant: (size() == 0) == empty()</span>
+
+<span class="keyword">public</span><span class="special">:</span>
+ <span class="comment">// Precondition: size() &lt; max_size()</span>
+ <span class="comment">// Postcondition: size() == (oldof size() + 1)</span>
+ <span class="keyword">void</span> <span class="identifier">push_back</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">T</span><span class="special">&amp;</span> <span class="identifier">element</span><span class="special">)</span> <span class="special">{</span> <span class="identifier">vector_</span><span class="special">.</span><span class="identifier">push_back</span><span class="special">(</span><span class="identifier">element</span><span class="special">);</span> <span class="special">}</span>
+
+ <span class="special">...</span> <span class="comment">// Rest of the class.</span>
+<span class="keyword">private</span><span class="special">:</span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">vector</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">&gt;</span> <span class="identifier">vector_</span><span class="special">;</span>
+<span class="special">};</span>
+</pre>
+<p>
+ Where "<code class="computeroutput"><span class="identifier">oldof</span> <span class="identifier">size</span><span class="special">()</span></code>" indicates the value <code class="computeroutput"><span class="identifier">size</span><span class="special">()</span></code>
+ has before the <code class="computeroutput"><span class="identifier">push_back</span><span class="special">()</span></code> function is executed.
+ </p>
+<p>
+ To keep this example simple, we intentionally did not write the full contract
+ but we only wrote one invariant, one precondition, and one postcondition
+ (see the STL Vector <a class="link" href="examples.html" title="Examples">Example</a> for
+ the complete <code class="computeroutput"><span class="identifier">push_back</span><span class="special">()</span></code>
+ contract). These contract conditions specify the followings:
+ </p>
+<div class="orderedlist"><ol class="orderedlist" type="1">
+<li class="listitem">
+ The class invariant asserts that the vector is empty if and only if its
+ size is zero.
+ </li>
+<li class="listitem">
+ The precondition asserts that the vector size must be smaller than the
+ maximum size when <code class="computeroutput"><span class="identifier">push_back</span><span class="special">()</span></code> is called (so there is available space
+ to add one extra vector element).
+ </li>
+<li class="listitem">
+ The postcondition asserts that the vector size must increase by 1 after
+ <code class="computeroutput"><span class="identifier">push_back</span><span class="special">()</span></code>
+ has been executed (to reflect the newly added vector element).
+ </li>
+</ol></div>
+<p>
+ <span class="bold"><strong>Step 2)</strong></span> The library provides the <code class="computeroutput">CONTRACT_FUNCTION<span class="special">()</span></code>
+ macro to write member function contracts. This macro must be used <span class="emphasis"><em>right
+ after</em></span> the <code class="computeroutput"><span class="identifier">push_back</span><span class="special">()</span></code> function declaration. The <code class="computeroutput"><span class="identifier">push_back</span><span class="special">()</span></code>
+ function definition <code class="computeroutput"><span class="special">{</span> <span class="identifier">vector_</span><span class="special">.</span><span class="identifier">push_back</span><span class="special">();</span> <span class="special">}</span></code> is moved
+ within the macro becoming the last element of the Boost.Preprocessor
+ sequence passed as the macro parameter:
+ </p>
+<pre class="programlisting"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> <span class="identifier">T</span><span class="special">&gt;</span>
+<span class="keyword">class</span> <span class="identifier">myvector</span> <span class="special">{</span>
+ <span class="comment">// Invariant: (size() == 0) == empty()</span>
+
+<span class="keyword">public</span><span class="special">:</span>
+ <span class="comment">// Precondition: size() &lt; max_size()</span>
+ <span class="comment">// Postcondition: size() == (old size()) + 1</span>
+ <span class="keyword">void</span> <span class="identifier">push_back</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">T</span><span class="special">&amp;</span> <span class="identifier">element</span><span class="special">)</span>
+ <span class="bold"><strong>CONTRACT_FUNCTION</strong></span><span class="special">(</span> <span class="emphasis"><em>signature-sequence</em></span>
+ <span class="emphasis"><em>precondition-sequence</em></span>
+ <span class="emphasis"><em>postcondition-sequence</em></span>
+ <span class="bold"><strong>(body) ({
+ vector_.push_back(element);
+ })</strong></span> ) <span class="comment">// No need for ";" after the macro closing parenthesis ")".</span>
+
+ <span class="special">...</span> <span class="comment">// Rest of the class.</span>
+<span class="keyword">private</span><span class="special">:</span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">vector</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">&gt;</span> <span class="identifier">vector_</span><span class="special">;</span>
+<span class="special">};</span>
+</pre>
+<p>
+ There is no need for "<code class="computeroutput"><span class="special">;</span></code>"
+ after the macro closing parenthesis "<code class="computeroutput"><span class="special">)</span></code>".
+ </p>
+<p>
+ <span class="bold"><strong>Step 3)</strong></span> We now program the postconditions
+ using <code class="computeroutput">CONTRACT_ASSERT<span class="special">()</span></code> inside a code block <code class="computeroutput"><span class="special">{</span>
+ <span class="special">...</span> <span class="special">}</span></code>
+ specifying the <span class="emphasis"><em>postcondition-sequence</em></span> elements:
+ </p>
+<pre class="programlisting"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> <span class="identifier">T</span><span class="special">&gt;</span>
+<span class="keyword">class</span> <span class="identifier">myvector</span> <span class="special">{</span>
+ <span class="comment">// Invariant: (size() == 0) == empty()</span>
+
+<span class="keyword">public</span><span class="special">:</span>
+ <span class="comment">// Precondition: size() &lt; max_size()</span>
+ <span class="keyword">void</span> <span class="identifier">push_back</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">T</span><span class="special">&amp;</span> <span class="identifier">element</span><span class="special">)</span>
+ <span class="identifier">CONTRACT_FUNCTION</span><span class="special">(</span> <span class="emphasis"><em>signature-sequence</em></span>
+ <span class="emphasis"><em>precondition-sequence</em></span>
+ <span class="bold"><strong>(postcondition) ({
+ CONTRACT_ASSERT( size() == (CONTRACT_OLDOF(this)-&gt;size() + 1) );
+ })</strong></span>
+ <span class="special">(</span><span class="identifier">body</span><span class="special">)</span> <span class="special">({</span>
+ <span class="identifier">vector_</span><span class="special">.</span><span class="identifier">push_back</span><span class="special">(</span><span class="identifier">element</span><span class="special">);</span>
+ <span class="special">})</span> <span class="special">)</span>
+
+ <span class="special">...</span> <span class="comment">// Rest of the class.</span>
+<span class="keyword">private</span><span class="special">:</span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">vector</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">&gt;</span> <span class="identifier">vector_</span><span class="special">;</span>
+<span class="special">};</span>
+</pre>
+<p>
+ Note how <code class="computeroutput"><span class="identifier">CONTRACT_OLDOF</span><span class="special">(</span><span class="keyword">this</span><span class="special">)</span></code> is used
+ to access the old object value as it was before body execution.
+ </p>
+<p>
+ <span class="bold"><strong>Step 4)</strong></span> Similarly, we program the preconditions
+ in a code block <code class="computeroutput"><span class="special">{</span> <span class="special">...</span>
+ <span class="special">}</span></code> specifying the <span class="emphasis"><em>precondition-sequence</em></span>
+ elements:
+ </p>
+<pre class="programlisting"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> <span class="identifier">T</span><span class="special">&gt;</span>
+<span class="keyword">class</span> <span class="identifier">myvector</span> <span class="special">{</span>
+ <span class="comment">// Invariant: (size() == 0) == empty()</span>
+
+<span class="keyword">public</span><span class="special">:</span>
+ <span class="keyword">void</span> <span class="identifier">push_back</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">T</span><span class="special">&amp;</span> <span class="identifier">element</span><span class="special">)</span>
+ <span class="identifier">CONTRACT_FUNCTION</span><span class="special">(</span> <span class="emphasis"><em>signature-sequence</em></span>
+ <span class="bold"><strong>(precondition) ({
+ CONTRACT_ASSERT( size() &lt; max_size() );
+ })</strong></span>
+ <span class="special">(</span><span class="identifier">postcondition</span><span class="special">)</span> <span class="special">({</span>
+ <span class="identifier">CONTRACT_ASSERT</span><span class="special">(</span> <span class="identifier">size</span><span class="special">()</span> <span class="special">==</span> <span class="special">(</span><span class="identifier">CONTRACT_OLDOF</span><span class="special">(</span><span class="keyword">this</span><span class="special">)-&gt;</span><span class="identifier">size</span><span class="special">()</span> <span class="special">+</span> <span class="number">1</span><span class="special">)</span> <span class="special">);</span>
+
+ <span class="special">})</span>
+ <span class="special">(</span><span class="identifier">body</span><span class="special">)</span> <span class="special">({</span>
+ <span class="identifier">vector_</span><span class="special">.</span><span class="identifier">push_back</span><span class="special">(</span><span class="identifier">element</span><span class="special">);</span>
+ <span class="special">})</span> <span class="special">)</span>
+
+ <span class="special">...</span> <span class="comment">// Rest of the class.</span>
+<span class="keyword">private</span><span class="special">:</span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">vector</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">&gt;</span> <span class="identifier">vector_</span><span class="special">;</span>
+<span class="special">};</span>
+</pre>
+<p>
+ <span class="bold"><strong>Step 5)</strong></span> The <span class="emphasis"><em>signature-sequence</em></span>
+ elements are discussed separately (see below) and for now we will leave them
+ unresolved.
+ </p>
+<p>
+ <span class="bold"><strong>Step 6)</strong></span> Similarly to what we did with for
+ preconditions and postconditions, we program the class invariants in a code
+ block <code class="computeroutput"><span class="special">{</span> <span class="special">...</span>
+ <span class="special">}</span></code> specifying sequence elements passed
+ to the <code class="computeroutput">CONTRACT_INVARIANT<span class="special">()</span></code> macro:
+ </p>
+<pre class="programlisting"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> <span class="identifier">T</span><span class="special">&gt;</span>
+<span class="keyword">class</span> <span class="identifier">myvector</span> <span class="special">{</span>
+
+ <span class="bold"><strong>CONTRACT_INVARIANT( ({
+ CONTRACT_ASSERT( (size() == 0) == empty() );
+ }) )</strong></span> <span class="comment">// Again, no need for ";" after the macro closing parenthesis ")".</span>
+
+<span class="keyword">public</span><span class="special">:</span>
+ <span class="keyword">void</span> <span class="identifier">push_back</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">T</span><span class="special">&amp;</span> <span class="identifier">element</span><span class="special">)</span>
+ <span class="identifier">CONTRACT_FUNCTION</span><span class="special">(</span> <span class="emphasis"><em>signature-sequence</em></span>
+ <span class="special">(</span><span class="identifier">precondition</span><span class="special">)</span> <span class="special">({</span>
+ <span class="identifier">CONTRACT_ASSERT</span><span class="special">(</span> <span class="identifier">size</span><span class="special">()</span> <span class="special">&lt;</span> <span class="identifier">max_size</span><span class="special">()</span> <span class="special">);</span>
+ <span class="special">})</span>
+ <span class="special">(</span><span class="identifier">postcondition</span><span class="special">)</span> <span class="special">({</span>
+ <span class="identifier">CONTRACT_ASSERT</span><span class="special">(</span> <span class="identifier">size</span><span class="special">()</span> <span class="special">==</span> <span class="special">(</span><span class="identifier">CONTRACT_OLDOF</span><span class="special">(</span><span class="keyword">this</span><span class="special">)-&gt;</span><span class="identifier">size</span><span class="special">()</span> <span class="special">+</span> <span class="number">1</span><span class="special">)</span> <span class="special">);</span>
+
+ <span class="special">})</span>
+ <span class="special">(</span><span class="identifier">body</span><span class="special">)</span> <span class="special">({</span>
+ <span class="identifier">vector_</span><span class="special">.</span><span class="identifier">push_back</span><span class="special">(</span><span class="identifier">element</span><span class="special">);</span>
+ <span class="special">})</span> <span class="special">)</span>
+
+ <span class="special">...</span> <span class="comment">// Rest of the class.</span>
+<span class="keyword">private</span><span class="special">:</span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">vector</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">&gt;</span> <span class="identifier">vector_</span><span class="special">;</span>
+<span class="special">};</span>
+</pre>
+<p>
+ Again, there is no need for "<code class="computeroutput"><span class="special">;</span></code>"
+ after the macro closing parenthesis "<code class="computeroutput"><span class="special">)</span></code>".
+ </p>
+<p>
+ <span class="bold"><strong>Step 7)</strong></span> The same step-by-step process can
+ be applied to understand the usage of <code class="computeroutput">CONTRACT_CONSTRUCTOR<span class="special">()</span></code> and <code class="computeroutput">CONTRACT_DESTRUCTOR<span class="special">()</span></code> (see the example at the very end of this
+ section).
+ </p>
+<a name="contract__.tutorial.contract_macros.contract_code_blocks"></a><h6>
+<a name="contract__.tutorial.contract_macros.contract_code_blocks-heading"></a>
+ <a class="link" href="tutorial.html#contract__.tutorial.contract_macros.contract_code_blocks">Contract
+ Code Blocks</a>
+ </h6>
+<p>
+ This library allows for arbitrary constant-correct code within the class
+ invariant, precondition, and postcondition code blocks <code class="computeroutput"><span class="special">({</span>
+ <span class="special">...</span> <span class="special">})</span></code>.
+ </p>
+<p>
+ In other words, the class invariant, precondition, and postcondition code
+ blocks can contain any legal C++ code and they can access any constant class
+ member (private, protected, or public). However, writing complex code in
+ the contracts will increase the probability of introducing bugs in the contracts
+ themselves so it is better to limit the contract code to a simple list of
+ assertions with occasional if-statements to guard them. Furthermore, if non-public
+ members are used in preconditions then the callers will not be able to fully
+ check the preconditions to make sure the contract is satisfied before calling
+ the function so it is best to only use public members at least in preconditions
+ <sup>[<a name="id871421" href="#ftn.id871421" class="footnote">8</a>]</sup>.
+ </p>
+<p>
+ In addition, this library checks class invariants (as well as preconditions
+ and postconditions) only for functions that have a contract. For example,
+ if a private member function is allowed to <span class="emphasis"><em>temporarily</em></span>
+ brake the class invariants, you can omit the contract for that one private
+ function so no invariants (as well as no preconditions and no postconditions)
+ will be checked when that function is called. However, it should never be
+ the case that public member functions can brake class invariants. It is recommended
+ to write contracts for all functions (public and non) with the rare exceptions
+ of a private member function that cannot be programmed without allowing for
+ it to temporarily brake the class invariants.
+ </p>
+<div class="important"><table border="0" summary="Important">
+<tr>
+<td rowspan="2" align="center" valign="top" width="25"><img alt="[Important]" src="../images/important.png"></td>
+<th align="left">Important</th>
+</tr>
+<tr><td align="left" valign="top">
+<p>
+ <span class="bold"><strong>Recommended Practices</strong></span>
+ </p>
+<p>
+ 1. Limit the contract code to a list of assertions with occasional if-statements
+ to guard them.
+ </p>
+<p>
+ 2. Only access public class members when asserting preconditions.
+ </p>
+<p>
+ 3. Write contracts at least for all public member functions (even if they
+ have no preconditions and no postconditions) so they check the class invariants.
+ </p>
+</td></tr>
+</table></div>
+<p>
+ These practices are followed by all the examples of this documentation.
+ </p>
+</div>
+<div class="section">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="contract__.tutorial.signature_sequence"></a><a class="link" href="tutorial.html#contract__.tutorial.signature_sequence" title="Signature Sequence">Signature Sequence</a>
+</h3></div></div></div>
+<p>
+ The very first elements of the Boost.Preprocessor
+ sequence passed to the macros <code class="computeroutput">CONTRACT_CONSTRUCTOR<span class="special">()</span></code>, <code class="computeroutput">CONTRACT_DESTRUCTOR<span class="special">()</span></code>, and <code class="computeroutput">CONTRACT_FUNCTION<span class="special">()</span></code> are the elements of the <span class="emphasis"><em>signature-sequence</em></span>
+ <sup>[<a name="id871567" href="#ftn.id871567" class="footnote">9</a>]</sup>. The <span class="emphasis"><em>signature-sequence</em></span> repeats the syntactic
+ elements of the function declaration. <sup>[<a name="id871782" href="#ftn.id871782" class="footnote">10</a>]</sup>
+ </p>
+<p>
+ The syntax of <span class="emphasis"><em>signature-sequence</em></span> is somewhat unusual
+ (even if it is all legal ISO standard C++). However, there is a convenient
+ rule for remembering this syntax:
+ </p>
+<div class="important"><table border="0" summary="Important">
+<tr>
+<td rowspan="2" align="center" valign="top" width="25"><img alt="[Important]" src="../images/important.png"></td>
+<th align="left">Important</th>
+</tr>
+<tr><td align="left" valign="top">
+<p>
+ <span class="bold"><strong>Signature Sequence Mnemonic</strong></span>
+ </p>
+<p>
+ The tokens in the signature sequence appear in the exact same order as
+ they appear in the relative function declaration.
+ </p>
+</td></tr>
+</table></div>
+<a name="contract__.tutorial.signature_sequence.an_example"></a><h6>
+<a name="contract__.tutorial.signature_sequence.an_example-heading"></a>
+ <a class="link" href="tutorial.html#contract__.tutorial.signature_sequence.an_example">An Example</a>
+ </h6>
+<p>
+ Let's consider the following example (with respect to the <code class="computeroutput"><span class="identifier">myvector</span></code>
+ example above, we have added the base class <code class="computeroutput"><span class="identifier">pushable</span></code>
+ to show how to subcontract):
+ </p>
+<pre class="programlisting"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> <span class="identifier">T</span><span class="special">&gt;</span>
+<span class="bold"><strong>class myvector:</strong></span> <span class="keyword">public</span> <span class="bold"><strong>pushable&lt;T&gt;</strong></span> <span class="special">{</span>
+<span class="bold"><strong>public</strong></span><span class="special">:</span>
+ <span class="bold"><strong>void push_back(const T&amp; element)</strong></span>
+ <span class="identifier">CONTRACT_FUNCTION</span><span class="special">(</span> <span class="emphasis"><em>signature-sequence</em></span> <span class="special">...</span> <span class="special">)</span>
+ <span class="special">...</span>
+<span class="special">};</span>
+</pre>
+<p>
+ Applying the mnemonic rule, we read the declaration of <code class="computeroutput"><span class="identifier">push_back</span><span class="special">()</span></code> from top to bottom and we find the following
+ tokens in the listed order (we have to start all the way up to the top of
+ the <code class="computeroutput"><span class="identifier">myvector</span></code> class declaration):
+ </p>
+<div class="orderedlist"><ol class="orderedlist" type="1">
+<li class="listitem">
+ The <span class="bold"><strong><code class="literal">class</code></strong></span> keyword
+ for <code class="computeroutput"><span class="identifier">myvector</span></code> (this indicates
+ that <code class="computeroutput"><span class="identifier">push_back</span></code> is a member
+ function).
+ </li>
+<li class="listitem">
+ The <span class="bold"><strong><code class="literal">myvector</code></strong></span> class
+ type (this indicates that <code class="computeroutput"><span class="identifier">push_back</span></code>
+ is a member function of <code class="computeroutput"><span class="identifier">myvector</span></code>).
+ </li>
+<li class="listitem">
+ The <span class="bold"><strong><code class="literal">pushable&lt;T&gt;</code></strong></span>
+ base class which is repeated in <span class="emphasis"><em>signature-sequence</em></span>
+ as <code class="computeroutput"><span class="special">(</span><span class="identifier">inherit</span><span class="special">)(</span><span class="identifier">pushable</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">&gt;)</span></code> but only when the function is subcontracting
+ from the specified base class (because "<code class="computeroutput"><span class="special">:</span></code>"
+ is not a valid preprocessor token <code class="computeroutput"><span class="special">(</span><span class="identifier">inherit</span><span class="special">)</span></code>
+ is used instead; also the inheritance access level, the <code class="computeroutput"><span class="keyword">public</span></code> keyword in this case, is not relevant
+ and it is not repeated in <span class="emphasis"><em>signature-sequence</em></span>).
+ </li>
+<li class="listitem">
+ The <span class="bold"><strong><code class="literal">public</code></strong></span> access
+ level of the <code class="computeroutput"><span class="identifier">push_back</span><span class="special">()</span></code> member function.
+ </li>
+<li class="listitem">
+ The <span class="bold"><strong><code class="literal">void</code></strong></span> return type.
+ </li>
+<li class="listitem">
+ The <span class="bold"><strong><code class="literal">push_back</code></strong></span> function
+ name.
+ </li>
+<li class="listitem">
+ The parenthesis "<span class="bold"><strong><code class="literal">(</code></strong></span>"
+ to open the function argument list.
+ </li>
+<li class="listitem">
+ The <span class="bold"><strong><code class="literal">const T&amp;</code></strong></span>
+ function argument type.
+ </li>
+<li class="listitem">
+ The <span class="bold"><strong><code class="literal">element</code></strong></span> function
+ argument name.
+ </li>
+<li class="listitem">
+ The parenthesis "<span class="bold"><strong><code class="literal">)</code></strong></span>"
+ to close the function argument list.
+ </li>
+</ol></div>
+<p>
+ Wrapping all these tokens within parenthesis <code class="computeroutput"><span class="special">()</span></code>
+ and listing them in the exact order as they appear in the function declaration,
+ we obtain the <span class="emphasis"><em>signature-sequence</em></span> elements for this example.
+ The parenthesis <code class="computeroutput"><span class="special">()</span></code> around the
+ tokens are mandatory because they are the ones actually creating the Boost.Preprocessor
+ sequence. New lines and spaces do not matter within preprocessor sequences.
+ </p>
+<pre class="programlisting"><span class="special">(</span><span class="keyword">class</span><span class="special">)</span> <span class="special">(</span><span class="identifier">copyable</span><span class="special">)(</span><span class="identifier">myvector</span><span class="special">)</span> <span class="special">(</span><span class="identifier">inherit</span><span class="special">)(</span><span class="identifier">vector_interface</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">&gt;)</span>
+<span class="special">(</span><span class="keyword">public</span><span class="special">)</span> <span class="special">(</span><span class="keyword">void</span><span class="special">)</span> <span class="special">(</span><span class="identifier">push_back</span><span class="special">)(</span> <span class="special">(</span><span class="keyword">const</span> <span class="identifier">T</span><span class="special">&amp;)(</span><span class="identifier">element</span><span class="special">)</span> <span class="special">)</span>
+</pre>
+<p>
+ The <code class="computeroutput"><span class="identifier">myvector</span></code> class type is
+ preceded by <code class="computeroutput"><span class="special">(</span><span class="identifier">copyable</span><span class="special">)</span></code> because, for this example, we wanted to
+ access the old object value <code class="computeroutput"><span class="identifier">CONTRACT_OLDOF</span><span class="special">(</span><span class="keyword">this</span><span class="special">)</span></code>
+ (as the object was before the function body execution) in the postconditions.
+ Also any function argument type can be tagged copyable if the old value of
+ the related argument is needed in the postconditions. In this example, <code class="computeroutput"><span class="special">(</span><span class="keyword">const</span> <span class="identifier">T</span><span class="special">&amp;)(</span><span class="identifier">element</span><span class="special">)</span></code> could have been tagged copyable and specified
+ in <span class="emphasis"><em>signature-sequence</em></span> as <code class="computeroutput"><span class="special">(</span><span class="identifier">copyable</span><span class="special">)(</span><span class="keyword">const</span> <span class="identifier">T</span><span class="special">&amp;)(</span><span class="identifier">element</span><span class="special">)</span></code> if the old value of the argument <code class="computeroutput"><span class="identifier">CONTRACT_OLDOF</span><span class="special">(</span><span class="identifier">element</span><span class="special">)</span></code>
+ (as the argument was before the body execution) was needed in the postconditions.
+ </p>
+<p>
+ Completing the example presented in the previous section, with the addition
+ of subcontracting <code class="computeroutput"><span class="identifier">myvector</span><span class="special">::</span><span class="identifier">push_back</span><span class="special">()</span></code> from <code class="computeroutput"><span class="identifier">pushable</span><span class="special">::</span><span class="identifier">push_back</span><span class="special">()</span></code>, we have:
+ </p>
+<pre class="programlisting"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> <span class="identifier">T</span><span class="special">&gt;</span>
+<span class="keyword">class</span> <span class="identifier">myvector</span><span class="special">:</span> <span class="keyword">public</span> <span class="identifier">pushable</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">&gt;</span> <span class="special">{</span>
+
+ <span class="identifier">CONTRACT_INVARIANT</span><span class="special">(</span> <span class="special">({</span>
+ <span class="identifier">CONTRACT_ASSERT</span><span class="special">(</span> <span class="special">(</span><span class="identifier">size</span><span class="special">()</span> <span class="special">==</span> <span class="number">0</span><span class="special">)</span> <span class="special">==</span> <span class="identifier">empty</span><span class="special">()</span> <span class="special">);</span>
+ <span class="special">})</span> <span class="special">)</span>
+
+<span class="keyword">public</span><span class="special">:</span>
+ <span class="keyword">void</span> <span class="identifier">push_back</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">T</span><span class="special">&amp;</span> <span class="identifier">element</span><span class="special">)</span>
+ <span class="identifier">CONTRACT_FUNCTION</span><span class="special">(</span> <span class="bold"><strong>(class) (copyable)(myvector)
+ (inherit)(pushable&lt;T&gt;)
+ (public) (void) (push_back)( (const T&amp;)(element) )</strong></span>
+ <span class="special">(</span><span class="identifier">precondition</span><span class="special">)</span> <span class="special">({</span>
+ <span class="identifier">CONTRACT_ASSERT</span><span class="special">(</span> <span class="identifier">size</span><span class="special">()</span> <span class="special">&lt;</span> <span class="identifier">max_size</span><span class="special">()</span> <span class="special">);</span>
+ <span class="special">})</span>
+ <span class="special">(</span><span class="identifier">postcondition</span><span class="special">)</span> <span class="special">({</span>
+ <span class="identifier">CONTRACT_ASSERT</span><span class="special">(</span> <span class="identifier">size</span><span class="special">()</span> <span class="special">==</span> <span class="special">(</span><span class="identifier">CONTRACT_OLDOF</span><span class="special">(</span><span class="keyword">this</span><span class="special">)-&gt;</span><span class="identifier">size</span><span class="special">()</span> <span class="special">+</span> <span class="number">1</span><span class="special">)</span> <span class="special">);</span>
+ <span class="special">})</span>
+ <span class="special">(</span><span class="identifier">body</span><span class="special">)</span> <span class="special">({</span>
+ <span class="identifier">vector_</span><span class="special">.</span><span class="identifier">push_back</span><span class="special">(</span><span class="identifier">element</span><span class="special">);</span>
+ <span class="special">})</span> <span class="special">)</span>
+
+ <span class="special">...</span> <span class="comment">// Rest of the class.</span>
+<span class="keyword">private</span><span class="special">:</span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">vector</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">&gt;</span> <span class="identifier">vector_</span><span class="special">;</span>
+<span class="special">};</span>
+</pre>
+<p>
+ This is a fully working example assuming that:
+ </p>
+<div class="orderedlist"><ol class="orderedlist" type="1">
+<li class="listitem">
+ <code class="computeroutput"><span class="identifier">pushable</span><span class="special">::</span><span class="identifier">push_back</span><span class="special">()</span></code>
+ also has a contract specified using this library since it is used for
+ subcontracting (this library allows to specify contracts also for pure
+ virtual functions, see below).
+ </li>
+<li class="listitem">
+ <code class="computeroutput"><span class="identifier">myvector</span></code> has an accessible
+ constant-correct <sup>[<a name="id873443" href="#ftn.id873443" class="footnote">11</a>]</sup> copy constructor since it was tagged <code class="computeroutput"><span class="special">(</span><span class="identifier">copyable</span><span class="special">)</span></code>
+ (see <code class="computeroutput"><span class="identifier">contract</span><span class="special">::</span>copy</code>):
+ </li>
+</ol></div>
+<pre class="programlisting"><span class="comment">// Must be accessible and construct from a const&amp; parameter.</span>
+<span class="identifier">myvector</span><span class="special">::</span><span class="identifier">myvector</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">myvector</span><span class="special">&amp;</span> <span class="identifier">source</span><span class="special">)</span> <span class="special">{</span> <span class="special">...</span> <span class="special">}</span>
+</pre>
+<p>
+ If either one of these conditions is not true, this library will generate
+ a compile-time errors when attempting to compile the code above.
+ </p>
+<a name="contract__.tutorial.signature_sequence.full_syntax"></a><h6>
+<a name="contract__.tutorial.signature_sequence.full_syntax-heading"></a>
+ <a class="link" href="tutorial.html#contract__.tutorial.signature_sequence.full_syntax">Full Syntax</a>
+ </h6>
+<p>
+ Generalizing this example to include <span class="emphasis"><em>all</em></span> possible syntactic
+ elements that can be found in a C++ function declaration, we obtain the full
+ syntax for <span class="emphasis"><em>signature-sequence</em></span>.
+ </p>
+<p>
+ <span class="bold"><strong><span class="emphasis"><em>signature-sequence</em></span> syntax for
+ <code class="computeroutput">CONTRACT_FUNCTION<span class="special">()</span></code>:</strong></span>
+ </p>
+<p>
+ For member functions:
+ </p>
+<pre class="programlisting"><span class="emphasis"><em>{</em></span><span class="special">(</span><span class="keyword">class</span><span class="special">)</span> <span class="emphasis"><em>|</em></span> <span class="special">(</span><span class="keyword">struct</span><span class="special">)</span><span class="emphasis"><em>}</em></span> /[/<span class="special">(</span><span class="identifier">copyable</span><span class="special">)</span>/]/<span class="special">(</span><span class="emphasis"><em>class-type</em></span><span class="special">)</span> <span class="emphasis"><em>{</em></span><span class="special">(</span><span class="identifier">inherit</span><span class="special">)(</span><span class="emphasis"><em>base-class-type</em></span><span class="special">)</span><span class="emphasis"><em>}*</em></span>
+<span class="emphasis"><em>{</em></span><span class="special">(</span><span class="keyword">public</span><span class="special">)</span> <span class="emphasis"><em>|</em></span> <span class="special">(</span><span class="keyword">protected</span><span class="special">)</span> <span class="emphasis"><em>|</em></span> <span class="special">(</span><span class="keyword">private</span><span class="special">)</span><span class="emphasis"><em>}</em></span>
+/[/<span class="special">(</span><span class="keyword">template</span><span class="special">)(</span> <span class="emphasis"><em>{</em></span><span class="special">(</span><span class="emphasis"><em>function-template-parameter-type</em></span><span class="special">)(</span><span class="emphasis"><em>function-template-parameter-name</em></span><span class="special">)</span><span class="emphasis"><em>}+</em></span> <span class="special">)</span>/]/
+/[/<span class="special">(</span><span class="keyword">inline</span><span class="special">)</span>/]/ /[/<span class="special">(</span><span class="keyword">static</span><span class="special">)</span>/]/ /[/<span class="special">(</span><span class="keyword">virtual</span><span class="special">)</span>/]/
+<span class="special">(</span><span class="emphasis"><em>result-type</em></span><span class="special">)</span> <span class="special">(</span><span class="emphasis"><em>function-name</em></span><span class="special">)(</span> <span class="emphasis"><em>{</em></span><span class="special">(</span><span class="keyword">void</span><span class="special">)</span> <span class="emphasis"><em>|</em></span> /{[/<span class="special">(</span><span class="identifier">copyable</span><span class="special">)</span>/]/<span class="special">(</span><span class="emphasis"><em>argument-type</em></span><span class="special">)(</span><span class="emphasis"><em>argument-name</em></span><span class="special">)</span><span class="emphasis"><em>}+}</em></span> <span class="special">)</span>
+/[/<span class="special">(</span><span class="keyword">const</span><span class="special">)</span>/]/ /[/<span class="special">(</span><span class="keyword">volatile</span><span class="special">)</span>/]/
+</pre>
+<p>
+ For non-member functions:
+ </p>
+<pre class="programlisting">/[[/<span class="special">(</span><span class="keyword">export</span><span class="special">)</span>/]/ <span class="special">(</span><span class="keyword">template</span><span class="special">)(</span> <span class="emphasis"><em>{</em></span><span class="special">(</span><span class="emphasis"><em>function-template-parameter-type</em></span><span class="special">)(</span><span class="emphasis"><em>function-template-parameter-name</em></span><span class="special">)</span><span class="emphasis"><em>}+</em></span> <span class="special">)</span>/]/
+/[/<span class="special">(</span><span class="keyword">inline</span><span class="special">)</span>/]/ /[/<span class="special">(</span><span class="keyword">extern</span> /[extern-string]/<span class="special">)</span>/]/
+<span class="special">(</span><span class="emphasis"><em>result-type</em></span><span class="special">)</span> <span class="special">(</span><span class="emphasis"><em>function-name</em></span><span class="special">)(</span> <span class="emphasis"><em>{</em></span><span class="special">(</span><span class="keyword">void</span><span class="special">)</span> <span class="emphasis"><em>|</em></span> /{[/<span class="special">(</span><span class="identifier">copyable</span><span class="special">)</span>/]/<span class="special">(</span><span class="emphasis"><em>argument-type</em></span><span class="special">)(</span><span class="emphasis"><em>argument-name</em></span><span class="special">)</span><span class="emphasis"><em>}+}</em></span> <span class="special">)</span>
+</pre>
+<p>
+ Note that <code class="computeroutput"><span class="special">(</span><span class="keyword">static</span><span class="special">)</span></code> is used as usual for static member function
+ but it cannot be specified for non-member functions because its use for non-members
+ was deprecated from C to C++.
+ </p>
+<p>
+ We have used the following conventions in writing the <span class="emphasis"><em>signature-sequence</em></span>
+ syntax:
+ </p>
+<div class="itemizedlist"><ul class="itemizedlist" type="disc">
+<li class="listitem">
+ // indicates an optional item.
+ </li>
+<li class="listitem">
+ <code class="literal">item</code><span class="emphasis"><em>*</em></span> indicates an item repeated
+ zero of more times.
+ </li>
+<li class="listitem">
+ <code class="literal">item</code><span class="emphasis"><em>+</em></span> indicates an item repeated
+ one of more times.
+ </li>
+<li class="listitem">
+ <span class="emphasis"><em>{</em></span><code class="literal">item1 </code> <span class="emphasis"><em>operation
+ </em></span> <code class="literal">item2 </code> <span class="emphasis"><em>operation ...}</em></span>
+ indicates the item resulting after evaluating the expression within the
+ curly parenthesis.
+ </li>
+<li class="listitem">
+ <code class="literal">item1</code> <span class="emphasis"><em>| </em></span> <code class="literal">item2</code>
+ indicates that one of the two items, but not both, must be specified.
+ </li>
+</ul></div>
+<p>
+ For example:
+ </p>
+<div class="itemizedlist"><ul class="itemizedlist" type="disc">
+<li class="listitem">
+ // indicates that <code class="computeroutput"><span class="special">(</span><span class="identifier">copyable</span><span class="special">)</span></code> is optional (it will only be specified
+ for variables with old values in postconditions).
+ </li>
+<li class="listitem">
+ <span class="emphasis"><em>{</em></span><code class="computeroutput"><span class="special">(</span><span class="identifier">inherit</span><span class="special">)(</span></code><span class="emphasis"><em>base-class-type</em></span><code class="computeroutput"><span class="special">)</span></code><span class="emphasis"><em>}*</em></span> indicates that
+ <code class="computeroutput"><span class="special">(</span><span class="identifier">inherit</span><span class="special">)(</span></code><span class="emphasis"><em>base-class-type</em></span><code class="computeroutput"><span class="special">)</span></code> can be repeated zero or more times (it
+ can be omitted, it will only be specified when subcontracting, and when
+ specified it can be repeated multiple times to support subcontracting
+ from multiple base classes in case of multiple inheritance).
+ </li>
+<li class="listitem">
+ /{/<code class="computeroutput"><span class="special">(</span></code><span class="emphasis"><em>argument-type</em></span><code class="computeroutput"><span class="special">)(</span></code>argument-name<code class="computeroutput"><span class="special">)</span></code><span class="emphasis"><em>}+</em></span>
+ indicates that the function arguments (when specified instead of <code class="computeroutput"><span class="special">(</span><span class="keyword">void</span><span class="special">)</span></code>) must be repeated one or more times
+ (together with their optional <code class="computeroutput"><span class="special">(</span><span class="identifier">copyable</span><span class="special">)</span></code>
+ tag).
+ </li>
+<li class="listitem">
+ // indicates that the access level is optional but when specified it
+ must be either <code class="computeroutput"><span class="special">(</span><span class="keyword">public</span><span class="special">)</span></code>, <code class="computeroutput"><span class="special">(</span><span class="keyword">protected</span><span class="special">)</span></code>,
+ or <code class="computeroutput"><span class="special">(</span><span class="keyword">private</span><span class="special">)</span></code>.
+ </li>
+</ul></div>
+<p>
+ The syntaxes of <span class="emphasis"><em>signature-sequence</em></span> used by <code class="computeroutput">CONTRACT_CONSTRUCTOR<span class="special">()</span></code>
+ and <code class="computeroutput">CONTRACT_DESTRUCTOR<span class="special">()</span></code> are somewhat different because C++ uses
+ different syntactic elements for constructor and destructor declarations
+ than for member functions (constructors cannot be virtual, destructors cannot
+ have function arguments, etc). However, the syntax for these <span class="emphasis"><em>signature-sequences</em></span>
+ are still obtained applying the basic rule of listing the constructor and
+ destructor signature tokens in the exact same order as they appear in the
+ constructor and destructor declarations.
+ </p>
+<p>
+ <span class="bold"><strong><span class="emphasis"><em>signature-sequence</em></span> syntax for
+ <code class="computeroutput">CONTRACT_CONSTRUCTOR<span class="special">()</span></code>:</strong></span>
+ </p>
+<pre class="programlisting"><span class="emphasis"><em>{</em></span><span class="special">(</span><span class="keyword">class</span><span class="special">)</span> <span class="emphasis"><em>|</em></span> <span class="special">(</span><span class="keyword">struct</span><span class="special">)</span><span class="emphasis"><em>}</em></span> <span class="special">(</span><span class="emphasis"><em>class-type</em></span><span class="special">)</span>
+<span class="emphasis"><em>{</em></span><span class="special">(</span><span class="keyword">public</span><span class="special">)</span> <span class="emphasis"><em>|</em></span> <span class="special">(</span><span class="keyword">protected</span><span class="special">)</span> <span class="emphasis"><em>|</em></span> <span class="special">(</span><span class="keyword">private</span><span class="special">)</span><span class="emphasis"><em>}</em></span>
+/[/<span class="special">(</span><span class="keyword">template</span><span class="special">)(</span> <span class="emphasis"><em>{</em></span><span class="special">(</span><span class="emphasis"><em>function-template-parameter-type</em></span><span class="special">)(</span><span class="emphasis"><em>function-template-parameter-name</em></span><span class="special">)</span><span class="emphasis"><em>}+</em></span> <span class="special">)</span>/]/
+/[/<span class="special">(</span><span class="keyword">explicit</span><span class="special">)</span>/]/ /[/<span class="special">(</span><span class="keyword">inline</span><span class="special">)</span>/]/
+<span class="special">(</span><span class="emphasis"><em>class-name</em></span><span class="special">)(</span> <span class="emphasis"><em>{</em></span><span class="special">(</span><span class="keyword">void</span><span class="special">)</span> <span class="emphasis"><em>|</em></span> /{[/<span class="special">(</span><span class="identifier">copyable</span><span class="special">)</span>/]/<span class="special">(</span><span class="emphasis"><em>argument-type</em></span><span class="special">)(</span><span class="emphasis"><em>argument-name</em></span><span class="special">)</span><span class="emphasis"><em>}+}</em></span> <span class="special">)</span>
+</pre>
+<p>
+ As usual, <span class="emphasis"><em>class-name</em></span> is used as the <span class="emphasis"><em>function-name</em></span>
+ for constructors and there is no <span class="emphasis"><em>result-type</em></span>. Furthermore,
+ the library does not currently error if <code class="computeroutput"><span class="special">(</span><span class="keyword">explicit</span><span class="special">)</span></code>
+ is not specified in <span class="emphasis"><em>signature-sequence</em></span> even if the contracted
+ constructor is <code class="computeroutput"><span class="keyword">explicit</span></code>. <sup>[<a name="id875088" href="#ftn.id875088" class="footnote">12</a>]</sup>
+ </p>
+<p>
+ <span class="bold"><strong><span class="emphasis"><em>signature-sequence</em></span> syntax for
+ <code class="computeroutput">CONTRACT_DESTRUCTOR<span class="special">()</span></code>:</strong></span>
+ </p>
+<pre class="programlisting"><span class="emphasis"><em>{</em></span><span class="special">(</span><span class="keyword">class</span><span class="special">)</span> <span class="emphasis"><em>|</em></span> <span class="special">(</span><span class="keyword">struct</span><span class="special">)</span><span class="emphasis"><em>}</em></span> <span class="special">(</span><span class="emphasis"><em>class-type</em></span><span class="special">)</span>
+<span class="emphasis"><em>{</em></span><span class="special">(</span><span class="keyword">public</span><span class="special">)</span> <span class="emphasis"><em>|</em></span> <span class="special">(</span><span class="keyword">protected</span><span class="special">)</span> <span class="emphasis"><em>|</em></span> <span class="special">(</span><span class="keyword">private</span><span class="special">)</span><span class="emphasis"><em>}</em></span>
+/[/<span class="special">(</span><span class="keyword">inline</span><span class="special">)</span>/]/ /[/<span class="special">(</span><span class="keyword">virtual</span><span class="special">)</span>/]/
+<span class="special">(</span><span class="emphasis"><em>class-name</em></span><span class="special">)(</span> <span class="special">(</span><span class="keyword">void</span><span class="special">)</span> <span class="special">)</span>
+</pre>
+<p>
+ Note that <span class="emphasis"><em>class-name</em></span> and <span class="emphasis"><em>not</em></span> <code class="computeroutput"><span class="special">~</span></code><span class="emphasis"><em>class-name</em></span> is used as
+ <span class="emphasis"><em>function-name</em></span> for destructors (<code class="computeroutput"><span class="string">"~"</span></code>
+ cannot be used because it is not a valid preprocessor token). Furthermore,
+ as usual destructors have no <span class="emphasis"><em>result-type</em></span> and no function
+ arguments (the argument list is always specified <code class="computeroutput"><span class="special">(</span><span class="keyword">void</span><span class="special">)</span></code>).
+ </p>
+<div class="important"><table border="0" summary="Important">
+<tr>
+<td rowspan="2" align="center" valign="top" width="25"><img alt="[Important]" src="../images/important.png"></td>
+<th align="left">Important</th>
+</tr>
+<tr><td align="left" valign="top">
+<p>
+ <span class="bold"><strong>Not in Signature Sequence</strong></span>
+ </p>
+<p>
+ Eventual function argument default values and the keywords <code class="computeroutput"><span class="keyword">friend</span></code>, <code class="computeroutput"><span class="keyword">throw</span></code>
+ (for exception specifications), <code class="computeroutput"><span class="keyword">auto</span></code>,
+ <code class="computeroutput"><span class="keyword">register</span></code>, <code class="computeroutput"><span class="keyword">union</span></code>
+ are <span class="bold"><strong>not</strong></span> repeated in the <span class="emphasis"><em>signature-sequence</em></span>
+ (the library will generate compile-time errors otherwise). However, these
+ features are still supported for the contracted function as discussed in
+ the rest of this section (with the exception of <code class="computeroutput"><span class="keyword">union</span></code>
+ for which contracts are not supported by this library).
+ </p>
+</td></tr>
+</table></div>
+<a name="contract__.tutorial.signature_sequence.syntax_errors"></a><h6>
+<a name="contract__.tutorial.signature_sequence.syntax_errors-heading"></a>
+ <a class="link" href="tutorial.html#contract__.tutorial.signature_sequence.syntax_errors">Syntax
+ Errors</a>
+ </h6>
+<p>
+ The usual C++ syntax constraints apply. For example, <code class="computeroutput"><span class="special">(</span><span class="keyword">static</span><span class="special">)</span></code> cannot
+ be specified together with <code class="computeroutput"><span class="special">(</span><span class="keyword">virtual</span><span class="special">)</span></code>.
+ </p>
+<p>
+ Furthermore, the tokens must be specified in the order listed above even
+ if the C++ syntax allows for different ordering. For example, <code class="computeroutput"><span class="special">(</span><span class="keyword">const</span><span class="special">)</span>
+ <span class="special">(</span><span class="keyword">volatile</span><span class="special">)</span></code> must be specified in this order, and not
+ as <code class="computeroutput"><span class="special">(</span><span class="keyword">volatile</span><span class="special">)</span> <span class="special">(</span><span class="keyword">const</span><span class="special">)</span></code>, even if C++ accepts both of orderings.
+ Fixing one specific ordering does not alter the semantics of the code. <sup>[<a name="id875701" href="#ftn.id875701" class="footnote">13</a>]</sup>
+ </p>
+<p>
+ The library will generate compile-time errors if <span class="emphasis"><em>signature-sequence</em></span>
+ contains tokens combinations which are not valid respect to the C++ syntax.
+ </p>
+<div class="warning"><table border="0" summary="Warning">
+<tr>
+<td rowspan="2" align="center" valign="top" width="25"><img alt="[Warning]" src="../images/warning.png"></td>
+<th align="left">Warning</th>
+</tr>
+<tr><td align="left" valign="top">
+<p>
+ <span class="bold"><strong>Cryptic Preprocessing Errors</strong></span>
+ </p>
+<p>
+ There is only a limited amount of compile-time error checking which this
+ library can do on <span class="emphasis"><em>signature-sequence</em></span>. In some cases,
+ and depending on the compiler used, an error in programming the <span class="emphasis"><em>signature-sequence</em></span>
+ syntax will result in cryptic compiler errors.
+ </p>
+<p>
+ These compiler errors might involve library internal templates and macros
+ as well as Boost.Preprocessor
+ internal macros (<code class="computeroutput"><span class="identifier">BOOST_PP_</span><span class="special">...</span></code>). Furthermore, the error line number
+ will only refer to the first line of code at which the contract macro appears
+ (because new lines within macro parameters are removed by the preprocessor).
+ </p>
+<p>
+ The best way to resolve these errors is usually to inspect the <span class="emphasis"><em>signature-sequence</em></span>
+ by eye instead of trying to make sense of the compiler error messages.
+ Also, try to compile with contracts turned off to make sure that the errors
+ are actually in the contract code. Rarely, it might be useful to look at
+ the code generated by the contract macro expansion after preprocessing
+ using your compiler related options ("-E -P" on GCC, "/EP"
+ on Microsoft Visual C++, etc).
+ </p>
+<p>
+ While the C++ preprocessor imposes limits on the amount of error checking
+ that can be performed on <span class="emphasis"><em>signature-sequence</em></span>, the current
+ library implementation does <span class="emphasis"><em>not</em></span> implement the best
+ possible preprocessor error detection and reporting strategy. This is an
+ area of improvement for the library that is currently being worked on.
+ </p>
+<p>
+ <span class="underline">Please report on the library <a href="http://sourceforge.net/projects/dbcpp/forums/forum/920163" target="_top">help
+ website</a> the criptic preprocessing errors you experience in order
+ to facilitate this process.</span>
+ </p>
+</td></tr>
+</table></div>
+</div>
+<div class="section">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="contract__.tutorial.function_arguments"></a><a class="link" href="tutorial.html#contract__.tutorial.function_arguments" title="Function Arguments">Function Arguments</a>
+</h3></div></div></div>
+<p>
+ Note that within <span class="emphasis"><em>signature-sequence</em></span>, multiple function
+ arguments (as well as function template parameters) are <span class="emphasis"><em>not</em></span>
+ separated by commas (you can use a space or a new line instead):
+ </p>
+<pre class="programlisting"><span class="special">(</span><span class="emphasis"><em>function-name</em></span><span class="special">)(</span> <span class="special">(</span><span class="emphasis"><em>argument-type1</em></span><span class="special">)(</span><span class="emphasis"><em>argument-name1</em></span><span class="special">)</span>
+ <span class="comment">/* no comma (a space or new line can be used instead) */</span>
+ <span class="special">(</span><span class="emphasis"><em>argument-type2</em></span><span class="special">)(</span><span class="emphasis"><em>arguments-name2</em></span><span class="special">)</span>
+ <span class="comment">/* no comma (a space or new line can be used instead) */</span>
+ <span class="special">(</span><span class="emphasis"><em>argument-type3</em></span><span class="special">)(</span><span class="emphasis"><em>argument-name3</em></span><span class="special">)</span> <span class="emphasis"><em>...</em></span> <span class="special">)</span>
+</pre>
+<a name="contract__.tutorial.function_arguments.no_argument"></a><h6>
+<a name="contract__.tutorial.function_arguments.no_argument-heading"></a>
+ <a class="link" href="tutorial.html#contract__.tutorial.function_arguments.no_argument">No Argument</a>
+ </h6>
+<p>
+ If the function has no arguments, the argument list must be specified <code class="computeroutput"><span class="keyword">void</span></code>:
+ </p>
+<pre class="programlisting"><span class="special">(</span><span class="emphasis"><em>function-name</em></span><span class="special">)(</span> <span class="special">(</span><span class="keyword">void</span><span class="special">)</span> <span class="special">)</span>
+</pre>
+<p>
+ Note that <code class="computeroutput"><span class="special">(</span></code><span class="emphasis"><em>function-name</em></span><code class="computeroutput"><span class="special">)(</span> <span class="special">)</span></code> <span class="bold"><strong>cannot</strong></span> be used instead and it will generate a (cryptic)
+ compile-time error.
+ </p>
+<div class="note"><table border="0" summary="Note">
+<tr>
+<td rowspan="2" align="center" valign="top" width="25"><img alt="[Note]" src="../images/note.png"></td>
+<th align="left">Note</th>
+</tr>
+<tr><td align="left" valign="top">
+<p>
+ An empty function argument list cannot be represented simply by empty parenthesis
+ <code class="computeroutput"><span class="special">()</span></code> as in <code class="computeroutput"><span class="special">(</span></code><span class="emphasis"><em>function-name</em></span><code class="computeroutput"><span class="special">)()</span></code> because the C++ standard does not allow
+ to specify empty preprocessor sequence elements like <code class="computeroutput"><span class="special">()</span></code>
+ thus <code class="computeroutput"><span class="special">(</span></code><span class="emphasis"><em>function-name</em></span><code class="computeroutput"><span class="special">)(</span> <span class="special">(</span><span class="keyword">void</span><span class="special">)</span> <span class="special">)</span></code> must
+ be used instead. Note that the C++ standard allows to use <code class="computeroutput"><span class="keyword">void</span></code> to specify a function with no arguments
+ <span class="emphasis"><em>function-name</em></span><code class="computeroutput"><span class="special">(</span><span class="keyword">void</span><span class="special">)</span></code> (this
+ is the syntax used in all the examples of this documentations to be consistent
+ with the relative <span class="emphasis"><em>signature-sequence</em></span> syntax requirement).
+ </p>
+<p>
+ The C99 standard instead allows for empty preprocessor sequence elements
+ <code class="computeroutput"><span class="special">()</span></code> (because it allows for
+ empty macro parameters, see <a class="link" href="bibliography.html" title="Bibliography">[Nelson2004]</a>
+ and Boost.Preprocessor
+ for details). C99 also defines deprecated the use of <code class="computeroutput"><span class="keyword">void</span></code>
+ for functions with no arguments -- <span class="emphasis"><em>function-name</em></span><code class="computeroutput"><span class="special">(</span><span class="keyword">void</span><span class="special">)</span></code>
+ is deprecated. Therefore, on C99 compilers <code class="computeroutput"><span class="special">(</span></code><span class="emphasis"><em>function-name</em></span><code class="computeroutput"><span class="special">)()</span></code> should be used in <span class="emphasis"><em>signature-sequence</em></span>
+ for functions with no arguments instead of <code class="computeroutput"><span class="special">(</span></code><span class="emphasis"><em>function-name</em></span><code class="computeroutput"><span class="special">)(</span> <span class="special">(</span><span class="keyword">void</span><span class="special">)</span> <span class="special">)</span></code>.
+ </p>
+<p>
+ This library supports both syntaxes <code class="computeroutput"><span class="special">(</span></code><span class="emphasis"><em>function-name</em></span><code class="computeroutput"><span class="special">)(</span> <span class="special">(</span><span class="keyword">void</span><span class="special">)</span> <span class="special">)</span></code> and
+ <code class="computeroutput"><span class="special">(</span></code><span class="emphasis"><em>function-name</em></span><code class="computeroutput"><span class="special">)()</span></code> in <span class="emphasis"><em>signature-sequence</em></span>
+ but the later syntax will only compile for C99 (so it is not recommended).
+ </p>
+<p>
+ The same limitation applies to the <code class="computeroutput">CONTRACT_INVARIANT<span class="special">()</span></code> macro when the class has no invariant.
+ Also in this case the library supports both syntaxes <code class="computeroutput">CONTRACT_INVARIANT<span class="special">(</span> <span class="special">({})</span> <span class="special">)</span></code> and <code class="computeroutput">CONTRACT_INVARIANT<span class="special">()</span></code> bu the later syntax will only compile
+ for C99 (so it is not recommended).
+ </p>
+</td></tr>
+</table></div>
+<a name="contract__.tutorial.function_arguments.default_arguments"></a><h6>
+<a name="contract__.tutorial.function_arguments.default_arguments-heading"></a>
+ <a class="link" href="tutorial.html#contract__.tutorial.function_arguments.default_arguments">Default
+ Arguments</a>
+ </h6>
+<p>
+ If the contracted function has default argument values, the default values
+ are <span class="emphasis"><em>not</em></span> repeated in <span class="emphasis"><em>signature-sequence</em></span>
+ for which only the argument type and name are specified. However, the default
+ argument values specified for the contracted function work as usual and the
+ caller can omit to specify such augments when calling the contracted function:
+ </p>
+<pre class="programlisting"><span class="keyword">int</span> <span class="identifier">f</span><span class="special">(</span><span class="keyword">int</span> <span class="identifier">x</span> <span class="special">=</span> <span class="number">0</span><span class="special">)</span>
+<span class="identifier">CONTRACT_FUNCTION</span><span class="special">(</span> <span class="special">(</span><span class="keyword">int</span><span class="special">)</span> <span class="special">(</span><span class="identifier">f</span><span class="special">)(</span> <span class="special">(</span><span class="keyword">int</span><span class="special">)(</span><span class="identifier">x</span><span class="special">)</span> <span class="special">)</span> <span class="bold"><strong>// Do not repeat default value 0.</strong></span>
+<span class="special">(</span><span class="identifier">precondition</span><span class="special">)</span> <span class="special">({</span>
+ <span class="identifier">CONTRACT_ASSERT</span><span class="special">(</span> <span class="identifier">x</span> <span class="special">&gt;=</span> <span class="number">0</span> <span class="special">);</span>
+<span class="special">})</span>
+<span class="special">(</span><span class="identifier">postcondition</span><span class="special">)</span> <span class="special">(</span><span class="identifier">result</span><span class="special">)</span> <span class="special">({</span>
+ <span class="identifier">CONTRACT_ASSERT</span><span class="special">(</span> <span class="identifier">result</span> <span class="special">==</span> <span class="special">(</span><span class="identifier">x</span> <span class="special">+</span> <span class="number">10</span><span class="special">)</span> <span class="special">);</span>
+<span class="special">})</span>
+<span class="special">(</span><span class="identifier">body</span><span class="special">)</span> <span class="special">({</span>
+ <span class="keyword">return</span> <span class="identifier">x</span> <span class="special">+</span> <span class="number">10</span><span class="special">;</span>
+<span class="special">})</span> <span class="special">)</span>
+
+<span class="special">...</span>
+<span class="keyword">int</span> <span class="identifier">y</span> <span class="special">=</span> <span class="identifier">f</span><span class="special">();</span> <span class="bold"><strong>// y is 10 (call uses default value 0).</strong></span>
+<span class="identifier">y</span> <span class="special">=</span> <span class="identifier">f</span><span class="special">(</span><span class="number">2</span><span class="special">);</span> <span class="comment">// y is 12.</span>
+<span class="identifier">y</span> <span class="special">=</span> <span class="identifier">f</span><span class="special">(-</span><span class="number">1</span><span class="special">);</span> <span class="comment">// Call precondition failure handler.</span>
+</pre>
+</div>
+<div class="section">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="contract__.tutorial.inheritance"></a><a class="link" href="tutorial.html#contract__.tutorial.inheritance" title="Inheritance">Inheritance</a>
+</h3></div></div></div>
+<p>
+ The library supports subcontracting from multiple base classes in case of
+ multiple inheritance. Contracts are for pure virtual functions are also supported
+ as usual when body definition is deferred to the derived classes (see below).
+ </p>
+<p>
+ However, note that constructors and destructors do not directly subcontract
+ (their <span class="emphasis"><em>signature-sequences</em></span> do not accept any <code class="computeroutput"><span class="special">(</span><span class="identifier">inherit</span><span class="special">)(</span></code><span class="emphasis"><em>base-class-type</em></span><code class="computeroutput"><span class="special">)</span></code> token). This is because the C++ object construction
+ and destruction mechanism will automatically execute the code that checks
+ the base class constructor and destructor contracts if present.
+ </p>
+<a name="contract__.tutorial.inheritance.multiple_inheritance"></a><h6>
+<a name="contract__.tutorial.inheritance.multiple_inheritance-heading"></a>
+ <a class="link" href="tutorial.html#contract__.tutorial.inheritance.multiple_inheritance">Multiple
+ Inheritance</a>
+ </h6>
+<p>
+ In case of multiple inheritance, it is possible to subcontract from multiple
+ base classes by repeating <code class="computeroutput"><span class="special">(</span><span class="identifier">inherit</span><span class="special">)(</span></code><span class="emphasis"><em>base-class-type</em></span><code class="computeroutput"><span class="special">)</span></code> multiple times in <span class="emphasis"><em>signature-sequence</em></span>.
+ For example, assuming <code class="computeroutput"><span class="identifier">myvector</span></code>
+ is inheriting and subcontracting from <span class="emphasis"><em>both</em></span> the <code class="computeroutput"><span class="identifier">boundable</span></code> and the <code class="computeroutput"><span class="identifier">basic_begin</span></code>
+ base classes:
+ </p>
+<pre class="programlisting"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> <span class="identifier">T</span><span class="special">&gt;</span>
+<span class="keyword">class</span> <span class="identifier">myvector</span><span class="special">:</span>
+ <span class="keyword">public</span> <span class="bold"><strong>boundable&lt;typename std::vector&lt;T&gt;::const_iterator&gt;</strong></span><span class="special">,</span>
+ <span class="keyword">private</span> <span class="bold"><strong>basic_begin&lt;typename std::vector&lt;T&gt;::const_iterator&gt;</strong></span> <span class="special">{</span>
+ <span class="special">...</span> <span class="comment">// Class invariants.</span>
+
+<span class="keyword">public</span><span class="special">:</span>
+ <span class="keyword">typedef</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">vector</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">&gt;::</span><span class="identifier">const_iterator</span> <span class="identifier">const_iterator</span><span class="special">;</span>
+
+ <span class="identifier">const_iterator</span> <span class="identifier">begin</span><span class="special">(</span><span class="keyword">void</span><span class="special">)</span> <span class="keyword">const</span>
+ <span class="identifier">CONTRACT_FUNCTION</span><span class="special">(</span> <span class="special">(</span><span class="keyword">class</span><span class="special">)</span> <span class="special">(</span><span class="identifier">myvector</span><span class="special">)</span>
+ <span class="comment">// Multiple inheritance.</span>
+ <span class="bold"><strong>(inherit)(boundable&lt;const_iterator&gt;)</strong></span>
+ <span class="bold"><strong>(inherit)(basic_begin&lt;const_iterator&gt;)</strong></span>
+ <span class="special">(</span><span class="keyword">public</span><span class="special">)</span> <span class="special">(</span><span class="identifier">const_iterator</span><span class="special">)</span> <span class="special">(</span><span class="identifier">begin</span><span class="special">)(</span> <span class="special">(</span><span class="keyword">void</span><span class="special">)</span> <span class="special">)</span> <span class="special">(</span><span class="keyword">const</span><span class="special">)</span>
+ <span class="comment">// No preconditions (omitted).</span>
+ <span class="special">(</span><span class="identifier">postcondition</span><span class="special">)</span> <span class="special">(</span><span class="identifier">result</span><span class="special">)</span> <span class="special">({</span> <span class="comment">// Return value `result` in postconditions.</span>
+ <span class="keyword">if</span> <span class="special">(</span><span class="identifier">empty</span><span class="special">())</span> <span class="identifier">CONTRACT_ASSERT</span><span class="special">(</span> <span class="identifier">result</span> <span class="special">==</span> <span class="identifier">end</span><span class="special">()</span> <span class="special">);</span>
+ <span class="special">})</span>
+ <span class="special">(</span><span class="identifier">body</span><span class="special">)</span> <span class="special">({</span>
+ <span class="comment">// Must use CONTRACT_BODY() when calling the base function.</span>
+ <span class="keyword">if</span> <span class="special">(</span><span class="identifier">basic_begin</span><span class="special">&lt;</span><span class="identifier">const_iterator</span><span class="special">&gt;::</span><span class="bold"><strong>CONTRACT_BODY</strong></span><span class="special">(</span><span class="identifier">begin</span><span class="special">)</span> <span class="special">==</span>
+ <span class="identifier">const_iterator</span><span class="special">())</span> <span class="special">{</span>
+ <span class="keyword">return</span> <span class="identifier">const_iterator</span><span class="special">();</span>
+ <span class="special">}</span>
+ <span class="keyword">return</span> <span class="identifier">vector_</span><span class="special">.</span><span class="identifier">begin</span><span class="special">();</span>
+ <span class="special">})</span> <span class="special">)</span>
+
+ <span class="special">...</span> <span class="comment">// Rest of the class.</span>
+<span class="keyword">private</span><span class="special">:</span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">vector</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">&gt;</span> <span class="identifier">vector_</span><span class="special">;</span>
+<span class="special">};</span>
+</pre>
+<p>
+ The subcontracted contracts are checked in the order in which their <code class="computeroutput"><span class="special">(</span><span class="identifier">inherit</span><span class="special">)</span></code> tokens are listed in <span class="emphasis"><em>signature-sequence</em></span>
+ and the derived class contracts are checked last.
+ </p>
+<div class="note"><table border="0" summary="Note">
+<tr>
+<td rowspan="2" align="center" valign="top" width="25"><img alt="[Note]" src="../images/note.png"></td>
+<th align="left">Note</th>
+</tr>
+<tr><td align="left" valign="top">
+<p>
+ The above implies that if a derived class relaxes the precondition of an
+ overridden function, all the base contract preconditions will have be checked
+ first to fails before the relaxed preconditions of the overridden function
+ are checked to pass.
+ </p>
+<p>
+ In this case, it would appear more efficient to check the derived class
+ contract first. However, the derived class invariants could be written
+ assuming that the base class invariants hold true (for example the base
+ class invariants could assert a pointer to be not null and thus the derived
+ class invariants could deference the pointer without checking for nullity).
+ In doing so, the derived class invariants assume that they are checked
+ last in <span class="emphasis"><em>AND</em></span> with all base classes invariants. The
+ same argument can be made for postconditions. Therefore, if derived class
+ invariants (and postconditions) should be checked last in <span class="emphasis"><em>AND</em></span>
+ with all base classes invariants (and postconditions). It is natural to
+ follow the same policy and check derived class function preconditions last
+ in the <span class="emphasis"><em>OR</em></span> with all base class function preconditions
+ (even if this introduces the inefficiency to have to check and fail all
+ the base class function preconditions when a derived class function if
+ relaxing the base class function preconditions).
+ </p>
+</td></tr>
+</table></div>
+<a name="contract__.tutorial.inheritance.base_function_call"></a><h6>
+<a name="contract__.tutorial.inheritance.base_function_call-heading"></a>
+ <a class="link" href="tutorial.html#contract__.tutorial.inheritance.base_function_call">Base Function
+ Call</a>
+ </h6>
+<p>
+ When the derived class invokes the overridden function in the base class
+ the <code class="computeroutput"><span class="identifier">CONTRACT_BODY</span><span class="special">()</span></code>
+ macro must be used:
+ </p>
+<pre class="programlisting"><span class="emphasis"><em>base-class</em></span><span class="special">::</span><span class="identifier">CONTRACT_BODY</span><span class="special">(</span><span class="emphasis"><em>function-name</em></span><span class="special">)(...)</span>
+</pre>
+<p>
+ as illustrated by the example above. The overriding function should <span class="bold"><strong>not</strong></span> call the overridden function directly without
+ using the macro:
+ </p>
+<pre class="programlisting"><span class="emphasis"><em>base-class</em></span><span class="special">::</span><span class="emphasis"><em>function-name</em></span><span class="special">)(...)</span>
+</pre>
+<p>
+ because this call will cause the contracts to executed infinite recursive
+ calls (due to the dynamic binding of the contracted virtual base function
+ <span class="emphasis"><em>base-class</em></span><code class="computeroutput"><span class="special">::</span></code><span class="emphasis"><em>function-name</em></span>).
+ <sup>[<a name="id878201" href="#ftn.id878201" class="footnote">14</a>]</sup>
+ </p>
+<div class="warning"><table border="0" summary="Warning">
+<tr>
+<td rowspan="2" align="center" valign="top" width="25"><img alt="[Warning]" src="../images/warning.png"></td>
+<th align="left">Warning</th>
+</tr>
+<tr><td align="left" valign="top">
+<p>
+ <span class="bold"><strong>Base Calls via CONTRACT_BODY()</strong></span>
+ </p>
+<p>
+ Overriding functions must use <span class="emphasis"><em>base-class</em></span><code class="computeroutput"><span class="special">::</span><span class="identifier">CONTRACT_BODY</span><span class="special">(</span></code><span class="emphasis"><em>function-name</em></span><code class="computeroutput"><span class="special">)</span></code> and not just <span class="emphasis"><em>base-class</em></span><code class="computeroutput"><span class="special">::</span></code><span class="emphasis"><em>function-name</em></span> when
+ calling the overridden functions (otherwise the contract calls will cause
+ infinite recursion).
+ </p>
+</td></tr>
+</table></div>
+</div>
+<div class="section">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="contract__.tutorial.operators"></a><a class="link" href="tutorial.html#contract__.tutorial.operators" title="Operators">Operators</a>
+</h3></div></div></div>
+<p>
+ The library supports contracts for operators.
+ </p>
+<p>
+ For operators, the <code class="computeroutput"><span class="special">(</span></code><span class="emphasis"><em>function-name</em></span><code class="computeroutput"><span class="special">)</span></code> token in <span class="emphasis"><em>signature-sequence</em></span>
+ must contain both the operator symbol and the operator <span class="emphasis"><em>name</em></span>
+ spelled out in words without using any special symbol (this is necessary
+ because, in general, the operator special symbols (<code class="computeroutput"><span class="special">[]</span></code>,
+ <code class="computeroutput"><span class="special">==</span></code>, <code class="computeroutput"><span class="special">&lt;&lt;</span></code>,
+ etc) are not valid preprocessor tokens). For operators, <code class="computeroutput"><span class="special">(</span></code><span class="emphasis"><em>function-name</em></span><code class="computeroutput"><span class="special">)</span></code> takes the following form:
+ </p>
+<pre class="programlisting"><span class="special">(</span><span class="keyword">operator</span><span class="special">(</span><span class="emphasis"><em>symbol</em></span><span class="special">,</span> <span class="emphasis"><em>name</em></span><span class="special">))</span>
+</pre>
+<p>
+ Note the necessary double closing parenthesis <code class="computeroutput"><span class="string">"))"</span></code>
+ at the end. For example:
+ </p>
+<pre class="programlisting"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> <span class="identifier">T</span><span class="special">&gt;</span>
+<span class="keyword">class</span> <span class="identifier">myvector</span> <span class="special">{</span>
+ <span class="special">...</span> <span class="comment">// Class invariants.</span>
+
+<span class="keyword">public</span><span class="special">:</span>
+ <span class="keyword">typedef</span> <span class="keyword">typename</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">vector</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">&gt;::</span><span class="identifier">size_type</span> <span class="identifier">size_type</span><span class="special">;</span>
+ <span class="keyword">typedef</span> <span class="keyword">typename</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">vector</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">&gt;::</span><span class="identifier">const_reference</span> <span class="identifier">const_reference</span><span class="special">;</span>
+
+ <span class="identifier">const_reference</span> *operator[]*<span class="special">(</span><span class="identifier">size_type</span> <span class="identifier">index</span><span class="special">)</span> <span class="keyword">const</span>
+ <span class="identifier">CONTRACT_FUNCTION</span><span class="special">(</span> <span class="special">(</span><span class="keyword">class</span><span class="special">)</span> <span class="special">(</span><span class="identifier">myvector</span><span class="special">)</span>
+ <span class="special">(</span><span class="keyword">public</span><span class="special">)</span> <span class="special">(</span><span class="identifier">const_reference</span><span class="special">)</span> *(operator([]*<span class="bold"><strong>, at))</strong></span><span class="special">(</span>
+ <span class="special">(</span><span class="identifier">size_type</span><span class="special">)(</span><span class="identifier">index</span><span class="special">)</span> <span class="special">)</span> <span class="special">(</span><span class="keyword">const</span><span class="special">)</span>
+ <span class="special">(</span><span class="identifier">precondition</span><span class="special">)</span> <span class="special">({</span>
+ <span class="identifier">CONTRACT_ASSERT</span><span class="special">(</span> <span class="identifier">index</span> <span class="special">&lt;</span> <span class="identifier">size</span><span class="special">()</span> <span class="special">);</span>
+ <span class="special">})</span>
+ <span class="comment">// No postconditions (omitted).</span>
+ <span class="special">(</span><span class="identifier">body</span><span class="special">)</span> <span class="special">({</span>
+ <span class="keyword">return</span> <span class="identifier">vector_</span><span class="special">[</span><span class="identifier">index</span><span class="special">];</span>
+ <span class="special">})</span> <span class="special">)</span>
+
+ <span class="special">...</span> <span class="comment">// Rest of the class.</span>
+<span class="keyword">private</span><span class="special">:</span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">vector</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">&gt;</span> <span class="identifier">vector_</span><span class="special">;</span>
+<span class="special">};</span>
+</pre>
+<p>
+ The operator name, in this example <code class="computeroutput"><span class="string">"at"</span></code>,
+ is arbitrary and any name without special symbols can been used.
+ </p>
+</div>
+<div class="section">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="contract__.tutorial.overloaded_functions"></a><a class="link" href="tutorial.html#contract__.tutorial.overloaded_functions" title="Overloaded Functions">Overloaded
+ Functions</a>
+</h3></div></div></div>
+<p>
+ The library supports contracts for overloaded functions.
+ </p>
+<div class="note"><table border="0" summary="Note">
+<tr>
+<td rowspan="2" align="center" valign="top" width="25"><img alt="[Note]" src="../images/note.png"></td>
+<th align="left">Note</th>
+</tr>
+<tr><td align="left" valign="top">
+<p>
+ However, the library uses the argument <span class="bold"><strong>names</strong></span>
+ to distinguish the overloaded function signatures whereas C++ uses the
+ argument types (this is because, in general, the argument types, for example
+ <code class="computeroutput"><span class="keyword">const</span> <span class="keyword">int</span><span class="special">&amp;</span></code>, are not valid preprocessor tokens).
+ </p>
+<p>
+ If two functions share the same name, the same number of arguments, and
+ the same <code class="computeroutput"><span class="keyword">const</span></code> qualifier then
+ their argument names (and not just their types) must be different to allow
+ the library to distinguish these two functions from each other. (This is
+ usually not a significant limitation because different argument names can
+ be given.)
+ </p>
+</td></tr>
+</table></div>
+<p>
+ For example:
+ </p>
+<pre class="programlisting"><span class="keyword">class</span> <span class="identifier">number</span> <span class="special">{</span>
+<span class="keyword">public</span><span class="special">:</span>
+ <span class="comment">// Overloaded functions distinguished using argument names (not types) and const.</span>
+
+ <span class="identifier">number</span> <span class="identifier">add</span><span class="special">(</span><span class="keyword">const</span> <span class="keyword">int</span><span class="special">&amp;</span> <span class="identifier">n</span><span class="special">)</span> <span class="comment">// (1)</span>
+ <span class="identifier">CONTRACT_FUNCTION</span><span class="special">(...)</span>
+
+ <span class="comment">// OK -- different from (1) because this is `const`.</span>
+ <span class="identifier">number</span><span class="special">&amp;</span> <span class="identifier">add</span><span class="special">(</span><span class="keyword">const</span> <span class="keyword">int</span><span class="special">&amp;</span> <span class="identifier">n</span><span class="special">)</span> <span class="keyword">const</span>
+ <span class="identifier">CONTRACT_FUNCTION</span><span class="special">(...)</span>
+
+ <span class="comment">// OK -- different from (1) because argument named "d" instead of "n".</span>
+ <span class="identifier">number</span> <span class="identifier">add</span><span class="special">(</span><span class="keyword">const</span> <span class="keyword">double</span><span class="special">&amp;</span> <span class="identifier">d</span><span class="special">)</span>
+ <span class="identifier">CONTRACT_FUNCTION</span><span class="special">(...)</span>
+
+ <span class="comment">// Error -- same as (1) because both non-const and with argument named "n" (even if different argument type).</span>
+ <span class="identifier">number</span> <span class="identifier">add</span><span class="special">(</span><span class="keyword">const</span> <span class="keyword">double</span><span class="special">&amp;</span> <span class="identifier">n</span><span class="special">)</span>
+ <span class="identifier">CONTRACT_FUNCTION</span><span class="special">(...)</span> <span class="comment">// Same as (1), error!</span>
+
+ <span class="special">...</span>
+<span class="special">};</span>
+</pre>
+</div>
+<div class="section">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="contract__.tutorial.function_templates"></a><a class="link" href="tutorial.html#contract__.tutorial.function_templates" title="Function Templates">Function Templates</a>
+</h3></div></div></div>
+<p>
+ The <code class="computeroutput"><span class="special">(</span><span class="keyword">template</span><span class="special">)</span></code> token is used in <span class="emphasis"><em>signature-sequence</em></span>
+ to specify a function template listing the relative template parameters.
+ The template parameters are specified using a syntax similar to the one of
+ the function arguments.
+ </p>
+<p>
+ For example:
+ </p>
+<pre class="programlisting"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> <span class="identifier">T</span><span class="special">&gt;</span>
+<span class="keyword">class</span> <span class="identifier">myvector</span> <span class="special">{</span>
+ <span class="special">...</span> <span class="comment">// Class invariants.</span>
+
+<span class="keyword">private</span><span class="special">:</span>
+ <span class="bold"><strong>template&lt;class Iter&gt;</strong></span>
+ <span class="keyword">static</span> <span class="keyword">bool</span> <span class="identifier">all_equals</span><span class="special">(</span><span class="identifier">Iter</span> <span class="identifier">first</span><span class="special">,</span> <span class="identifier">Iter</span> <span class="identifier">last</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">T</span><span class="special">&amp;</span> <span class="identifier">element</span><span class="special">)</span>
+ <span class="identifier">CONTRACT_FUNCTION</span><span class="special">(</span> <span class="special">(</span><span class="keyword">class</span><span class="special">)</span> <span class="special">(</span><span class="identifier">myvector</span><span class="special">)</span>
+ <span class="special">(</span><span class="keyword">private</span><span class="special">)</span> <span class="bold"><strong>(template)( (class)(Iter) )</strong></span>
+ <span class="special">(</span><span class="keyword">static</span><span class="special">)</span> <span class="special">(</span><span class="keyword">bool</span><span class="special">)</span> <span class="special">(</span><span class="identifier">all_equals</span><span class="special">)(</span>
+ <span class="special">(</span><span class="identifier">Iter</span><span class="special">)(</span><span class="identifier">first</span><span class="special">)</span> <span class="special">(</span><span class="identifier">Iter</span><span class="special">)(</span><span class="identifier">last</span><span class="special">)</span> <span class="special">(</span><span class="keyword">const</span> <span class="identifier">T</span><span class="special">&amp;)(</span><span class="identifier">element</span><span class="special">)</span> <span class="special">)</span>
+ <span class="special">(</span><span class="identifier">precondition</span><span class="special">)</span> <span class="special">({</span>
+ <span class="identifier">CONTRACT_ASSERT</span><span class="special">(</span> <span class="identifier">first</span> <span class="special">&lt;</span> <span class="identifier">last</span> <span class="special">);</span>
+ <span class="special">})</span>
+ <span class="special">(</span><span class="identifier">body</span><span class="special">)</span> <span class="special">({</span>
+ <span class="keyword">for</span> <span class="special">(</span><span class="identifier">Iter</span> <span class="identifier">i</span> <span class="special">=</span> <span class="identifier">first</span><span class="special">;</span> <span class="identifier">i</span> <span class="special">&lt;</span> <span class="identifier">last</span><span class="special">;</span> <span class="special">++</span><span class="identifier">i</span><span class="special">)</span> <span class="special">{</span>
+ <span class="keyword">if</span> <span class="special">(*</span><span class="identifier">i</span> <span class="special">!=</span> <span class="identifier">element</span><span class="special">)</span> <span class="keyword">return</span> <span class="keyword">false</span><span class="special">;</span>
+ <span class="special">}</span>
+ <span class="keyword">return</span> <span class="keyword">true</span><span class="special">;</span>
+ <span class="special">})</span> <span class="special">)</span>
+
+ <span class="special">...</span> <span class="comment">// Rest of the class.</span>
+<span class="special">};</span>
+</pre>
+<p>
+ In this example, the function also happens to be a static member but any
+ function (non-member, member, static member, constructor, etc) can be be
+ declared a template function as usual in C++.
+ </p>
+<p>
+ In principle, the library also supports contracts for <code class="computeroutput"><span class="keyword">export</span></code>
+ class and function templates. For non-member function templates <code class="computeroutput"><span class="special">(</span><span class="keyword">export</span><span class="special">)</span></code>
+ can be specified within the <span class="emphasis"><em>signature-sequence</em></span> as usual.
+ However, most compilers do not support <code class="computeroutput"><span class="keyword">export</span></code>
+ templates and this library feature has not being tested.
+ </p>
+</div>
+<div class="section">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="contract__.tutorial.deferring_the_body"></a><a class="link" href="tutorial.html#contract__.tutorial.deferring_the_body" title="Deferring the Body">Deferring the
+ Body</a>
+</h3></div></div></div>
+<p>
+ Class invariants, preconditions, and postconditions are part of the function
+ specifications (indeed they <span class="emphasis"><em>assert</em></span> the function specifications).
+ Therefore, this library requires contracts to be defined together with the
+ function declarations. However, the function body (i.e., the function implementation)
+ can be defined either together with the function declaration or separately.
+ </p>
+<p>
+ In other words, the usual C++ feature that allows to separate a function
+ definition from its declaration is retained by this library.
+ </p>
+<a name="contract__.tutorial.deferring_the_body.separating_declaration_and_definition"></a><h6>
+<a name="contract__.tutorial.deferring_the_body.separating_declaration_and_definition-heading"></a>
+ <a class="link" href="tutorial.html#contract__.tutorial.deferring_the_body.separating_declaration_and_definition">Separating
+ Declaration and Definition</a>
+ </h6>
+<p>
+ When the function body is defined separately from the function declaration:
+ </p>
+<div class="itemizedlist"><ul class="itemizedlist" type="disc">
+<li class="listitem">
+ The <code class="computeroutput"><span class="special">(</span><span class="identifier">body</span><span class="special">)(;)</span></code> tokens are used to define the body
+ in the macro parameter passed to <code class="computeroutput">CONTRACT_FUNCTION<span class="special">()</span></code>. The <code class="computeroutput"><span class="string">";"</span></code>
+ symbol is the usual C++ symbol used to separate the function definition
+ from its declaration.
+ </li>
+<li class="listitem">
+ The <code class="computeroutput">CONTRACT_BODY<span class="special">(</span></code><span class="emphasis"><em>function-name</em></span><code class="computeroutput"><span class="special">)</span></code> macro is used to name the function where
+ it is defined. Again, for operators <span class="emphasis"><em>function-name</em></span>
+ must be specified as <code class="computeroutput"><span class="keyword">operator</span><span class="special">(</span></code><span class="emphasis"><em>symbol</em></span><code class="computeroutput"><span class="special">,</span> </code><span class="emphasis"><em>name</em></span><code class="computeroutput"><span class="special">)</span></code>.
+ </li>
+<li class="listitem">
+ Similarly, it is possible to separate constructor and destructor body
+ definitions. In this case, the macros <code class="computeroutput">CONTRACT_CONSTRUCTOR_BODY<span class="special">(</span></code><span class="emphasis"><em>class-type</em></span><code class="computeroutput"><span class="special">,</span> </code><span class="emphasis"><em>class-name</em></span><code class="computeroutput"><span class="special">)</span></code> and <code class="computeroutput">CONTRACT_DESTRUCTOR_BODY<span class="special">(</span></code><span class="emphasis"><em>class-type</em></span><code class="computeroutput"><span class="special">,</span> </code><span class="emphasis"><em>class-name</em></span><code class="computeroutput"><span class="special">)</span></code> should be used when the constructor
+ and destructor are defined respectively (note again that <code class="computeroutput"><span class="string">"~"</span></code> is <span class="emphasis"><em>not</em></span>
+ specified to name destructors, just use the class name instead).
+ </li>
+</ul></div>
+<p>
+ For example:
+ </p>
+<pre class="programlisting"><span class="comment">// Declarations (usually in header files).</span>
+
+<span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> <span class="identifier">T</span><span class="special">&gt;</span>
+<span class="keyword">class</span> <span class="identifier">myvector</span><span class="special">:</span>
+ <span class="keyword">public</span> <span class="identifier">boundable</span><span class="special">&lt;</span><span class="keyword">typename</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">vector</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">&gt;::</span><span class="identifier">const_iterator</span><span class="special">&gt;,</span>
+ <span class="keyword">private</span> <span class="identifier">basic_begin</span><span class="special">&lt;</span><span class="keyword">typename</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">vector</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">&gt;::</span><span class="identifier">const_iterator</span><span class="special">&gt;</span> <span class="special">{</span>
+ <span class="special">...</span> <span class="comment">// Class invariants.</span>
+
+<span class="keyword">public</span><span class="special">:</span>
+ <span class="keyword">typedef</span> <span class="keyword">typename</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">vector</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">&gt;::</span><span class="identifier">size_type</span> <span class="identifier">size_type</span><span class="special">;</span>
+ <span class="keyword">typedef</span> <span class="keyword">typename</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">vector</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">&gt;::</span><span class="identifier">const_reference</span> <span class="identifier">const_reference</span><span class="special">;</span>
+ <span class="keyword">typedef</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">vector</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">&gt;::</span><span class="identifier">const_iterator</span> <span class="identifier">const_iterator</span><span class="special">;</span>
+
+ <span class="identifier">myvector</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">myvector</span><span class="special">&amp;</span> <span class="identifier">right</span><span class="special">)</span>
+ <span class="identifier">CONTRACT_CONSTRUCTOR</span><span class="special">(</span> <span class="special">(</span><span class="keyword">class</span><span class="special">)</span> <span class="special">(</span><span class="identifier">myvector</span><span class="special">)</span>
+ <span class="special">(</span><span class="keyword">public</span><span class="special">)</span> <span class="special">(</span><span class="identifier">myvector</span><span class="special">)(</span> <span class="special">(</span><span class="keyword">const</span> <span class="identifier">myvector</span><span class="special">&amp;)(</span><span class="identifier">right</span><span class="special">)</span> <span class="special">)</span>
+ <span class="special">(</span><span class="identifier">postcondition</span><span class="special">)</span> <span class="special">({</span>
+ <span class="identifier">CONTRACT_ASSERT</span><span class="special">(</span> <span class="identifier">vector_</span> <span class="special">==</span> <span class="identifier">right</span><span class="special">.</span><span class="identifier">vector_</span> <span class="special">);</span>
+ <span class="special">})</span>
+ <span class="special">(</span><span class="identifier">body</span><span class="special">)</span> <span class="special">(</span>
+ <span class="bold"><strong>;</strong></span> <span class="comment">// Deferres body definition.</span>
+ <span class="special">)</span> <span class="special">)</span>
+
+ <span class="keyword">virtual</span> <span class="special">~</span><span class="identifier">myvector</span><span class="special">(</span><span class="keyword">void</span><span class="special">)</span>
+ <span class="identifier">CONTRACT_DESTRUCTOR</span><span class="special">(</span>
+ <span class="special">(</span><span class="keyword">class</span><span class="special">)</span> <span class="special">(</span><span class="identifier">myvector</span><span class="special">)</span>
+ <span class="special">(</span><span class="keyword">public</span><span class="special">)</span> <span class="special">(</span><span class="keyword">virtual</span><span class="special">)</span> <span class="special">(</span><span class="identifier">myvector</span><span class="special">)(</span> <span class="special">(</span><span class="keyword">void</span><span class="special">)</span> <span class="special">)</span>
+ <span class="special">(</span><span class="identifier">body</span><span class="special">)</span> <span class="special">(</span>
+ <span class="bold"><strong>;</strong></span>
+ <span class="special">)</span> <span class="special">)</span>
+
+ <span class="identifier">const_iterator</span> <span class="identifier">begin</span><span class="special">(</span><span class="keyword">void</span><span class="special">)</span> <span class="keyword">const</span>
+ <span class="identifier">CONTRACT_FUNCTION</span><span class="special">(</span> <span class="special">(</span><span class="keyword">class</span><span class="special">)</span> <span class="special">(</span><span class="identifier">myvector</span><span class="special">)</span>
+ <span class="special">(</span><span class="identifier">inherit</span><span class="special">)(</span><span class="identifier">boundable</span><span class="special">&lt;</span><span class="identifier">const_iterator</span><span class="special">&gt;)</span>
+ <span class="special">(</span><span class="identifier">inherit</span><span class="special">)(</span><span class="identifier">basic_begin</span><span class="special">&lt;</span><span class="identifier">const_iterator</span><span class="special">&gt;)</span>
+ <span class="special">(</span><span class="keyword">public</span><span class="special">)</span> <span class="special">(</span><span class="identifier">const_iterator</span><span class="special">)</span> <span class="special">(</span><span class="identifier">begin</span><span class="special">)(</span> <span class="special">(</span><span class="keyword">void</span><span class="special">)</span> <span class="special">)</span> <span class="special">(</span><span class="keyword">const</span><span class="special">)</span>
+ <span class="special">(</span><span class="identifier">postcondition</span><span class="special">)</span> <span class="special">(</span><span class="identifier">result</span><span class="special">)</span> <span class="special">({</span>
+ <span class="keyword">if</span> <span class="special">(</span><span class="identifier">empty</span><span class="special">())</span> <span class="identifier">CONTRACT_ASSERT</span><span class="special">(</span> <span class="identifier">result</span> <span class="special">==</span> <span class="identifier">end</span><span class="special">()</span> <span class="special">);</span>
+ <span class="special">})</span>
+ <span class="special">(</span><span class="identifier">body</span><span class="special">)</span> <span class="special">(</span>
+ <span class="bold"><strong>;</strong></span>
+ <span class="special">)</span> <span class="special">)</span>
+
+ <span class="identifier">const_reference</span> <span class="keyword">operator</span><span class="special">[](</span><span class="identifier">size_type</span> <span class="identifier">index</span><span class="special">)</span> <span class="keyword">const</span>
+ <span class="identifier">CONTRACT_FUNCTION</span><span class="special">(</span> <span class="special">(</span><span class="keyword">class</span><span class="special">)</span> <span class="special">(</span><span class="identifier">myvector</span><span class="special">)</span>
+ <span class="special">(</span><span class="keyword">public</span><span class="special">)</span> <span class="special">(</span><span class="identifier">const_reference</span><span class="special">)</span> <span class="special">(</span><span class="keyword">operator</span><span class="special">([],</span> <span class="identifier">at</span><span class="special">))(</span>
+ <span class="special">(</span><span class="identifier">size_type</span><span class="special">)(</span><span class="identifier">index</span><span class="special">)</span> <span class="special">)</span> <span class="special">(</span><span class="keyword">const</span><span class="special">)</span>
+ <span class="special">(</span><span class="identifier">precondition</span><span class="special">)</span> <span class="special">({</span>
+ <span class="identifier">CONTRACT_ASSERT</span><span class="special">(</span> <span class="identifier">index</span> <span class="special">&lt;</span> <span class="identifier">size</span><span class="special">()</span> <span class="special">);</span>
+ <span class="special">})</span>
+ <span class="special">(</span><span class="identifier">body</span><span class="special">)</span> <span class="special">(</span>
+ <span class="bold"><strong>;</strong></span>
+ <span class="special">)</span> <span class="special">)</span>
+
+ <span class="special">...</span> <span class="comment">// Rest of the class.</span>
+<span class="keyword">private</span><span class="special">:</span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">vector</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">&gt;</span> <span class="identifier">vector_</span><span class="special">;</span>
+<span class="special">};</span>
+
+<span class="comment">// Separated definitions (eventually in a different file).</span>
+
+<span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> <span class="identifier">T</span><span class="special">&gt;</span>
+<span class="bold"><strong>CONTRACT_CONSTRUCTOR_BODY(myvector&lt;T&gt;, myvector)</strong></span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">myvector</span><span class="special">&amp;</span> <span class="identifier">right</span><span class="special">)</span> <span class="special">{</span>
+ <span class="identifier">vector_</span> <span class="special">=</span> <span class="identifier">right</span><span class="special">.</span><span class="identifier">vector_</span><span class="special">;</span>
+<span class="special">}</span>
+
+<span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> <span class="identifier">T</span><span class="special">&gt;</span>
+<span class="bold"><strong>CONTRACT_DESTRUCTOR_BODY(myvector&lt;T&gt;, myvector)</strong></span><span class="special">(</span><span class="keyword">void</span><span class="special">)</span> <span class="special">{</span>
+ <span class="comment">// Do nothing in this case.</span>
+<span class="special">}</span>
+
+<span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> <span class="identifier">T</span><span class="special">&gt;</span>
+<span class="keyword">typename</span> <span class="identifier">myvector</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">&gt;::</span><span class="identifier">iterator</span> <span class="identifier">myvector</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">&gt;::</span><span class="bold"><strong>CONTRACT_BODY(begin)</strong></span><span class="special">(</span><span class="keyword">void</span><span class="special">)</span> <span class="special">{</span>
+ <span class="keyword">return</span> <span class="identifier">vector_</span><span class="special">.</span><span class="identifier">begin</span><span class="special">();</span>
+<span class="special">}</span>
+
+<span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> <span class="identifier">T</span><span class="special">&gt;</span>
+<span class="keyword">typename</span> <span class="identifier">myvector</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">&gt;::</span><span class="identifier">const_reference</span> <span class="identifier">myvector</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">&gt;::</span>
+ *CONTRACT_BODY(operator([]*<span class="bold"><strong>, at))</strong></span><span class="special">(</span><span class="identifier">size_type</span> <span class="identifier">index</span><span class="special">)</span> <span class="keyword">const</span> <span class="special">{</span>
+ <span class="keyword">return</span> <span class="identifier">vector_</span><span class="special">[</span><span class="identifier">index</span><span class="special">];</span>
+<span class="special">}</span>
+</pre>
+<p>
+ In addition to the usual benefits of separating function definitions from
+ their declarations (smaller and more readable header files, less recompilation
+ needed, etc), this separation also improves the library compile-time error
+ messages. When a function is defined together with its declaration, the function
+ implementation code is passed as one single macro parameter <code class="computeroutput"><span class="special">(</span><span class="identifier">body</span><span class="special">)({</span>
+ <span class="special">...</span> <span class="special">})</span></code>
+ to the contract macros. Macro preprocessing removes all newline characters
+ from within the macro parameters so the implementation code is compiled as
+ if it were written on a single line. As a result, any compile-time error
+ within the function body code will be reported having the same line number
+ and it will be harder to track. Instead, if the body definition is separated
+ from the function declaration, the definition code is not wrapped within
+ a macro parameter and the compiler errors will indicate useful line numbers.
+ </p>
+<div class="note"><table border="0" summary="Note">
+<tr>
+<td rowspan="2" align="center" valign="top" width="25"><img alt="[Note]" src="../images/note.png"></td>
+<th align="left">Note</th>
+</tr>
+<tr><td align="left" valign="top"><p>
+ It is recommended to separate the body definition from the function declaration
+ so that line numbers in compiler errors retain their usual values.
+ </p></td></tr>
+</table></div>
+<p>
+ Finally, note how the <span class="emphasis"><em>signature-sequence</em></span> unusual syntax
+ does <span class="emphasis"><em>not</em></span> propagate to the function definitions (only
+ the function name is changed in the function definitions). Therefore, when
+ definitions are separated from declarations, the files containing the definitions
+ (usually the ".cpp" files) will not contain the unusual <span class="emphasis"><em>signature-sequence</em></span>
+ syntax and they will be easier to read.
+ </p>
+<div class="warning"><table border="0" summary="Warning">
+<tr>
+<td rowspan="2" align="center" valign="top" width="25"><img alt="[Warning]" src="../images/warning.png"></td>
+<th align="left">Warning</th>
+</tr>
+<tr><td align="left" valign="top">
+<p>
+ <span class="bold"><strong>Constructor Member Initialization List</strong></span>
+ </p>
+<p>
+ Because of a library limitation, it is not possible to separate a constructor
+ definition from its declaration when the constructor uses a member initialization
+ list (see <code class="computeroutput">CONTRACT_CONSTRUCTOR_BODY<span class="special">()</span></code> macro for details and workarounds) <sup>[<a name="id883083" href="#ftn.id883083" class="footnote">15</a>]</sup>.
+ </p>
+</td></tr>
+</table></div>
+<a name="contract__.tutorial.deferring_the_body.pure_virtual_functions"></a><h6>
+<a name="contract__.tutorial.deferring_the_body.pure_virtual_functions-heading"></a>
+ <a class="link" href="tutorial.html#contract__.tutorial.deferring_the_body.pure_virtual_functions">Pure
+ Virtual Functions</a>
+ </h6>
+<p>
+ The library also supports contracts for pure virtual functions.
+ </p>
+<p>
+ In this case, the <code class="computeroutput"><span class="special">(</span><span class="identifier">body</span><span class="special">)(=</span> <span class="number">0</span><span class="special">;)</span></code>
+ tokens are used to define the body in the macro parameter passed to <code class="computeroutput">CONTRACT_FUNCTION<span class="special">()</span></code>.
+ The <code class="computeroutput"><span class="string">"= 0;"</span></code> symbol is
+ the usual C++ symbol used to specify pure virtual functions.
+ </p>
+<p>
+ For example:
+ </p>
+<pre class="programlisting"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> <span class="identifier">T</span><span class="special">&gt;</span>
+<span class="keyword">class</span> <span class="identifier">pushable</span> <span class="special">{</span>
+ <span class="special">...</span>
+
+<span class="keyword">public</span><span class="special">:</span>
+ <span class="keyword">virtual</span> <span class="keyword">void</span> <span class="identifier">push_back</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">T</span><span class="special">&amp;</span> <span class="identifier">element</span><span class="special">)</span>
+ <span class="identifier">CONTRACT_FUNCTION</span><span class="special">(</span> <span class="special">(</span><span class="keyword">class</span><span class="special">)</span> <span class="special">(</span><span class="identifier">pushable</span><span class="special">)</span>
+ <span class="special">(</span><span class="keyword">public</span><span class="special">)</span> <span class="special">(</span><span class="keyword">virtual</span><span class="special">)</span> <span class="special">(</span><span class="keyword">void</span><span class="special">)</span> <span class="special">(</span><span class="identifier">push_back</span><span class="special">)(</span> <span class="special">(</span><span class="keyword">const</span> <span class="identifier">T</span><span class="special">&amp;)(</span><span class="identifier">element</span><span class="special">)</span> <span class="special">)</span>
+ <span class="special">(</span><span class="identifier">postcondition</span><span class="special">)</span> <span class="special">({</span>
+ <span class="identifier">CONTRACT_ASSERT</span><span class="special">(</span> <span class="identifier">back</span><span class="special">()</span> <span class="special">==</span> <span class="identifier">element</span> <span class="special">);</span>
+ <span class="special">})</span>
+ <span class="special">(</span><span class="identifier">body</span><span class="special">)</span> <span class="special">(</span>
+ <span class="special">=</span> <span class="number">0</span><span class="special">;</span>
+ <span class="special">)</span> <span class="special">)</span> <span class="comment">// Pure virtual body.</span>
+<span class="special">};</span>
+</pre>
+</div>
+<div class="section">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="contract__.tutorial.friends"></a><a class="link" href="tutorial.html#contract__.tutorial.friends" title="Friends">Friends</a>
+</h3></div></div></div>
+<p>
+ The library supports contracts for friend non-member functions (and friend
+ classes work as usual).
+ </p>
+<p>
+ However, when a friend non-member function is contracted:
+ </p>
+<div class="orderedlist"><ol class="orderedlist" type="1">
+<li class="listitem">
+ The function definition must always be separated from its friendship
+ declaration (whereas, C++ allows to define friends function in place
+ together with they friendship declarations).
+ </li>
+<li class="listitem">
+ The body function <code class="computeroutput">CONTRACT_BODY<span class="special">(</span></code><span class="emphasis"><em>function-name</em></span><code class="computeroutput"><span class="special">)</span></code>, and not the contracted function <span class="emphasis"><em>function-name</em></span>,
+ must be declared friend using .
+ </li>
+</ol></div>
+<p>
+ For example:
+ </p>
+<p>
+
+</p>
+<pre class="programlisting"><span class="keyword">class</span> <span class="identifier">point</span> <span class="special">{</span>
+<span class="keyword">public</span><span class="special">:</span>
+ <span class="identifier">point</span><span class="special">(</span><span class="keyword">const</span> <span class="keyword">double</span><span class="special">&amp;</span> <span class="identifier">x</span><span class="special">,</span> <span class="keyword">const</span> <span class="keyword">double</span><span class="special">&amp;</span> <span class="identifier">y</span><span class="special">):</span> <span class="identifier">x_</span><span class="special">(</span><span class="identifier">x</span><span class="special">),</span> <span class="identifier">y_</span><span class="special">(</span><span class="identifier">y</span><span class="special">)</span> <span class="special">{}</span>
+
+ <span class="keyword">bool</span> <span class="identifier">printable</span><span class="special">(</span><span class="keyword">void</span><span class="special">)</span> <span class="keyword">const</span> <span class="special">{</span> <span class="keyword">return</span> <span class="keyword">true</span><span class="special">;</span> <span class="special">}</span> <span class="comment">// Dummy implementation.</span>
+
+ <span class="comment">// Forward declare body as friend.</span>
+ <span class="keyword">friend</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">ostream</span><span class="special">&amp;</span> <span class="identifier">CONTRACT_NONMEMBER_BODY</span><span class="special">(</span><span class="keyword">operator</span><span class="special">(&lt;&lt;,</span> <span class="identifier">out</span><span class="special">))(</span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">ostream</span><span class="special">&amp;</span> <span class="identifier">s</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">point</span><span class="special">&amp;</span> <span class="identifier">o</span><span class="special">);</span>
+
+<span class="keyword">private</span><span class="special">:</span>
+ <span class="keyword">double</span> <span class="identifier">x_</span><span class="special">;</span>
+ <span class="keyword">double</span> <span class="identifier">y_</span><span class="special">;</span>
+<span class="special">};</span>
+
+<span class="identifier">CONTRACT_FUNCTION</span><span class="special">(</span>
+<span class="special">(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">ostream</span><span class="special">&amp;)</span> <span class="special">(</span><span class="keyword">operator</span><span class="special">(&lt;&lt;,</span> <span class="identifier">out</span><span class="special">))(</span> <span class="special">(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">ostream</span><span class="special">&amp;)(</span><span class="identifier">s</span><span class="special">)</span> <span class="special">(</span><span class="keyword">const</span> <span class="identifier">point</span><span class="special">&amp;)(</span><span class="identifier">o</span><span class="special">)</span> <span class="special">)</span>
+ <span class="special">(</span><span class="identifier">precondition</span><span class="special">)(</span> <span class="special">(</span><span class="identifier">o</span><span class="special">.</span><span class="identifier">printable</span><span class="special">())</span> <span class="special">)</span>
+<span class="special">({</span>
+ <span class="keyword">return</span> <span class="identifier">s</span> <span class="special">&lt;&lt;</span> <span class="string">"("</span> <span class="special">&lt;&lt;</span> <span class="identifier">o</span><span class="special">.</span><span class="identifier">x_</span> <span class="special">&lt;&lt;</span> <span class="string">", "</span> <span class="special">&lt;&lt;</span> <span class="identifier">o</span><span class="special">.</span><span class="identifier">y_</span> <span class="special">&lt;&lt;</span> <span class="string">")"</span><span class="special">;</span>
+<span class="special">})</span> <span class="special">)</span>
+
+</pre>
+<p>
+ </p>
+</div>
+<div class="section">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="contract__.tutorial.structs_and_unions"></a><a class="link" href="tutorial.html#contract__.tutorial.structs_and_unions" title="Structs and Unions">Structs and Unions</a>
+</h3></div></div></div>
+<p>
+ Note that <code class="computeroutput"><span class="special">(</span><span class="keyword">class</span><span class="special">)</span></code> and <code class="computeroutput"><span class="special">(</span><span class="keyword">struct</span><span class="special">)</span></code> can
+ be used interchangeably in the <span class="emphasis"><em>signature-sequence</em></span> as
+ the library makes <span class="emphasis"><em>no</em></span> differentiation between contracts
+ for classes and a structs. However, as always remember:
+ </p>
+<div class="orderedlist"><ol class="orderedlist" type="1">
+<li class="listitem">
+ To always specify the member access level <code class="computeroutput"><span class="special">(</span><span class="keyword">public</span><span class="special">)</span></code>,
+ etc.
+ </li>
+<li class="listitem">
+ To use <code class="computeroutput">CONTRACT_INVARIANT<span class="special">()</span></code> in a private section also for <code class="computeroutput"><span class="keyword">struct</span></code>.
+ </li>
+<li class="listitem">
+ That no contract is checked (not event the class invariants) when member
+ variables are accessed directly (so it might be best for the <code class="computeroutput"><span class="keyword">struct</span></code> to have no non-constant public
+ member variable).
+ </li>
+</ol></div>
+<p>
+ For example:
+ </p>
+<p>
+
+</p>
+<pre class="programlisting"><span class="keyword">struct</span> <span class="identifier">positive</span> <span class="special">{</span>
+ <span class="keyword">const</span> <span class="keyword">double</span><span class="special">&amp;</span> <span class="identifier">number</span><span class="special">;</span>
+
+<span class="keyword">private</span><span class="special">:</span> <span class="comment">// Alway contract class (invariants, etc) in a private section at top.</span>
+ <span class="identifier">CONTRACT_CLASS</span><span class="special">(</span> <span class="special">(</span><span class="identifier">positive</span><span class="special">)</span>
+ <span class="special">(</span><span class="identifier">invariant</span><span class="special">)(</span>
+ <span class="special">(</span><span class="identifier">number</span> <span class="special">&gt;</span> <span class="number">0.0</span><span class="special">)</span>
+ <span class="special">)</span> <span class="special">)</span>
+
+<span class="keyword">public</span><span class="special">:</span> <span class="comment">// Remember to always specify the access level (public, etc).</span>
+ <span class="identifier">CONTRACT_CONSTRUCTOR</span><span class="special">(</span>
+ <span class="special">(</span><span class="keyword">public</span><span class="special">)</span> <span class="special">(</span><span class="identifier">positive</span><span class="special">)(</span> <span class="special">(</span><span class="keyword">const</span> <span class="keyword">double</span><span class="special">&amp;)(</span><span class="identifier">n</span><span class="special">)</span> <span class="special">)</span> <span class="special">(</span><span class="identifier">number</span><span class="special">(</span><span class="identifier">n</span><span class="special">))</span>
+ <span class="special">(</span><span class="identifier">precondition</span><span class="special">)(</span> <span class="special">(</span><span class="identifier">n</span> <span class="special">&gt;</span> <span class="number">0.0</span><span class="special">)</span> <span class="special">)</span>
+ <span class="special">({</span>
+ <span class="special">})</span> <span class="special">)</span>
+<span class="special">};</span>
+
+</pre>
+<p>
+ </p>
+<p>
+ This library does <span class="emphasis"><em>not</em></span> support contracts for unions and
+ <code class="computeroutput"><span class="special">(</span><span class="keyword">union</span><span class="special">)</span></code> cannot be specified in the <span class="emphasis"><em>signature-sequence</em></span>.
+ Contracts for unions are not supported because union member variable allocations
+ overlap and they cannot have constructors instead the library needs to augment
+ the object state using a (non overlapping) <code class="computeroutput"><span class="identifier">contract</span><span class="special">::</span>state</code>
+ member variable with a default constructor to disable invariant checking
+ in nested function calls.
+ </p>
+</div>
+<div class="section">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="contract__.tutorial.qualifiers"></a><a class="link" href="tutorial.html#contract__.tutorial.qualifiers" title="Qualifiers">Qualifiers</a>
+</h3></div></div></div>
+<p>
+ This library supports contracts also when constant, linkage, storage, etc
+ qualifiers are specified.
+ </p>
+<a name="contract__.tutorial.qualifiers.const_and_volatile"></a><h6>
+<a name="contract__.tutorial.qualifiers.const_and_volatile-heading"></a>
+ <a class="link" href="tutorial.html#contract__.tutorial.qualifiers.const_and_volatile">Const and
+ Volatile</a>
+ </h6>
+<p>
+ The <code class="computeroutput"><span class="keyword">const</span></code> and <code class="computeroutput"><span class="keyword">volatile</span></code> qualifiers are repeated in the <span class="emphasis"><em>signature-sequence</em></span>
+ and they can be used as usual. However, when they are both specified they
+ must appear in the order <code class="computeroutput"><span class="special">(</span><span class="keyword">const</span><span class="special">)</span> <span class="special">(</span><span class="keyword">volatile</span><span class="special">)</span></code> and not <code class="computeroutput"><span class="special">(</span><span class="keyword">volatile</span><span class="special">)</span> <span class="special">(</span><span class="keyword">const</span><span class="special">)</span></code>.
+ </p>
+<p>
+ The invariant, precondition, and postcondition functions are always <code class="computeroutput"><span class="keyword">const</span></code> to ensure contract constant-correctness.
+ In addition, the eventual <code class="computeroutput"><span class="keyword">const</span></code>
+ and <code class="computeroutput"><span class="keyword">volatile</span></code> qualifiers specified
+ for the contracted function are applied to the body, precondition, and postcondition
+ functions as well. Therefore, applying the usual <code class="computeroutput"><span class="keyword">const</span>
+ <span class="keyword">volatile</span></code> semantics, note the followings:
+ </p>
+<div class="orderedlist"><ol class="orderedlist" type="1">
+<li class="listitem">
+ Class invariants can access any <code class="computeroutput"><span class="keyword">const</span></code>
+ and <code class="computeroutput"><span class="keyword">const</span> <span class="keyword">volatile</span></code>
+ member.
+ </li>
+<li class="listitem">
+ Preconditions and postconditions of non-<code class="computeroutput"><span class="keyword">const</span></code>
+ and <code class="computeroutput"><span class="keyword">const</span></code> members can access
+ any <code class="computeroutput"><span class="keyword">const</span></code> and <code class="computeroutput"><span class="keyword">const</span> <span class="keyword">volatile</span></code>
+ member.
+ </li>
+<li class="listitem">
+ Preconditions and postconditions of <code class="computeroutput"><span class="keyword">volatile</span></code>
+ members can only access <code class="computeroutput"><span class="keyword">const</span>
+ <span class="keyword">volatile</span></code> members.
+ </li>
+<li class="listitem">
+ If a <code class="computeroutput"><span class="keyword">volatile</span></code> member function
+ tags the class type <code class="computeroutput"><span class="special">(</span><span class="identifier">copyable</span><span class="special">)</span></code> so to use the object old value in postconditions
+ then the object old value is, as well as the object current value, <code class="computeroutput"><span class="keyword">const</span> <span class="keyword">volatile</span></code>
+ qualified and therefore programmers must specify a constant-correct copy
+ constructor for the <code class="computeroutput"><span class="keyword">volatile</span></code>
+ object type otherwise the library will generate a compile-time error
+ (note that C++ will automatically synthesize only the constant-correct
+ copy constructor the the original class type and not for the <code class="computeroutput"><span class="keyword">volatile</span></code> class type).
+ </li>
+</ol></div>
+<p>
+ For example:
+ </p>
+<p>
+
+</p>
+<pre class="programlisting"><span class="keyword">class</span> <span class="identifier">z</span><span class="special">:</span> <span class="keyword">public</span> <span class="identifier">b</span> <span class="special">{</span> <span class="comment">// Some base class b to show subcontracting.</span>
+
+ <span class="identifier">CONTRACT_CLASS</span><span class="special">(</span> <span class="special">(</span><span class="identifier">z</span><span class="special">)</span> <span class="special">(</span><span class="keyword">public</span><span class="special">)(</span><span class="identifier">b</span><span class="special">)</span>
+ <span class="special">(</span><span class="identifier">invariant</span><span class="special">)(</span>
+ <span class="special">(</span><span class="identifier">check_c</span><span class="special">()</span> <span class="special">&amp;&amp;</span> <span class="identifier">check_cv</span><span class="special">())</span> <span class="comment">// const</span>
+ <span class="special">)</span> <span class="special">)</span>
+
+<span class="keyword">public</span><span class="special">:</span>
+ <span class="identifier">z</span><span class="special">(</span><span class="keyword">void</span><span class="special">)</span> <span class="special">{}</span>
+
+ <span class="comment">// For old object, must manually program const-correct copy</span>
+ <span class="comment">// constructor for volatile type (instead use `z(constz&amp;)`</span>
+ <span class="comment">// automatically synthesized by C++ for non-volatile type).</span>
+ <span class="identifier">z</span><span class="special">(</span><span class="keyword">const</span> <span class="keyword">volatile</span> <span class="identifier">z</span><span class="special">&amp;</span> <span class="identifier">source</span><span class="special">)</span> <span class="special">{}</span>
+
+ <span class="identifier">CONTRACT_FUNCTION</span><span class="special">(</span>
+ <span class="special">(</span><span class="keyword">public</span><span class="special">)</span> <span class="special">(</span><span class="keyword">int</span><span class="special">)</span> <span class="special">(</span><span class="identifier">f</span><span class="special">)(</span> <span class="special">(</span><span class="keyword">void</span><span class="special">)</span> <span class="special">)</span> <span class="special">(</span><span class="identifier">copyable</span><span class="special">)</span> <span class="comment">// no-cv</span>
+ <span class="special">(</span><span class="identifier">precondition</span><span class="special">)(</span> <span class="special">(</span><span class="identifier">check_c</span><span class="special">()</span> <span class="special">&amp;&amp;</span> <span class="identifier">check_cv</span><span class="special">())</span> <span class="special">)</span> <span class="comment">// const</span>
+ <span class="special">(</span><span class="identifier">postcondition</span><span class="special">)(</span><span class="identifier">result</span><span class="special">)(</span>
+ <span class="special">(</span><span class="identifier">check_c</span><span class="special">()</span> <span class="special">&amp;&amp;</span> <span class="identifier">check_cv</span><span class="special">())</span> <span class="comment">// const</span>
+ <span class="special">(</span><span class="identifier">CONTRACT_OLDOF</span><span class="special">(</span><span class="keyword">this</span><span class="special">)-&gt;</span><span class="identifier">check_c</span><span class="special">()</span> <span class="comment">// oldof(this) also const</span>
+ <span class="special">&amp;&amp;</span> <span class="identifier">CONTRACT_OLDOF</span><span class="special">(</span><span class="keyword">this</span><span class="special">)-&gt;</span><span class="identifier">check_cv</span><span class="special">())</span>
+ <span class="special">)</span>
+ <span class="special">({</span> <span class="comment">// no-cv</span>
+ <span class="identifier">check_nocv</span><span class="special">();</span> <span class="identifier">check_c</span><span class="special">();</span> <span class="identifier">check_v</span><span class="special">();</span> <span class="identifier">check_cv</span><span class="special">();</span>
+ <span class="keyword">return</span> <span class="number">1</span><span class="special">;</span>
+ <span class="special">})</span> <span class="special">)</span>
+
+ <span class="identifier">CONTRACT_FUNCTION</span><span class="special">(</span>
+ <span class="special">(</span><span class="keyword">public</span><span class="special">)</span> <span class="special">(</span><span class="keyword">int</span><span class="special">)</span> <span class="special">(</span><span class="identifier">f</span><span class="special">)(</span> <span class="special">(</span><span class="keyword">void</span><span class="special">)</span> <span class="special">)</span> <span class="special">(</span><span class="keyword">const</span><span class="special">)</span> <span class="special">(</span><span class="identifier">copyable</span><span class="special">)</span>
+ <span class="special">(</span><span class="identifier">precondition</span><span class="special">)(</span> <span class="special">(</span><span class="identifier">check_c</span><span class="special">()</span> <span class="special">&amp;&amp;</span> <span class="identifier">check_cv</span><span class="special">())</span> <span class="special">)</span> <span class="comment">// const</span>
+ <span class="special">(</span><span class="identifier">postcondition</span><span class="special">)(</span><span class="identifier">result</span><span class="special">)(</span>
+ <span class="special">(</span><span class="identifier">check_c</span><span class="special">()</span> <span class="special">&amp;&amp;</span> <span class="identifier">check_cv</span><span class="special">())</span> <span class="comment">// const</span>
+ <span class="special">(</span><span class="identifier">CONTRACT_OLDOF</span><span class="special">(</span><span class="keyword">this</span><span class="special">)-&gt;</span><span class="identifier">check_c</span><span class="special">()</span> <span class="comment">// oldof(this) also const</span>
+ <span class="special">&amp;&amp;</span> <span class="identifier">CONTRACT_OLDOF</span><span class="special">(</span><span class="keyword">this</span><span class="special">)-&gt;</span><span class="identifier">check_cv</span><span class="special">())</span>
+ <span class="special">)</span>
+ <span class="special">({</span> <span class="comment">// const</span>
+ <span class="identifier">check_c</span><span class="special">();</span> <span class="identifier">check_cv</span><span class="special">();</span>
+ <span class="keyword">return</span> <span class="number">2</span><span class="special">;</span>
+ <span class="special">})</span> <span class="special">)</span>
+
+ <span class="identifier">CONTRACT_FUNCTION</span><span class="special">(</span>
+ <span class="special">(</span><span class="keyword">public</span><span class="special">)</span> <span class="special">(</span><span class="keyword">int</span><span class="special">)</span> <span class="special">(</span><span class="identifier">f</span><span class="special">)(</span> <span class="special">(</span><span class="keyword">void</span><span class="special">)</span> <span class="special">)</span> <span class="special">(</span><span class="keyword">volatile</span><span class="special">)</span> <span class="special">(</span><span class="identifier">copyable</span><span class="special">)</span>
+ <span class="special">(</span><span class="identifier">precondition</span><span class="special">)(</span> <span class="special">(</span><span class="identifier">check_cv</span><span class="special">())</span> <span class="special">)</span> <span class="comment">// const volatile</span>
+ <span class="special">(</span><span class="identifier">postcondition</span><span class="special">)(</span><span class="identifier">result</span><span class="special">)(</span>
+ <span class="special">(</span><span class="identifier">check_cv</span><span class="special">())</span> <span class="comment">// const volatile</span>
+ <span class="comment">// oldof(this) also const volatile</span>
+ <span class="special">(</span><span class="identifier">CONTRACT_OLDOF</span><span class="special">(</span><span class="keyword">this</span><span class="special">)-&gt;</span><span class="identifier">check_cv</span><span class="special">())</span>
+ <span class="special">)</span>
+ <span class="special">({</span> <span class="comment">// volatile</span>
+ <span class="identifier">check_v</span><span class="special">();</span> <span class="identifier">check_cv</span><span class="special">();</span>
+ <span class="keyword">return</span> <span class="number">3</span><span class="special">;</span>
+ <span class="special">})</span> <span class="special">)</span>
+
+ <span class="identifier">CONTRACT_FUNCTION</span><span class="special">(</span> <span class="comment">// const must appear before volatile in signature</span>
+ <span class="special">(</span><span class="keyword">public</span><span class="special">)</span> <span class="special">(</span><span class="keyword">int</span><span class="special">)</span> <span class="special">(</span><span class="identifier">f</span><span class="special">)(</span> <span class="special">(</span><span class="keyword">void</span><span class="special">)</span> <span class="special">)</span> <span class="special">(</span><span class="keyword">const</span><span class="special">)</span> <span class="special">(</span><span class="keyword">volatile</span><span class="special">)</span> <span class="special">(</span><span class="identifier">copyable</span><span class="special">)</span>
+ <span class="special">(</span><span class="identifier">precondition</span><span class="special">)(</span> <span class="special">(</span><span class="identifier">check_cv</span><span class="special">())</span> <span class="special">)</span> <span class="comment">// const volatile</span>
+ <span class="special">(</span><span class="identifier">postcondition</span><span class="special">)(</span><span class="identifier">result</span><span class="special">)(</span>
+ <span class="special">(</span><span class="identifier">check_cv</span><span class="special">())</span> <span class="comment">// const volatile</span>
+ <span class="comment">// oldof(this) also const volatile</span>
+ <span class="special">(</span><span class="identifier">CONTRACT_OLDOF</span><span class="special">(</span><span class="keyword">this</span><span class="special">)-&gt;</span><span class="identifier">check_cv</span><span class="special">())</span>
+ <span class="special">)</span>
+ <span class="special">({</span> <span class="comment">// const volatile</span>
+ <span class="identifier">check_cv</span><span class="special">();</span>
+ <span class="keyword">return</span> <span class="number">4</span><span class="special">;</span>
+ <span class="special">})</span> <span class="special">)</span>
+
+ <span class="comment">// Used to demonstrate qualified member access constraints.</span>
+ <span class="keyword">bool</span> <span class="identifier">check_nocv</span><span class="special">(</span><span class="keyword">void</span><span class="special">)</span> <span class="special">{</span> <span class="keyword">return</span> <span class="keyword">true</span><span class="special">;</span> <span class="special">}</span>
+ <span class="keyword">bool</span> <span class="identifier">check_c</span><span class="special">(</span><span class="keyword">void</span><span class="special">)</span> <span class="keyword">const</span> <span class="special">{</span> <span class="keyword">return</span> <span class="keyword">true</span><span class="special">;</span> <span class="special">}</span>
+ <span class="keyword">bool</span> <span class="identifier">check_v</span><span class="special">(</span><span class="keyword">void</span><span class="special">)</span> <span class="keyword">volatile</span> <span class="special">{</span> <span class="keyword">return</span> <span class="keyword">true</span><span class="special">;</span> <span class="special">}</span>
+ <span class="keyword">bool</span> <span class="identifier">check_cv</span><span class="special">(</span><span class="keyword">void</span><span class="special">)</span> <span class="keyword">const</span> <span class="keyword">volatile</span> <span class="special">{</span> <span class="keyword">return</span> <span class="keyword">true</span><span class="special">;</span> <span class="special">}</span>
+<span class="special">};</span>
+
+</pre>
+<p>
+ </p>
+<p>
+ Note that the cv-qualifier is used to resolve overloading as usual (so there
+ is no need to use different argument names). Also subcontracting works as
+ usual for cv-qualified member functions (as shown by the base class <code class="computeroutput"><span class="identifier">b</span></code> in this example).
+ </p>
+<a name="contract__.tutorial.qualifiers.inline"></a><h6>
+<a name="contract__.tutorial.qualifiers.inline-heading"></a>
+ <a class="link" href="tutorial.html#contract__.tutorial.qualifiers.inline">Inline</a>
+ </h6>
+<p>
+ The <code class="computeroutput"><span class="keyword">inline</span></code> qualifier is repeated
+ in the <span class="emphasis"><em>signature-sequence</em></span> and it is used as usual. For
+ example:
+ </p>
+<p>
+
+</p>
+<pre class="programlisting"><span class="keyword">class</span> <span class="identifier">z</span> <span class="special">{</span>
+
+ <span class="identifier">CONTRACT_CLASS</span><span class="special">(</span> <span class="special">(</span><span class="identifier">z</span><span class="special">)</span> <span class="special">)</span>
+
+<span class="keyword">public</span><span class="special">:</span>
+ <span class="identifier">CONTRACT_FUNCTION</span><span class="special">(</span>
+ <span class="special">(</span><span class="keyword">public</span><span class="special">)</span> <span class="special">(</span><span class="keyword">inline</span><span class="special">)</span> <span class="special">(</span><span class="keyword">void</span><span class="special">)</span> <span class="special">(</span><span class="identifier">inl</span><span class="special">)(</span> <span class="special">(</span><span class="keyword">int</span><span class="special">)(</span><span class="identifier">x</span><span class="special">)</span> <span class="special">)</span>
+ <span class="special">({</span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special">&lt;&lt;</span> <span class="identifier">x</span> <span class="special">&lt;&lt;</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">endl</span><span class="special">;</span>
+ <span class="special">})</span> <span class="special">)</span>
+<span class="special">};</span>
+
+<span class="identifier">CONTRACT_FUNCTION</span><span class="special">(</span>
+<span class="special">(</span><span class="keyword">inline</span><span class="special">)</span> <span class="special">(</span><span class="keyword">void</span><span class="special">)</span> <span class="special">(</span><span class="identifier">inl</span><span class="special">)(</span> <span class="special">(</span><span class="keyword">int</span><span class="special">)(</span><span class="identifier">x</span><span class="special">)</span> <span class="special">)</span>
+<span class="special">({</span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special">&lt;&lt;</span> <span class="identifier">x</span> <span class="special">&lt;&lt;</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">endl</span><span class="special">;</span>
+<span class="special">})</span> <span class="special">)</span>
+
+</pre>
+<p>
+ </p>
+<a name="contract__.tutorial.qualifiers.extern_and_static"></a><h6>
+<a name="contract__.tutorial.qualifiers.extern_and_static-heading"></a>
+ <a class="link" href="tutorial.html#contract__.tutorial.qualifiers.extern_and_static">Extern and
+ Static</a>
+ </h6>
+<p>
+ The <code class="computeroutput"><span class="keyword">extern</span></code> linkage qualifier
+ is repeated in the <span class="emphasis"><em>signature-sequence</em></span> for non-member
+ functions and it is used as usual. For example:
+ </p>
+<p>
+
+</p>
+<pre class="programlisting"><span class="identifier">CONTRACT_FUNCTION</span><span class="special">(</span>
+<span class="special">(</span><span class="keyword">extern</span><span class="special">)</span> <span class="special">(</span><span class="keyword">void</span><span class="special">)</span> <span class="special">(</span><span class="identifier">ext</span><span class="special">)(</span> <span class="special">(</span><span class="keyword">int</span><span class="special">)(</span><span class="identifier">x</span><span class="special">)</span> <span class="special">)</span> <span class="comment">// External linkage.</span>
+<span class="special">({</span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special">&lt;&lt;</span> <span class="identifier">x</span> <span class="special">&lt;&lt;</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">endl</span><span class="special">;</span>
+<span class="special">})</span> <span class="special">)</span>
+
+<span class="identifier">CONTRACT_FUNCTION</span><span class="special">(</span>
+<span class="special">(</span><span class="keyword">extern</span> <span class="string">"C"</span><span class="special">)</span> <span class="special">(</span><span class="keyword">void</span><span class="special">)</span> <span class="special">(</span><span class="identifier">ext_c</span><span class="special">)(</span> <span class="special">(</span><span class="keyword">int</span><span class="special">)(</span><span class="identifier">x</span><span class="special">)</span> <span class="special">)</span> <span class="comment">// External linkage callable from C.</span>
+<span class="special">({</span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special">&lt;&lt;</span> <span class="identifier">x</span> <span class="special">&lt;&lt;</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">endl</span><span class="special">;</span>
+<span class="special">})</span> <span class="special">)</span>
+
+</pre>
+<p>
+ </p>
+<p>
+ The <code class="computeroutput"><span class="keyword">static</span></code> qualifier is used
+ as usual for static member functions and it is specified in <span class="emphasis"><em>signature-sequence</em></span>.
+ The <code class="computeroutput"><span class="keyword">static</span></code> qualifier for non-member
+ functions to indicate non-members local to a translation unit was deprecated
+ from C to C++ (see [Stroustrup1997]) therefore it is not supported by this
+ library and it cannot be specified in <span class="emphasis"><em>signature-sequence</em></span>.
+ </p>
+<a name="contract__.tutorial.qualifiers.auto_and_register"></a><h6>
+<a name="contract__.tutorial.qualifiers.auto_and_register-heading"></a>
+ <a class="link" href="tutorial.html#contract__.tutorial.qualifiers.auto_and_register">Auto and
+ Register</a>
+ </h6>
+<p>
+ The <code class="computeroutput"><span class="keyword">auto</span></code> and <code class="computeroutput"><span class="keyword">register</span></code>
+ storage qualifiers are <span class="emphasis"><em>not</em></span> repeated in the <span class="emphasis"><em>signature-sequence</em></span>
+ but they can appear in the contracted function as usual. When these qualifiers
+ are used, they will have effect for the contracted function but not for the
+ contract (i.e., these qualifier will not be applied to the precondition,
+ postcondition, and body function arguments). For example:
+ </p>
+<p>
+
+</p>
+<pre class="programlisting"><span class="identifier">CONTRACT_FUNCTION</span><span class="special">(</span>
+<span class="special">(</span><span class="keyword">double</span><span class="special">)</span> <span class="special">(</span><span class="identifier">square</span><span class="special">)(</span> <span class="special">(</span><span class="keyword">auto</span><span class="special">)(</span><span class="keyword">double</span><span class="special">)(</span><span class="identifier">d</span><span class="special">)</span> <span class="special">)</span> <span class="comment">// `auto` storage classifier.</span>
+ <span class="special">(</span><span class="identifier">postcondition</span><span class="special">)(</span><span class="identifier">result</span><span class="special">)(</span> <span class="special">(</span><span class="identifier">result</span> <span class="special">==</span> <span class="special">(</span><span class="identifier">d</span> <span class="special">*</span> <span class="identifier">d</span><span class="special">))</span> <span class="special">)</span>
+<span class="special">({</span>
+ <span class="keyword">auto</span> <span class="keyword">double</span> <span class="identifier">y</span> <span class="special">=</span> <span class="identifier">d</span> <span class="special">*</span> <span class="identifier">d</span><span class="special">;</span>
+ <span class="keyword">return</span> <span class="identifier">y</span><span class="special">;</span>
+<span class="special">})</span> <span class="special">)</span>
+
+<span class="identifier">CONTRACT_FUNCTION</span><span class="special">(</span>
+<span class="special">(</span><span class="keyword">int</span><span class="special">)</span> <span class="special">(</span><span class="identifier">square</span><span class="special">)(</span> <span class="special">(</span><span class="keyword">register</span><span class="special">)(</span><span class="keyword">int</span><span class="special">)(</span><span class="identifier">i</span><span class="special">)</span> <span class="special">)</span> <span class="comment">// `register` storage classifier.</span>
+ <span class="special">(</span><span class="identifier">postcondition</span><span class="special">)(</span><span class="identifier">result</span><span class="special">)(</span> <span class="special">(</span><span class="identifier">result</span> <span class="special">==</span> <span class="special">(</span><span class="identifier">i</span> <span class="special">*</span> <span class="identifier">i</span><span class="special">))</span> <span class="special">)</span>
+<span class="special">({</span>
+ <span class="keyword">register</span> <span class="keyword">int</span> <span class="identifier">y</span> <span class="special">=</span> <span class="identifier">i</span> <span class="special">*</span> <span class="identifier">i</span><span class="special">;</span>
+ <span class="keyword">return</span> <span class="identifier">y</span><span class="special">;</span>
+<span class="special">})</span> <span class="special">)</span>
+
+</pre>
+<p>
+ </p>
+</div>
+<div class="section">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="contract__.tutorial.blocks_and_loops"></a><a class="link" href="tutorial.html#contract__.tutorial.blocks_and_loops" title="Blocks and Loops">Blocks and Loops</a>
+</h3></div></div></div>
+<p>
+ Block invariants <code class="computeroutput">CONTRACT_ASSERT_BLOCK_INVARIANT<span class="special">()</span></code> can be used to assert conditions anywhere
+ within a code block (not just loops). When used within a loop, block invariants
+ can be used to assert loop invariants.
+ </p>
+<p>
+ Loop variants can be used to check the correctness of a loop, including its
+ termination, as explained in detail in <a class="link" href="bibliography.html" title="Bibliography">[Meyer1997]</a>
+ (and they can only appear within loops). At each loop iteration, the specified
+ loop variant integer expression is automatically asserted to be positive
+ (&gt; 0) and to decrease from the previous loop iteration. Loop variants
+ can be used to assert loop correctness. Because the variant decreases and
+ it cannot be zero or smaller than zero it is possible to guarantee loop termination.
+ A loop can only have one variant.
+ </p>
+<p>
+ When asserting loop variants using <code class="computeroutput">CONTRACT_ASSERT_LOOP_VARIANT<span class="special">()</span></code> it is necessary to first call <code class="computeroutput">CONTRACT_INIT_LOOP_VARIANT</code>
+ once (and only once) within a code block that has same of higher scope level
+ than the loop code block.
+ </p>
+<p>
+ For example:
+ </p>
+<pre class="programlisting"><span class="keyword">double</span> <span class="identifier">abs_total</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">myvector</span><span class="special">&lt;</span><span class="keyword">double</span><span class="special">&gt;&amp;</span> <span class="identifier">vector</span><span class="special">)</span>
+<span class="identifier">CONTRACT_FUNCTION</span><span class="special">(</span>
+ <span class="special">(</span><span class="keyword">double</span><span class="special">)</span> <span class="special">(</span><span class="identifier">abs_total</span><span class="special">)(</span> <span class="special">(</span><span class="keyword">const</span> <span class="identifier">myvector</span><span class="special">&lt;</span><span class="keyword">double</span><span class="special">&gt;&amp;)(</span><span class="identifier">vector</span><span class="special">)</span> <span class="special">)</span>
+<span class="special">(</span><span class="identifier">postcondition</span><span class="special">)</span> <span class="special">(</span><span class="identifier">total</span><span class="special">)</span> <span class="special">({</span> <span class="comment">// Result value named `total`.</span>
+ <span class="identifier">CONTRACT_ASSERT</span><span class="special">(</span> <span class="identifier">total</span> <span class="special">&gt;=</span> <span class="number">0.0</span> <span class="special">);</span>
+<span class="special">})</span>
+<span class="special">(</span><span class="identifier">body</span><span class="special">)</span> <span class="special">({</span>
+ <span class="keyword">double</span> <span class="identifier">total</span> <span class="special">=</span> <span class="number">0.0</span><span class="special">;</span>
+ <span class="comment">// Block invariants can appear anywhere in code block.</span>
+ <span class="bold"><strong>CONTRACT_ASSERT_BLOCK_INVARIANT( total == 0.0 );</strong></span>
+
+ <span class="special">{</span> <span class="comment">// Variant initialized locally to its loop.</span>
+ <span class="bold"><strong>CONTRACT_INIT_LOOP_VARIANT;</strong></span>
+ <span class="keyword">for</span> <span class="special">(</span><span class="identifier">size_t</span> <span class="identifier">i</span> <span class="special">=</span> <span class="number">0</span><span class="special">;</span> <span class="identifier">i</span> <span class="special">&lt;</span> <span class="identifier">vector</span><span class="special">.</span><span class="identifier">size</span><span class="special">();</span> <span class="special">++</span><span class="identifier">i</span><span class="special">)</span> <span class="special">{</span>
+ <span class="comment">// Block invariants used to assert loop invariants.</span>
+ <span class="bold"><strong>CONTRACT_ASSERT_BLOCK_INVARIANT( i &lt; vector.size() );</strong></span>
+ <span class="comment">// Loop variant (can only appear in loops).</span>
+ <span class="bold"><strong>CONTRACT_ASSERT_LOOP_VARIANT( vector.size() - i );</strong></span>
+
+ <span class="identifier">total</span> <span class="special">+=</span> <span class="identifier">vector</span><span class="special">[</span><span class="identifier">i</span><span class="special">];</span>
+ <span class="special">}</span>
+ <span class="special">}</span>
+ <span class="keyword">return</span> <span class="identifier">total</span> <span class="special">&lt;</span> <span class="number">0.0</span> <span class="special">?</span> <span class="special">-</span><span class="identifier">total</span> <span class="special">:</span> <span class="identifier">total</span><span class="special">;</span>
+<span class="special">})</span> <span class="special">)</span>
+</pre>
+</div>
+<div class="section">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="contract__.tutorial.exception_specifications"></a><a class="link" href="tutorial.html#contract__.tutorial.exception_specifications" title="Exception Specifications">Exception
+ Specifications</a>
+</h3></div></div></div>
+<p>
+ Exception specifications are <span class="emphasis"><em>not</em></span> repeated in the <span class="emphasis"><em>signature-sequence</em></span>
+ but they can be specified for contracted member functions as usual.
+ </p>
+<p>
+ However, non-member functions with exception specifications cannot be contracted
+ (the library will generated a compile-time error otherwise). A possible workaround
+ for this library limitation is to make the non-member functions with exception
+ specifications static members of some artificially introduced class so they
+ can be contracted. For example:
+ </p>
+<p>
+
+</p>
+<pre class="programlisting"><span class="keyword">class</span> <span class="identifier">c</span> <span class="special">{</span> <span class="comment">// Some artificially introduced class.</span>
+
+ <span class="identifier">CONTRACT_CLASS</span><span class="special">(</span> <span class="special">(</span><span class="identifier">c</span><span class="special">)</span> <span class="special">)</span>
+
+<span class="keyword">public</span><span class="special">:</span>
+ <span class="identifier">CONTRACT_FUNCTION</span><span class="special">(</span>
+ <span class="special">(</span><span class="keyword">public</span><span class="special">)</span> <span class="special">(</span><span class="keyword">static</span><span class="special">)</span> <span class="special">(</span><span class="keyword">void</span><span class="special">)</span> <span class="special">(</span><span class="identifier">some</span><span class="special">)(</span> <span class="special">(</span><span class="keyword">const</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span><span class="special">&amp;)(</span><span class="identifier">what</span><span class="special">)</span> <span class="special">)</span>
+ <span class="special">(</span><span class="keyword">throw</span><span class="special">)(</span> <span class="special">(</span><span class="keyword">char</span><span class="special">)</span> <span class="special">(</span><span class="keyword">int</span><span class="special">)</span> <span class="special">)</span> <span class="comment">// Exception specifications.</span>
+ <span class="special">({</span>
+ <span class="keyword">if</span> <span class="special">(</span><span class="identifier">what</span> <span class="special">==</span> <span class="string">"none"</span><span class="special">)</span> <span class="keyword">return</span><span class="special">;</span> <span class="comment">// OK.</span>
+ <span class="keyword">if</span> <span class="special">(</span><span class="identifier">what</span> <span class="special">==</span> <span class="string">"char"</span><span class="special">)</span> <span class="keyword">throw</span> <span class="keyword">char</span><span class="special">(</span><span class="char">'a'</span><span class="special">);</span> <span class="comment">// OK.</span>
+ <span class="keyword">if</span> <span class="special">(</span><span class="identifier">what</span> <span class="special">==</span> <span class="string">"int"</span><span class="special">)</span> <span class="keyword">throw</span> <span class="keyword">int</span><span class="special">(-</span><span class="number">1</span><span class="special">);</span> <span class="comment">// OK.</span>
+ <span class="keyword">throw</span> <span class="identifier">what</span><span class="special">;</span> <span class="comment">// Not in specs so terminate() is called.</span>
+ <span class="special">})</span> <span class="special">)</span>
+
+ <span class="identifier">CONTRACT_FUNCTION</span><span class="special">(</span> <span class="comment">// Ex. specs not repeated in signature.</span>
+ <span class="special">(</span><span class="keyword">public</span><span class="special">)</span> <span class="special">(</span><span class="keyword">static</span><span class="special">)</span> <span class="special">(</span><span class="keyword">void</span><span class="special">)</span> <span class="special">(</span><span class="identifier">none</span><span class="special">)(</span> <span class="special">(</span><span class="keyword">const</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span><span class="special">&amp;)(</span><span class="identifier">what</span><span class="special">)</span> <span class="special">)</span>
+ <span class="special">(</span><span class="keyword">throw</span><span class="special">)(</span> <span class="special">(</span><span class="keyword">void</span><span class="special">)</span> <span class="special">)</span> <span class="comment">// Exception specifications (throw nothing).</span>
+ <span class="special">({</span>
+ <span class="keyword">if</span> <span class="special">(</span><span class="identifier">what</span> <span class="special">==</span> <span class="string">"none"</span><span class="special">)</span> <span class="keyword">return</span><span class="special">;</span> <span class="comment">// OK.</span>
+ <span class="keyword">throw</span> <span class="identifier">what</span><span class="special">;</span> <span class="comment">// Not in specs so terminate() is called.</span>
+ <span class="special">})</span> <span class="special">)</span>
+<span class="special">};</span>
+
+</pre>
+<p>
+ </p>
+<p>
+ The library uses the following rules to handle exceptions thrown by the contracts:
+ </p>
+<div class="orderedlist"><ol class="orderedlist" type="1">
+<li class="listitem">
+ When an exception is thrown while checking invariants, preconditions,
+ or postconditions then the contract condition is considered <span class="emphasis"><em>failed</em></span>
+ (because it was not possible to check it to be true) so the relative
+ contract failure handler function is invoked.
+ </li>
+<li class="listitem">
+ When an exception is thrown while executing the body then the class invariants
+ are checked (for member functions only) and, if they hold true, the exception
+ is passed up to the caller as usual (otherwise the class invariant failed
+ handler function is invoked).
+ </li>
+</ol></div>
+<p>
+ Therefore, exception specifications work as usual as long as the member function
+ body does not fail the class invariant when it throws the exception. Furthermore,
+ if the contract failure handlers are redefined to throw exceptions (instead
+ of calling <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">terminate</span><span class="special">()</span></code>,
+ see <a class="link" href="throw_on_failure.html" title="Annex: Throw on Failure">Throw on Failure</a>)
+ then the exception specifications still work as usual because they apply
+ to both the exceptions thrown by the body and the exceptions thrown by the
+ contract failure handlers.
+ </p>
+</div>
+<div class="section">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="contract__.tutorial.commas_within_macro_parameters"></a><a class="link" href="tutorial.html#contract__.tutorial.commas_within_macro_parameters" title="Commas Within Macro Parameters">Commas
+ Within Macro Parameters</a>
+</h3></div></div></div>
+<p>
+ The C++ preprocessor only recognizes the <code class="computeroutput"><span class="special">()</span></code>
+ parenthesis. It does not recognize any other parenthesis such as <code class="computeroutput"><span class="special">&lt;&gt;</span></code>, <code class="computeroutput"><span class="special">[]</span></code>,
+ or <code class="computeroutput"><span class="special">{}</span></code>. As a consequence, any
+ comma passed within a macro parameter that is not wrapped by the <code class="computeroutput"><span class="special">()</span></code> parenthesis will be interpreted by the
+ preprocessor as a parameter separation token and will generate a preprocessing
+ error. Also macro parameters passed as elements of Boost.Preprocessor
+ sequences cannot contain commas not wrapped by extra <code class="computeroutput"><span class="special">()</span></code>
+ parenthesis (the preprocessor sequence <code class="computeroutput"><span class="special">()</span></code>
+ parenthesis are not sufficient to wrap the commas).
+ </p>
+<p>
+ Consider the following example:
+ </p>
+<pre class="programlisting"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> <span class="identifier">K</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">T</span><span class="special">&gt;</span>
+<span class="identifier">std</span><span class="special">::</span><span class="identifier">map</span><span class="special">&lt;</span><span class="identifier">K</span><span class="special">,</span> <span class="identifier">T</span><span class="special">&gt;</span> <span class="identifier">fill</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">map</span><span class="special">&lt;</span><span class="identifier">K</span><span class="special">,</span> <span class="identifier">T</span><span class="special">&gt;&amp;</span> <span class="identifier">source</span><span class="special">,</span>
+ <span class="keyword">const</span> <span class="identifier">K</span><span class="special">&amp;</span> <span class="identifier">key</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">T</span><span class="special">&amp;</span> <span class="identifier">element</span><span class="special">)</span>
+<span class="identifier">CONTRACT_FUNCTION</span><span class="special">(</span>
+ <span class="special">(</span><span class="keyword">template</span><span class="special">)(</span> <span class="special">(</span><span class="keyword">typename</span><span class="special">)(</span><span class="identifier">K</span><span class="special">)</span> <span class="special">(</span><span class="keyword">typename</span><span class="special">)(</span><span class="identifier">T</span><span class="special">)</span> <span class="special">)</span>
+ <span class="comment">// Commas within another type expression.</span>
+ <span class="bold"><strong>(std::map&lt;K, T&gt;)</strong></span> <span class="special">(</span><span class="identifier">set</span><span class="special">)(</span>
+ <span class="comment">// Commas within a type expression.</span>
+ <span class="bold"><strong>(const std::map&lt;K, T&gt;&amp;)</strong></span><span class="special">(</span><span class="identifier">source</span><span class="special">)</span>
+ <span class="special">(</span><span class="keyword">const</span> <span class="identifier">K</span><span class="special">&amp;)(</span><span class="identifier">key</span><span class="special">)</span> <span class="special">(</span><span class="keyword">const</span> <span class="identifier">T</span><span class="special">&amp;)(</span><span class="identifier">element</span><span class="special">)</span> <span class="special">)</span>
+<span class="special">(</span><span class="identifier">precondition</span><span class="special">)</span> <span class="special">({</span>
+ <span class="comment">// Commas within a value expression.</span>
+ <span class="identifier">CONTRACT_ASSERT</span><span class="special">(</span> <span class="bold"><strong>std::map&lt;K, T&gt;().empty()</strong></span> <span class="special">);</span>
+<span class="special">})</span>
+<span class="special">(</span><span class="identifier">body</span><span class="special">)</span> <span class="special">({</span>
+ <span class="special">...</span>
+<span class="special">})</span> <span class="special">)</span>
+</pre>
+<a name="contract__.tutorial.commas_within_macro_parameters.value_expressions"></a><h6>
+<a name="contract__.tutorial.commas_within_macro_parameters.value_expressions-heading"></a>
+ <a class="link" href="tutorial.html#contract__.tutorial.commas_within_macro_parameters.value_expressions">Value
+ Expressions</a>
+ </h6>
+<p>
+ The example above will <span class="emphasis"><em>not</em></span> compile because the preprocessor
+ will interpret the expression:
+ </p>
+<pre class="programlisting"><span class="identifier">CONTRACT_ASSERT</span><span class="special">(</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">map</span><span class="special">&lt;</span><span class="identifier">K</span><span class="special">,</span> <span class="identifier">T</span><span class="special">&gt;().</span><span class="identifier">empty</span><span class="special">()</span> <span class="special">);</span>
+</pre>
+<p>
+ as a call to the macro <code class="computeroutput">CONTRACT_ASSERT<span class="special">()</span></code> passing <span class="emphasis"><em>two</em></span> parameters
+ separated by the comma:
+ </p>
+<pre class="programlisting"><span class="identifier">std</span><span class="special">::</span><span class="identifier">map</span><span class="special">&lt;</span><span class="identifier">K</span> <span class="comment">// 1st macro parameter.</span>
+<span class="identifier">T</span><span class="special">&gt;().</span><span class="identifier">empty</span><span class="special">()</span> <span class="comment">// 2nd macro parameter.</span>
+</pre>
+<p>
+ Because <code class="computeroutput">CONTRACT_ASSERT<span class="special">()</span></code> takes only one parameter, the above code
+ will generate a preprocessing error.
+ </p>
+<p>
+ The expressions <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">map</span><span class="special">&lt;</span><span class="identifier">K</span><span class="special">,</span> <span class="identifier">T</span><span class="special">&gt;().</span><span class="identifier">empty</span><span class="special">()</span></code> is interpreted by the compiler as a value
+ expression (it will be either be <code class="computeroutput"><span class="keyword">true</span></code>
+ or <code class="computeroutput"><span class="keyword">false</span></code>). Value expressions
+ can be wrapped by an extra set of parenthesis <code class="computeroutput"><span class="special">()</span></code>
+ when passed as macro parameters. The following will compile:
+ </p>
+<pre class="programlisting"><span class="identifier">CONTRACT_ASSERT</span><span class="special">(</span> <span class="bold"><strong>(</strong></span><span class="identifier">std</span><span class="special">::</span><span class="identifier">map</span><span class="special">&lt;</span><span class="identifier">K</span><span class="special">,</span> <span class="identifier">T</span><span class="special">&gt;().</span><span class="identifier">empty</span><span class="special">()</span><span class="bold"><strong>)</strong></span> <span class="special">);</span>
+</pre>
+<a name="contract__.tutorial.commas_within_macro_parameters.type_expressions"></a><h6>
+<a name="contract__.tutorial.commas_within_macro_parameters.type_expressions-heading"></a>
+ <a class="link" href="tutorial.html#contract__.tutorial.commas_within_macro_parameters.type_expressions">Type
+ Expressions</a>
+ </h6>
+<p>
+ A similar issue arises for the preprocessor sequence element:
+ </p>
+<pre class="programlisting"><span class="special">(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">map</span><span class="special">&lt;</span><span class="identifier">K</span><span class="special">,</span> <span class="identifier">T</span><span class="special">&gt;)</span>
+</pre>
+<p>
+ which will be interpreted as composed of 2 parameters separated by the comma
+ (i.e., as a Boost.Preprocessor
+ 2-tuple instead than an element of a Boost.Preprocessor
+ sequence):
+ </p>
+<pre class="programlisting"><span class="identifier">std</span><span class="special">::</span><span class="identifier">map</span><span class="special">&lt;</span><span class="identifier">T</span> <span class="comment">// 1st macro parameter.</span>
+<span class="identifier">T</span><span class="special">&gt;</span> <span class="comment">// 2nd macro parameter.</span>
+</pre>
+<p>
+ However, in this case the expression <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">map</span><span class="special">&lt;</span><span class="identifier">K</span><span class="special">,</span> <span class="identifier">T</span><span class="special">&gt;</span></code> needs to be interpreted by the compiler
+ as a type expression (indeed the type <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">map</span><span class="special">&lt;</span><span class="identifier">K</span><span class="special">,</span> <span class="identifier">T</span><span class="special">&gt;</span></code>) and it cannot be wrapped by the extra
+ parenthesis <code class="computeroutput"><span class="special">()</span></code>. In fact, depending
+ on the context where they are used, types wrapped within parenthesis can
+ generate compiler-time syntactic errors.
+ </p>
+<p>
+ In order to wrap the type expression within parenthesis <code class="computeroutput"><span class="special">()</span></code>
+ that can be parsed correctly by the preprocessor and interpreted correctly
+ the compiler, first we created a void-function type that contains the type
+ expression as the function only argument type:
+ </p>
+<pre class="programlisting"><span class="keyword">void</span><span class="bold"><strong>(</strong></span><span class="identifier">std</span><span class="special">::</span><span class="identifier">map</span><span class="special">&lt;</span><span class="identifier">K</span><span class="special">,</span> <span class="identifier">T</span><span class="special">&gt;</span><span class="bold"><strong>)</strong></span> <span class="comment">// Function type (wraps comma within parenthesis).</span>
+</pre>
+<p>
+ Then, we apply the library metafunction <code class="computeroutput"><span class="identifier">contract</span><span class="special">::</span>wrap</code>
+ that returns the type of the first argument of the specified void-function
+ type:
+ </p>
+<pre class="programlisting"><span class="identifier">contract</span><span class="special">::</span><span class="identifier">wrap</span><span class="special">&lt;</span><span class="keyword">void</span><span class="bold"><strong>(</strong></span><span class="identifier">std</span><span class="special">::</span><span class="identifier">map</span><span class="special">&lt;</span><span class="identifier">K</span><span class="special">,</span> <span class="identifier">T</span><span class="special">&gt;</span><span class="bold"><strong>)</strong></span><span class="special">&gt;::</span><span class="identifier">type</span> <span class="comment">// Evaluates to the type `std::map&lt;K, T&gt;`.</span>
+</pre>
+<p>
+ For convenience, the library provides the macro <code class="computeroutput">CONTRACT_WRAP_TYPE<span class="special">()</span></code> which expands to the code above:
+ </p>
+<pre class="programlisting"><span class="identifier">CONTRACT_WRAP_TYPE</span><span class="special">(</span> <span class="bold"><strong>(</strong></span><span class="identifier">std</span><span class="special">::</span><span class="identifier">macp</span><span class="special">&lt;</span><span class="identifier">K</span><span class="special">,</span> <span class="identifier">T</span><span class="special">&gt;</span><span class="bold"><strong>)</strong></span> <span class="special">)</span>
+</pre>
+<p>
+ Note the extra parenthesis <code class="computeroutput"><span class="special">()</span></code>
+ similar to what it was used for value expression.
+ </p>
+<a name="contract__.tutorial.commas_within_macro_parameters.body_code_block"></a><h6>
+<a name="contract__.tutorial.commas_within_macro_parameters.body_code_block-heading"></a>
+ <a class="link" href="tutorial.html#contract__.tutorial.commas_within_macro_parameters.body_code_block">Body
+ Code Block</a>
+ </h6>
+<p>
+ Finally, both techniques are applied to eventual commas within code blocks
+ depending if the code is a value or type expression.
+ </p>
+<div class="note"><table border="0" summary="Note">
+<tr>
+<td rowspan="2" align="center" valign="top" width="25"><img alt="[Note]" src="../images/note.png"></td>
+<th align="left">Note</th>
+</tr>
+<tr><td align="left" valign="top"><p>
+ However, if the body definition is separated from the contract declaration
+ then the body code does not appear within a macro parameter so there is
+ no need to implement these workarounds in the body code.
+ </p></td></tr>
+</table></div>
+<p>
+ Applying these techniques to the example above, we obtain the following code
+ which compiles:
+ </p>
+<p>
+
+</p>
+<pre class="programlisting"><span class="identifier">CONTRACT_FUNCTION</span><span class="special">(</span>
+<span class="special">(</span><span class="keyword">template</span><span class="special">)(</span> <span class="special">(</span><span class="keyword">typename</span><span class="special">)(</span><span class="identifier">K</span><span class="special">)</span> <span class="special">(</span><span class="keyword">typename</span><span class="special">)(</span><span class="identifier">T</span><span class="special">)</span> <span class="special">)</span>
+<span class="comment">// Commas within type expression using `IDENTITY_TYPE` macro.</span>
+<span class="special">(</span><span class="keyword">typename</span> <span class="identifier">CONTRACT_IDENTITY_TYPE</span><span class="special">((</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">map</span><span class="special">&lt;</span><span class="identifier">K</span><span class="special">,</span> <span class="identifier">T</span><span class="special">&gt;)))</span> <span class="special">(</span><span class="identifier">set</span><span class="special">)(</span>
+ <span class="comment">// Or directly using the `identity_type` metafunction.</span>
+ <span class="special">(</span><span class="keyword">typename</span> <span class="identifier">contract</span><span class="special">::</span><span class="identifier">identity_type</span><span class="special">&lt;</span><span class="keyword">void</span> <span class="special">(</span><span class="keyword">const</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">map</span><span class="special">&lt;</span><span class="identifier">K</span><span class="special">,</span> <span class="identifier">T</span><span class="special">&gt;&amp;)</span> <span class="special">&gt;::</span><span class="identifier">type</span><span class="special">)</span>
+ <span class="special">(</span><span class="identifier">source</span><span class="special">)</span>
+ <span class="special">(</span><span class="keyword">const</span> <span class="identifier">K</span><span class="special">&amp;)(</span><span class="identifier">key</span><span class="special">)</span>
+ <span class="special">(</span><span class="keyword">const</span> <span class="identifier">T</span><span class="special">&amp;)(</span><span class="identifier">element</span><span class="special">)</span>
+ <span class="special">)</span>
+ <span class="special">(</span><span class="identifier">precondition</span><span class="special">)</span> <span class="special">(</span>
+ <span class="comment">// Commas within value expressions must be wrapped by `()` using</span>
+ <span class="comment">// `bool()` (or `contract::identity()`).</span>
+ <span class="special">(</span><span class="keyword">bool</span><span class="special">(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">map</span><span class="special">&lt;</span><span class="identifier">K</span><span class="special">,</span> <span class="identifier">T</span><span class="special">&gt;().</span><span class="identifier">empty</span><span class="special">()))</span>
+ <span class="special">)</span>
+<span class="special">({</span>
+ <span class="comment">// Commas within code blocks use same workarounds as above</span>
+ <span class="comment">// wrapping differently commas within type or value expressions. </span>
+ <span class="comment">// Or better, separate body definition so it is outside the macro.</span>
+
+ <span class="comment">// OK, commas already wrapped by function call `()`.</span>
+ <span class="identifier">print</span><span class="special">(</span><span class="identifier">key</span><span class="special">,</span> <span class="identifier">element</span><span class="special">);</span>
+
+ <span class="comment">// Commas within type expression wrapped using the macro.</span>
+ <span class="keyword">typename</span> <span class="identifier">CONTRACT_IDENTITY_TYPE</span><span class="special">((</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">map</span><span class="special">&lt;</span><span class="identifier">K</span><span class="special">,</span> <span class="identifier">T</span><span class="special">&gt;))</span> <span class="identifier">m</span> <span class="special">=</span> <span class="identifier">source</span><span class="special">;</span>
+
+ <span class="comment">// OK, commas already wrapped by if-statement `()`.</span>
+ <span class="keyword">if</span> <span class="special">(</span><span class="number">0</span> <span class="special">==</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">map</span><span class="special">&lt;</span><span class="identifier">K</span><span class="special">,</span> <span class="identifier">T</span><span class="special">&gt;().</span><span class="identifier">empty</span><span class="special">())</span> <span class="identifier">m</span><span class="special">[</span><span class="identifier">key</span><span class="special">]</span> <span class="special">=</span> <span class="identifier">element</span><span class="special">;</span>
+
+ <span class="keyword">return</span> <span class="identifier">m</span><span class="special">;</span>
+<span class="special">})</span> <span class="special">)</span>
+
+</pre>
+<p>
+ </p>
+</div>
+<div class="section">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="contract__.tutorial.a_fully_working_example"></a><a class="link" href="tutorial.html#contract__.tutorial.a_fully_working_example" title="A Fully Working Example">A Fully
+ Working Example</a>
+</h3></div></div></div>
+<p>
+ We conclude this section with a fully working example that can be compiled.
+ This example illustrates how to use the library contract macros to program
+ contracts in all the different library usages scenarios (constructor, destructors,
+ member functions, non-member functions, template functions, etc).
+ </p>
+<p>
+ For simplicity, this example only exposes a limited subset of the <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">vector</span></code>
+ operations and it only programs simple contracts for them (see the STL Vector
+ <a class="link" href="examples.html" title="Examples">Example</a> for complete contracts
+ of all <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">vector</span></code> operations). Furthermore, the somewhat
+ artificial base classes have been deliberately introduced to illustrate subcontracting
+ and they will probably not be part of real code.
+ </p>
+<div class="informaltable"><table class="table">
+<colgroup>
+<col>
+<col>
+</colgroup>
+<thead><tr>
+<th>
+ <p>
+ Contract++ Syntax (supported for ISO C++ standard)
+ </p>
+ </th>
+<th>
+ <p>
+ N-Paper Proposal Syntax (not part of any C++ standard)
+ </p>
+ </th>
+</tr></thead>
+<tbody>
+<tr>
+<td>
+ <p>
+
+</p>
+<pre xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="table-programlisting"><span class="preprocessor">#include</span> <span class="string">"pushable.hpp"</span> <span class="comment">// Base classes for subcontracting.</span>
+<span class="preprocessor">#include</span> <span class="string">"boundable.hpp"</span>
+<span class="preprocessor">#include</span> <span class="string">"basic_begin.hpp"</span>
+<span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">contract</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span> <span class="comment">// This library.</span>
+<span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span> <span class="comment">// For static assertion condition.</span>
+<span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">concept_check</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span> <span class="comment">// Concepts for `(requires)`.</span>
+<span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">parameter</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span> <span class="comment">// Named parameters `(in)/(inout)/(out)`.</span>
+<span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">utility</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span> <span class="comment">// For `boost::prior()`.</span>
+<span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">mpl</span><span class="special">/</span><span class="keyword">bool</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span> <span class="comment">// For static assertion `true_`.</span>
+<span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">vector</span><span class="special">&gt;</span> <span class="comment">// STL vector.</span>
+
+<span class="comment">// Use importance ordering to specify assertion computational complexity.</span>
+<span class="preprocessor">#define</span> <span class="identifier">O_1</span> <span class="number">0</span> <span class="comment">// Constant O(1) (default importance ordering).</span>
+<span class="preprocessor">#define</span> <span class="identifier">O_LOGN</span> <span class="number">1</span> <span class="comment">// Logaritmic O(log n).</span>
+<span class="preprocessor">#define</span> <span class="identifier">O_N</span> <span class="number">2</span> <span class="comment">// Linear O(n).</span>
+
+<span class="comment">// Wrapper that adds simple (not complete) contracts to C++ STL illustrating</span>
+<span class="comment">// most library usages. For simplicity, assume T is comparable and copyable.</span>
+<span class="identifier">CONTRACT_CLASS</span><span class="special">(</span>
+<span class="keyword">template</span><span class="special">(</span> <span class="keyword">typename</span> <span class="identifier">T</span> <span class="special">)</span>
+<span class="keyword">class</span> <span class="special">(</span><span class="identifier">myvector</span><span class="special">)</span>
+ <span class="identifier">extends</span><span class="special">(</span> <span class="comment">// Subcontract from base classes (support multiple inheritance).</span>
+ <span class="keyword">public</span> <span class="identifier">pushable</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">&gt;,</span>
+ <span class="keyword">public</span> <span class="identifier">boundable</span><span class="special">&lt;</span><span class="keyword">typename</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">vector</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">&gt;::</span><span class="identifier">const_iterator</span><span class="special">&gt;,</span>
+ <span class="keyword">private</span> <span class="identifier">basic_begin</span><span class="special">&lt;</span><span class="keyword">typename</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">vector</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">&gt;::</span><span class="identifier">const_iterator</span><span class="special">&gt;</span>
+ <span class="special">)</span>
+<span class="special">)</span> <span class="special">{</span>
+ <span class="comment">// Class invariants (checked by any function with a contract).</span>
+ <span class="identifier">CONTRACT_CLASS_INVARIANT</span><span class="special">(</span> <span class="comment">// Optional and they can access object.</span>
+ <span class="identifier">empty</span><span class="special">()</span> <span class="special">==</span> <span class="special">(</span><span class="identifier">size</span><span class="special">()</span> <span class="special">==</span> <span class="number">0</span><span class="special">),</span>
+ <span class="keyword">static</span> <span class="keyword">sizeof</span><span class="special">(</span><span class="identifier">T</span><span class="special">)</span> <span class="special">&gt;</span> <span class="number">0</span> <span class="comment">// Also static assertions.</span>
+ <span class="comment">// More class invariants here...</span>
+ <span class="special">)</span>
+
+ <span class="comment">// Static class invariants (checked by any function with a contract).</span>
+ <span class="identifier">CONTRACT_STATIC_CLASS_INVARIANT</span><span class="special">(</span> <span class="comment">// Optional and cannot access the object.</span>
+ <span class="keyword">true</span>
+ <span class="comment">// More static class invaraints here...</span>
+ <span class="special">)</span>
+
+<span class="keyword">public</span><span class="special">:</span>
+ <span class="keyword">typedef</span> <span class="keyword">typename</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">vector</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">&gt;::</span><span class="identifier">size_type</span> <span class="identifier">size_type</span><span class="special">;</span>
+ <span class="keyword">typedef</span> <span class="keyword">typename</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">vector</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">&gt;::</span><span class="identifier">iterator</span> <span class="identifier">iterator</span><span class="special">;</span>
+ <span class="keyword">typedef</span> <span class="keyword">typename</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">vector</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">&gt;::</span><span class="identifier">const_iterator</span> <span class="identifier">const_iterator</span><span class="special">;</span>
+ <span class="keyword">typedef</span> <span class="keyword">typename</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">vector</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">&gt;::</span><span class="identifier">const_reference</span> <span class="identifier">const_reference</span><span class="special">;</span>
+
+ <span class="comment">// Contract for constructor plus default parameter values.</span>
+ <span class="identifier">CONTRACT_CONSTRUCTOR</span><span class="special">(</span>
+ <span class="keyword">public</span> <span class="keyword">explicit</span> <span class="special">(</span><span class="identifier">myvector</span><span class="special">)(</span> <span class="special">(</span><span class="identifier">size_type</span><span class="special">)</span> <span class="identifier">count</span><span class="special">,</span> <span class="keyword">default</span> <span class="number">0</span> <span class="special">)</span>
+ <span class="identifier">initialize</span><span class="special">(</span> <span class="identifier">vector_</span><span class="special">(</span><span class="identifier">count</span><span class="special">)</span> <span class="special">)</span> <span class="comment">// Member initializers.</span>
+ <span class="comment">// Never object `this` in constructor preconditions.</span>
+ <span class="comment">// Never `CONTRACT_OLDOF(this)` in constructor postconditions.</span>
+ <span class="identifier">postcondition</span><span class="special">(</span> <span class="identifier">size</span><span class="special">()</span> <span class="special">==</span> <span class="identifier">count</span> <span class="special">)</span>
+ <span class="special">)</span> <span class="special">{</span>
+ <span class="comment">// Do nothing in this example.</span>
+ <span class="special">}</span>
+
+ <span class="comment">// Contractor for overloaded member (resolved by argumnet name).</span>
+ <span class="identifier">CONTRACT_CONSTRUCTOR</span><span class="special">(</span>
+ <span class="keyword">public</span> <span class="special">(</span><span class="identifier">myvector</span><span class="special">)(</span> <span class="special">(</span><span class="keyword">const</span> <span class="identifier">myvector</span><span class="special">&amp;)</span> <span class="identifier">right</span> <span class="special">)</span>
+ <span class="identifier">postcondition</span><span class="special">(</span> <span class="identifier">vector_</span> <span class="special">==</span> <span class="identifier">right</span><span class="special">.</span><span class="identifier">vector_</span> <span class="special">)</span>
+ <span class="special">)</span> <span class="special">;</span> <span class="comment">// The `;` deferres body definition.</span>
+
+ <span class="comment">// Contract for destructor.</span>
+ <span class="identifier">CONTRACT_DESTRUCTOR</span><span class="special">(</span>
+ <span class="comment">// No `~` in destructor name.</span>
+ <span class="comment">// Use `(void)` for empty function paramters.</span>
+ <span class="keyword">public</span> <span class="keyword">virtual</span> <span class="special">(</span><span class="identifier">myvector</span><span class="special">)()</span>
+ <span class="comment">// No preconditions allowed (no arguments).</span>
+ <span class="comment">// No postconditions allowed (no object after destructor).</span>
+ <span class="special">)</span> <span class="special">;</span>
+
+ <span class="comment">// Contract for member function, plus old values, plus assertion importance.</span>
+ <span class="identifier">CONTRACT_FUNCTION</span><span class="special">(</span>
+ <span class="keyword">public</span> <span class="keyword">void</span> <span class="special">(</span><span class="identifier">insert</span><span class="special">)(</span> <span class="comment">// Multiple function parameters.</span>
+ <span class="special">(</span><span class="identifier">iterator</span><span class="special">)</span> <span class="identifier">where</span><span class="special">,</span> <span class="special">(</span><span class="identifier">size_type</span><span class="special">)</span> <span class="identifier">count</span><span class="special">,</span> <span class="special">(</span><span class="keyword">const</span> <span class="identifier">T</span><span class="special">&amp;)</span> <span class="identifier">element</span> <span class="special">)</span>
+ <span class="identifier">precondition</span><span class="special">(</span> <span class="comment">// Function preconditions (optional).</span>
+ <span class="identifier">max_size</span><span class="special">()</span> <span class="special">&gt;=</span> <span class="identifier">size</span><span class="special">()</span> <span class="special">+</span> <span class="identifier">count</span>
+ <span class="comment">// More preconditions here...</span>
+ <span class="special">)</span>
+ <span class="comment">// Function postconditions (optional). Old value expressions must have</span>
+ <span class="comment">// different stringetized lengths.</span>
+ <span class="identifier">postcondition</span><span class="special">(</span>
+ <span class="keyword">auto</span> <span class="identifier">old_capacity</span> <span class="special">=</span> <span class="identifier">CONTRACT_OLDOF</span><span class="special">(</span><span class="identifier">capacity</span><span class="special">()),</span> <span class="comment">// Use Boost.Typeof.</span>
+ <span class="special">(</span><span class="identifier">iterator</span><span class="special">)</span> <span class="identifier">old_where</span> <span class="special">=</span> <span class="identifier">CONTRACT_OLDOF</span><span class="special">(</span><span class="identifier">where</span><span class="special">),</span> <span class="comment">// No Typeof.</span>
+ <span class="keyword">if</span><span class="special">(</span><span class="identifier">capacity</span><span class="special">()</span> <span class="special">==</span> <span class="identifier">old_capacity</span><span class="special">)</span> <span class="special">(</span>
+ <span class="comment">// Importance ordering specify assertion has linear complexity.</span>
+ <span class="identifier">all_equals</span><span class="special">(</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">prior</span><span class="special">(</span><span class="identifier">old_where</span><span class="special">),</span>
+ <span class="identifier">boost</span><span class="special">::</span><span class="identifier">prior</span><span class="special">(</span><span class="identifier">old_where</span><span class="special">)</span> <span class="special">+</span> <span class="identifier">count</span><span class="special">,</span> <span class="identifier">element</span><span class="special">),</span>
+ <span class="identifier">importance</span> <span class="identifier">O_N</span>
+ <span class="special">)</span> <span class="comment">// Optional `(else ...)` allowed here.</span>
+ <span class="comment">// More postconditions here...</span>
+ <span class="special">)</span>
+ <span class="special">)</span> <span class="special">{</span> <span class="comment">// Original function implementation.</span>
+ <span class="identifier">vector_</span><span class="special">.</span><span class="identifier">insert</span><span class="special">(</span><span class="identifier">where</span><span class="special">,</span> <span class="identifier">count</span><span class="special">,</span> <span class="identifier">element</span><span class="special">);</span>
+ <span class="special">}</span>
+
+ <span class="comment">// Contract for constant member.</span>
+ <span class="comment">// Non-void result type.</span>
+ <span class="identifier">CONTRACT_FUNCTION</span><span class="special">(</span>
+ <span class="keyword">public</span> <span class="special">(</span><span class="identifier">const_iterator</span><span class="special">)</span> <span class="special">(</span><span class="identifier">begin</span><span class="special">)()</span> <span class="keyword">const</span> <span class="comment">// Constant.</span>
+ <span class="identifier">postcondition</span><span class="special">(</span>
+ <span class="keyword">auto</span> <span class="identifier">result</span> <span class="special">=</span> <span class="keyword">return</span><span class="special">,</span> <span class="comment">// Return value named `result`.</span>
+ <span class="keyword">if</span><span class="special">(</span><span class="identifier">empty</span><span class="special">())</span> <span class="special">(</span> <span class="identifier">result</span> <span class="special">==</span> <span class="identifier">end</span><span class="special">()</span> <span class="special">)</span>
+ <span class="special">)</span>
+ <span class="special">)</span> <span class="special">{</span>
+ <span class="keyword">return</span> <span class="identifier">vector_</span><span class="special">.</span><span class="identifier">begin</span><span class="special">();</span>
+ <span class="special">}</span>
+
+ <span class="comment">// Contract for overloaded member (resolved because not const).</span>
+ <span class="identifier">CONTRACT_FUNCTION</span><span class="special">(</span>
+ <span class="keyword">public</span> <span class="special">(</span><span class="identifier">iterator</span><span class="special">)</span> <span class="special">(</span><span class="identifier">begin</span><span class="special">)()</span>
+ <span class="identifier">postcondition</span><span class="special">(</span>
+ <span class="keyword">auto</span> <span class="identifier">iter</span> <span class="special">=</span> <span class="keyword">return</span><span class="special">,</span> <span class="comment">// Return value namded `iter`.</span>
+ <span class="keyword">if</span><span class="special">(</span><span class="identifier">empty</span><span class="special">())</span> <span class="special">(</span> <span class="identifier">iter</span> <span class="special">==</span> <span class="identifier">end</span><span class="special">()</span> <span class="special">)</span>
+ <span class="special">)</span>
+ <span class="special">)</span> <span class="special">;</span>
+
+ <span class="comment">// Contract for operator, plus static assertion.</span>
+ <span class="identifier">CONTRACT_FUNCTION</span><span class="special">(</span>
+ <span class="comment">// Must spell operator name also in words (e.g., `at`).</span>
+ <span class="keyword">public</span> <span class="special">(</span><span class="identifier">const_reference</span><span class="special">)</span> <span class="keyword">operator</span><span class="special">([],</span> <span class="identifier">at</span><span class="special">)(</span> <span class="special">(</span><span class="identifier">size_type</span><span class="special">)</span> <span class="identifier">index</span> <span class="special">)</span> <span class="keyword">const</span>
+ <span class="identifier">precondition</span><span class="special">(</span>
+ <span class="identifier">index</span> <span class="special">&lt;</span> <span class="identifier">size</span><span class="special">(),</span>
+ <span class="comment">// Static assertion (checked at compile-time).</span>
+ <span class="keyword">static</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">has_nothrow_default_constructor</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">&gt;::</span><span class="identifier">value</span>
+ <span class="special">)</span>
+ <span class="special">)</span> <span class="special">;</span>
+
+ <span class="comment">// Main function example used in documentation.</span>
+ <span class="identifier">CONTRACT_FUNCTION</span><span class="special">(</span>
+ <span class="keyword">public</span> <span class="keyword">void</span> <span class="special">(</span><span class="identifier">push_back</span><span class="special">)(</span> <span class="special">(</span><span class="keyword">const</span> <span class="identifier">T</span><span class="special">&amp;)</span> <span class="identifier">element</span> <span class="special">)</span>
+ <span class="identifier">precondition</span><span class="special">(</span>
+ <span class="keyword">static</span> <span class="keyword">false</span><span class="special">,</span> <span class="comment">// Static assertion checked at compile-time.</span>
+ <span class="comment">// This precondition has no effect because subcontracts from</span>
+ <span class="comment">// `pushable::push_back()` which has no preconditions (this</span>
+ <span class="comment">// might be confusing and it is not allowed by [N1962]).</span>
+ <span class="identifier">size</span><span class="special">()</span> <span class="special">&lt;</span> <span class="identifier">max_size</span><span class="special">()</span>
+ <span class="special">)</span>
+ <span class="identifier">postcondition</span><span class="special">(</span>
+ <span class="keyword">static</span> <span class="keyword">true</span><span class="special">,</span>
+ <span class="keyword">auto</span> <span class="identifier">old_size</span> <span class="special">=</span> <span class="identifier">CONTRACT_OLDOF</span><span class="special">(</span><span class="identifier">size</span><span class="special">()),</span>
+ <span class="identifier">size</span><span class="special">()</span> <span class="special">==</span> <span class="identifier">old_size</span> <span class="special">+</span> <span class="number">1</span>
+ <span class="special">)</span>
+ <span class="special">)</span> <span class="special">{</span>
+ <span class="identifier">vector_</span><span class="special">.</span><span class="identifier">push_back</span><span class="special">(</span><span class="identifier">element</span><span class="special">);</span>
+ <span class="special">}</span>
+
+ <span class="comment">// Contract for template, plus static member function, plus concepts.</span>
+ <span class="identifier">CONTRACT_FUNCTION</span><span class="special">(</span>
+ <span class="keyword">public</span> <span class="keyword">template</span><span class="special">(</span> <span class="keyword">class</span> <span class="identifier">Iter</span> <span class="special">)</span> <span class="comment">// Function template.</span>
+ <span class="comment">// Concepts (uses Boost.ConceptCheck).</span>
+ <span class="identifier">requires</span><span class="special">(</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">InputIterator</span><span class="special">&lt;</span><span class="identifier">Iter</span><span class="special">&gt;,</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">EqualityComparable</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">&gt;</span> <span class="special">)</span>
+ <span class="comment">// Static member.</span>
+ <span class="keyword">static</span> <span class="keyword">bool</span> <span class="special">(</span><span class="identifier">all_equals</span><span class="special">)(</span> <span class="special">(</span><span class="identifier">Iter</span><span class="special">)</span> <span class="identifier">first</span><span class="special">,</span> <span class="special">(</span><span class="identifier">Iter</span><span class="special">)</span> <span class="identifier">last</span><span class="special">,</span> <span class="special">(</span><span class="keyword">const</span> <span class="identifier">T</span><span class="special">&amp;)</span> <span class="identifier">element</span> <span class="special">)</span>
+ <span class="identifier">precondition</span><span class="special">(</span> <span class="identifier">first</span> <span class="special">&lt;</span> <span class="identifier">last</span> <span class="special">)</span>
+ <span class="special">)</span> <span class="special">{</span>
+ <span class="comment">// Loop variants with importance.</span>
+ <span class="comment">/** @todo Do I need to specify importance for CONTRACT_LOOP so I can
+ * not declare the variant variable to avoid the unused error? But
+ * there should be another way to get rid of the unused error... maybe
+ * use a special object (like for scoped_mutex that do not give the
+ * unused error...). */</span>
+ <span class="identifier">CONTRACT_LOOP</span><span class="special">(</span> <span class="keyword">for</span><span class="special">(</span><span class="identifier">Iter</span> <span class="identifier">i</span> <span class="special">=</span> <span class="identifier">first</span><span class="special">;</span> <span class="identifier">i</span> <span class="special">&lt;</span> <span class="identifier">last</span><span class="special">;</span> <span class="special">++</span><span class="identifier">i</span><span class="special">)</span> <span class="special">)</span> <span class="special">{</span>
+ <span class="identifier">CONTRACT_LOOP_VARIANT</span><span class="special">(</span> <span class="keyword">const</span><span class="special">(</span> <span class="identifier">last</span><span class="special">,</span> <span class="identifier">i</span> <span class="special">)</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">distance</span><span class="special">(</span><span class="identifier">last</span><span class="special">,</span> <span class="identifier">i</span><span class="special">),</span>
+ <span class="identifier">importance</span> <span class="identifier">O_N</span> <span class="special">)</span>
+
+ <span class="keyword">if</span><span class="special">(*</span><span class="identifier">i</span> <span class="special">!=</span> <span class="identifier">element</span><span class="special">)</span> <span class="keyword">return</span> <span class="keyword">false</span><span class="special">;</span>
+ <span class="special">}</span> <span class="identifier">CONTRACT_LOOP_END</span>
+ <span class="keyword">return</span> <span class="keyword">true</span><span class="special">;</span>
+ <span class="special">}</span>
+
+ <span class="comment">// Similarly, complete contracts sketched here and add contracts</span>
+ <span class="comment">// for all other functions (see [Crowl2006] vector example).</span>
+ <span class="keyword">bool</span> <span class="identifier">empty</span><span class="special">(</span><span class="keyword">void</span><span class="special">)</span> <span class="keyword">const</span> <span class="special">{</span> <span class="keyword">return</span> <span class="identifier">vector_</span><span class="special">.</span><span class="identifier">empty</span><span class="special">();</span> <span class="special">}</span>
+ <span class="identifier">size_type</span> <span class="identifier">size</span><span class="special">(</span><span class="keyword">void</span><span class="special">)</span> <span class="keyword">const</span> <span class="special">{</span> <span class="keyword">return</span> <span class="identifier">vector_</span><span class="special">.</span><span class="identifier">size</span><span class="special">();</span> <span class="special">}</span>
+ <span class="identifier">size_type</span> <span class="identifier">max_size</span><span class="special">(</span><span class="keyword">void</span><span class="special">)</span> <span class="keyword">const</span> <span class="special">{</span> <span class="keyword">return</span> <span class="identifier">vector_</span><span class="special">.</span><span class="identifier">max_size</span><span class="special">();</span> <span class="special">}</span>
+ <span class="identifier">size_type</span> <span class="identifier">capacity</span><span class="special">(</span><span class="keyword">void</span><span class="special">)</span> <span class="keyword">const</span> <span class="special">{</span> <span class="keyword">return</span> <span class="identifier">vector_</span><span class="special">.</span><span class="identifier">capacity</span><span class="special">();</span> <span class="special">}</span>
+ <span class="identifier">iterator</span> <span class="identifier">end</span><span class="special">(</span><span class="keyword">void</span><span class="special">)</span> <span class="special">{</span> <span class="keyword">return</span> <span class="identifier">vector_</span><span class="special">.</span><span class="identifier">end</span><span class="special">();</span> <span class="special">}</span>
+ <span class="identifier">const_iterator</span> <span class="identifier">end</span><span class="special">(</span><span class="keyword">void</span><span class="special">)</span> <span class="keyword">const</span> <span class="special">{</span> <span class="keyword">return</span> <span class="identifier">vector_</span><span class="special">.</span><span class="identifier">end</span><span class="special">();</span> <span class="special">}</span>
+ <span class="identifier">const_reference</span> <span class="identifier">back</span><span class="special">(</span><span class="keyword">void</span><span class="special">)</span> <span class="keyword">const</span> <span class="special">{</span> <span class="keyword">return</span> <span class="identifier">vector_</span><span class="special">.</span><span class="identifier">back</span><span class="special">();</span> <span class="special">}</span>
+
+<span class="keyword">private</span><span class="special">:</span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">vector</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">&gt;</span> <span class="identifier">vector_</span><span class="special">;</span>
+<span class="special">};</span>
+
+<span class="comment">// Deferred constructor body definition.</span>
+<span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> <span class="identifier">T</span><span class="special">&gt;</span>
+<span class="identifier">CONTRACT_CONSTRUCTOR_BODY</span><span class="special">(</span><span class="identifier">myvector</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">&gt;,</span> <span class="identifier">myvector</span><span class="special">)(</span> <span class="keyword">const</span> <span class="identifier">myvector</span><span class="special">&amp;</span> <span class="identifier">right</span> <span class="special">)</span> <span class="special">{</span>
+ <span class="identifier">vector_</span> <span class="special">=</span> <span class="identifier">right</span><span class="special">.</span><span class="identifier">vector_</span><span class="special">;</span>
+<span class="special">}</span>
+
+<span class="comment">// Deferred destructor body definition.</span>
+<span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> <span class="identifier">T</span><span class="special">&gt;</span>
+<span class="identifier">CONTRACT_DESTRUCTOR_BODY</span><span class="special">(</span><span class="identifier">myvector</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">&gt;,</span> <span class="identifier">myvector</span><span class="special">)()</span> <span class="special">{</span>
+ <span class="comment">// Do nothing in this case.</span>
+<span class="special">}</span>
+
+<span class="comment">// Deferred member function definition.</span>
+<span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> <span class="identifier">T</span><span class="special">&gt;</span>
+<span class="keyword">typename</span> <span class="identifier">myvector</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">&gt;::</span><span class="identifier">iterator</span> <span class="identifier">myvector</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">&gt;::</span><span class="identifier">CONTRACT_MEMBER_BODY</span><span class="special">(</span><span class="identifier">begin</span><span class="special">)()</span> <span class="special">{</span>
+ <span class="keyword">return</span> <span class="identifier">vector_</span><span class="special">.</span><span class="identifier">begin</span><span class="special">();</span>
+<span class="special">}</span>
+
+<span class="comment">// Deferred member operator definition.</span>
+<span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> <span class="identifier">T</span><span class="special">&gt;</span>
+<span class="keyword">typename</span> <span class="identifier">myvector</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">&gt;::</span><span class="identifier">const_reference</span> <span class="identifier">myvector</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">&gt;::</span>
+ <span class="identifier">CONTRACT_MEMBER_BODY</span><span class="special">(</span><span class="keyword">operator</span><span class="special">([],</span> <span class="identifier">at</span><span class="special">))(</span> <span class="identifier">size_type</span> <span class="identifier">index</span> <span class="special">)</span> <span class="keyword">const</span> <span class="special">{</span>
+ <span class="keyword">return</span> <span class="identifier">vector_</span><span class="special">[</span><span class="identifier">index</span><span class="special">];</span>
+<span class="special">}</span>
+
+<span class="identifier">BOOST_PARAMETER_NAME</span><span class="special">(</span><span class="identifier">vector</span><span class="special">)</span> <span class="comment">// Declare Boost.Parameter for `vector`.</span>
+
+<span class="comment">// Contracts for free function plus named parameters (Boost.Parameter).</span>
+<span class="identifier">CONTRACT_FUNCTION</span><span class="special">(</span>
+<span class="keyword">double</span> <span class="special">(</span><span class="identifier">abs_total</span><span class="special">)(</span> <span class="identifier">in</span> <span class="special">(</span><span class="identifier">myvector</span><span class="special">&lt;</span><span class="keyword">double</span><span class="special">&gt;)</span> <span class="identifier">vector</span> <span class="special">)</span> <span class="comment">// Named input parameter.</span>
+ <span class="identifier">postcondition</span><span class="special">(</span> <span class="keyword">auto</span> <span class="identifier">result</span> <span class="special">=</span> <span class="keyword">return</span><span class="special">,</span> <span class="identifier">result</span> <span class="special">&gt;=</span> <span class="number">0.0</span> <span class="special">)</span>
+<span class="special">)</span> <span class="special">{</span>
+ <span class="keyword">double</span> <span class="identifier">total</span> <span class="special">=</span> <span class="number">0.0</span><span class="special">;</span>
+ <span class="comment">// Block invariants can appear anywhere in code block.</span>
+ <span class="identifier">CONTRACT_BLOCK_INVARIANT</span><span class="special">(</span> <span class="keyword">const</span><span class="special">(</span> <span class="identifier">total</span> <span class="special">)</span> <span class="identifier">total</span> <span class="special">==</span> <span class="number">0.0</span> <span class="special">)</span>
+ <span class="comment">// Block invariants assertions can be static and can have importance.</span>
+ <span class="identifier">CONTRACT_BLOCK_INVARIANT</span><span class="special">(</span> <span class="keyword">static</span> <span class="keyword">sizeof</span><span class="special">(</span><span class="keyword">double</span><span class="special">)</span> <span class="special">&gt;</span> <span class="number">0</span><span class="special">,</span> <span class="identifier">importance</span> <span class="identifier">O_1</span> <span class="special">)</span>
+
+ <span class="identifier">CONTRACT_LOOP</span><span class="special">(</span> <span class="keyword">for</span><span class="special">(</span><span class="identifier">size_t</span> <span class="identifier">i</span> <span class="special">=</span> <span class="number">0</span><span class="special">;</span> <span class="identifier">i</span> <span class="special">&lt;</span> <span class="identifier">vector</span><span class="special">.</span><span class="identifier">size</span><span class="special">();</span> <span class="special">++</span><span class="identifier">i</span><span class="special">)</span> <span class="special">)</span> <span class="special">{</span>
+ <span class="comment">// Block invariants can assert loop invariants (also w/ importance).</span>
+ <span class="comment">// For simplicity, constant-assertion is not used when assertion is</span>
+ <span class="comment">// clearly a constant-expression (it is programmers' responsibility).</span>
+ <span class="identifier">CONTRACT_BLOCK_INVARIANT</span><span class="special">(</span> <span class="identifier">i</span> <span class="special">&lt;</span> <span class="identifier">vector</span><span class="special">.</span><span class="identifier">size</span><span class="special">()</span> <span class="special">)</span>
+ <span class="comment">// Loop variant (can only appear in loops and cannot be static).</span>
+ <span class="identifier">CONTRACT_LOOP_VARIANT</span><span class="special">(</span> <span class="keyword">const</span><span class="special">(</span> <span class="identifier">vector</span><span class="special">,</span> <span class="identifier">i</span> <span class="special">)</span> <span class="identifier">vector</span><span class="special">.</span><span class="identifier">size</span><span class="special">()</span> <span class="special">-</span> <span class="identifier">i</span> <span class="special">)</span>
+
+ <span class="identifier">total</span> <span class="special">+=</span> <span class="identifier">vector</span><span class="special">[</span><span class="identifier">i</span><span class="special">];</span>
+ <span class="special">}</span> <span class="identifier">CONTRACT_LOOP_END</span>
+
+ <span class="keyword">return</span> <span class="identifier">total</span> <span class="special">&lt;</span> <span class="number">0.0</span> <span class="special">?</span> <span class="special">-</span><span class="identifier">total</span> <span class="special">:</span> <span class="identifier">total</span><span class="special">;</span>
+<span class="special">}</span>
+</pre>
+<p>
+ </p>
+ </td>
+<td>
+ <p>
+
+</p>
+<pre xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="table-programlisting"><span class="comment">// Extra spaces, newlines, public, etc to better align code with library syntax.</span>
+<span class="preprocessor">#include</span> <span class="string">"puchable.hpp"</span>
+<span class="preprocessor">#include</span> <span class="string">"boundable.hpp"</span>
+<span class="preprocessor">#include</span> <span class="string">"basic_begin.hpp"</span>
+<span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">concepts</span><span class="special">&gt;</span>
+<span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">vector</span><span class="special">&gt;</span>
+
+
+
+
+
+
+<span class="preprocessor">#define</span> <span class="identifier">O_1</span> <span class="number">0</span>
+<span class="preprocessor">#define</span> <span class="identifier">O_LOGN</span> <span class="number">1</span>
+<span class="preprocessor">#define</span> <span class="identifier">O_N</span> <span class="number">2</span>
+
+
+
+
+<span class="keyword">template</span><span class="special">&lt;</span> <span class="keyword">typename</span> <span class="identifier">T</span> <span class="special">&gt;</span>
+<span class="keyword">class</span> <span class="identifier">myvector</span>
+ <span class="special">:</span>
+ <span class="keyword">public</span> <span class="identifier">pushable</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">&gt;,</span>
+ <span class="keyword">public</span> <span class="identifier">boundable</span><span class="special">&lt;</span><span class="keyword">typename</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">vector</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">&gt;::</span><span class="identifier">const_iterator</span><span class="special">&gt;,</span>
+ <span class="keyword">private</span> <span class="identifier">basic_begin</span><span class="special">&lt;</span><span class="keyword">typename</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">vector</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">&gt;::</span><span class="identifier">const_iterator</span><span class="special">&gt;</span>
+
+<span class="special">{</span>
+
+ <span class="identifier">invariant</span> <span class="special">{</span>
+ <span class="identifier">empty</span><span class="special">()</span> <span class="special">==</span> <span class="special">(</span><span class="identifier">size</span><span class="special">()</span> <span class="special">==</span> <span class="number">0</span><span class="special">);</span>
+ <span class="keyword">static</span> <span class="keyword">sizeof</span><span class="special">(</span><span class="identifier">T</span><span class="special">)</span> <span class="special">&gt;</span> <span class="number">0</span><span class="special">;</span> <span class="comment">// Static assertions not in [N1962] but in [1866].</span>
+
+ <span class="special">}</span>
+
+
+ <span class="keyword">static</span> <span class="identifier">invariant</span> <span class="special">{</span> <span class="comment">// Static class invariants not in [N1962], etc.</span>
+ <span class="keyword">true</span><span class="special">;</span>
+
+ <span class="special">}</span>
+
+<span class="keyword">public</span><span class="special">:</span>
+ <span class="keyword">typedef</span> <span class="keyword">typename</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">vector</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">&gt;::</span><span class="identifier">size_type</span> <span class="identifier">size_type</span><span class="special">;</span>
+ <span class="keyword">typedef</span> <span class="keyword">typename</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">vector</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">&gt;::</span><span class="identifier">iterator</span> <span class="identifier">iterator</span><span class="special">;</span>
+ <span class="keyword">typedef</span> <span class="keyword">typename</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">vector</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">&gt;::</span><span class="identifier">const_iterator</span> <span class="identifier">const_iterator</span><span class="special">;</span>
+ <span class="keyword">typedef</span> <span class="keyword">typename</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">vector</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">&gt;::</span><span class="identifier">const_reference</span> <span class="identifier">const_reference</span><span class="special">;</span>
+
+
+
+ <span class="keyword">public</span><span class="special">:</span> <span class="keyword">explicit</span> <span class="identifier">myvector</span><span class="special">(</span> <span class="identifier">size_type</span> <span class="identifier">count</span> <span class="special">=</span> <span class="number">0</span> <span class="special">)</span>
+ <span class="special">:</span> <span class="identifier">vector_</span><span class="special">(</span><span class="identifier">count</span><span class="special">)</span>
+
+
+ <span class="identifier">postcondition</span> <span class="special">{</span> <span class="identifier">size</span><span class="special">()</span> <span class="special">==</span> <span class="identifier">count</span><span class="special">;</span> <span class="special">}</span>
+ <span class="special">{</span>
+
+ <span class="special">}</span>
+
+
+
+ <span class="keyword">public</span><span class="special">:</span> <span class="identifier">myvector</span><span class="special">(</span> <span class="keyword">const</span> <span class="identifier">myvector</span><span class="special">&amp;</span> <span class="identifier">right</span> <span class="special">)</span>
+ <span class="identifier">postcondition</span> <span class="special">{</span> <span class="identifier">vector_</span> <span class="special">==</span> <span class="identifier">right</span><span class="special">.</span><span class="identifier">vector_</span><span class="special">;</span> <span class="special">}</span>
+
+
+
+
+
+
+ <span class="keyword">public</span><span class="special">:</span> <span class="keyword">virtual</span> <span class="special">~</span><span class="identifier">myvector</span><span class="special">()</span>
+
+
+ <span class="special">;</span>
+
+
+
+ <span class="keyword">public</span><span class="special">:</span> <span class="keyword">void</span> <span class="identifier">insert</span><span class="special">(</span>
+ <span class="identifier">iterator</span> <span class="identifier">where</span><span class="special">,</span> <span class="identifier">size_type</span> <span class="identifier">count</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">T</span><span class="special">&amp;</span> <span class="identifier">element</span> <span class="special">)</span>
+ <span class="identifier">precondition</span> <span class="special">{</span>
+ <span class="identifier">max_size</span><span class="special">()</span> <span class="special">&gt;=</span> <span class="special">(</span><span class="identifier">size</span><span class="special">()</span> <span class="special">+</span> <span class="identifier">count</span><span class="special">);</span>
+
+ <span class="special">}</span>
+
+
+ <span class="identifier">postcondition</span> <span class="special">{</span>
+
+
+ <span class="keyword">if</span> <span class="special">(</span><span class="identifier">capactiy</span><span class="special">()</span> <span class="special">==</span> <span class="identifier">oldof</span> <span class="identifier">capacity</span><span class="special">())</span> <span class="special">{</span>
+
+ <span class="identifier">all_equals</span><span class="special">(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">prior</span><span class="special">(</span><span class="identifier">oldof</span> <span class="identifier">where</span><span class="special">),</span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">prior</span><span class="special">(</span><span class="identifier">oldof</span> <span class="identifier">where</span><span class="special">)</span> <span class="special">+</span> <span class="identifier">count</span><span class="special">,</span> <span class="identifier">element</span><span class="special">)</span>
+ <span class="special">:</span> <span class="identifier">O_N</span><span class="special">;</span> <span class="comment">// Importance ordering from [N1866].</span>
+ <span class="special">}</span>
+
+ <span class="special">}</span>
+ <span class="special">{</span>
+ <span class="identifier">vector_</span><span class="special">.</span><span class="identifier">insert</span><span class="special">(</span><span class="identifier">where</span><span class="special">,</span> <span class="identifier">count</span><span class="special">,</span> <span class="identifier">element</span><span class="special">);</span>
+ <span class="special">}</span>
+
+
+
+
+ <span class="keyword">public</span><span class="special">:</span> <span class="identifier">const_iterator</span> <span class="identifier">begin</span><span class="special">()</span> <span class="keyword">const</span>
+ <span class="identifier">postcondition</span><span class="special">(</span> <span class="identifier">result</span> <span class="special">)</span> <span class="special">{</span>
+
+ <span class="keyword">if</span><span class="special">(</span><span class="identifier">empty</span><span class="special">())</span> <span class="special">{</span> <span class="identifier">result</span> <span class="special">==</span> <span class="identifier">end</span><span class="special">();</span> <span class="special">}</span>
+ <span class="special">}</span>
+ <span class="special">{</span>
+ <span class="keyword">return</span> <span class="identifier">vector_</span><span class="special">.</span><span class="identifier">begin</span><span class="special">();</span>
+ <span class="special">}</span>
+
+
+
+ <span class="keyword">public</span><span class="special">:</span> <span class="identifier">iterator</span> <span class="identifier">begin</span><span class="special">()</span>
+ <span class="identifier">postcondition</span><span class="special">(</span> <span class="identifier">iter</span> <span class="special">)</span> <span class="special">{</span>
+
+ <span class="keyword">if</span><span class="special">(</span><span class="identifier">empty</span><span class="special">())</span> <span class="special">{</span> <span class="identifier">iter</span> <span class="special">==</span> <span class="identifier">end</span><span class="special">();</span> <span class="special">}</span>
+ <span class="special">}</span>
+ <span class="special">;</span>
+
+
+
+
+ <span class="keyword">public</span><span class="special">:</span> <span class="identifier">const_reference</span> <span class="keyword">operator</span><span class="special">[](</span> <span class="identifier">size_type</span> <span class="identifier">index</span> <span class="special">)</span> <span class="keyword">const</span>
+ <span class="identifier">precondition</span> <span class="special">{</span>
+ <span class="identifier">index</span> <span class="special">&lt;</span> <span class="identifier">size</span><span class="special">();</span>
+
+ <span class="keyword">static</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">has_nothrow_default_constructor</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">&gt;::</span><span class="identifier">value</span><span class="special">;</span>
+ <span class="special">}</span>
+ <span class="special">;</span>
+
+
+
+ <span class="keyword">public</span><span class="special">:</span> <span class="keyword">void</span> <span class="identifier">push_back</span><span class="special">(</span> <span class="keyword">const</span> <span class="identifier">T</span><span class="special">&amp;</span> <span class="identifier">element</span> <span class="special">)</span>
+ <span class="identifier">precondition</span> <span class="special">{</span>
+ <span class="keyword">static</span> <span class="keyword">false</span><span class="special">;</span>
+
+
+
+ <span class="identifier">size</span><span class="special">()</span> <span class="special">&lt;</span> <span class="identifier">max_size</span><span class="special">();</span>
+ <span class="special">}</span>
+ <span class="identifier">postcondition</span> <span class="special">{</span>
+ <span class="keyword">static</span> <span class="keyword">true</span><span class="special">;</span>
+
+ <span class="identifier">size</span><span class="special">()</span> <span class="special">==</span> <span class="identifier">oldof</span> <span class="identifier">size</span><span class="special">()</span> <span class="special">+</span> <span class="number">1</span><span class="special">;</span>
+ <span class="special">}</span>
+ <span class="special">{</span>
+ <span class="identifier">vector_</span><span class="special">.</span><span class="identifier">push_back</span><span class="special">(</span><span class="identifier">element</span><span class="special">);</span>
+ <span class="special">}</span>
+
+
+
+ <span class="keyword">public</span><span class="special">:</span> <span class="keyword">template</span><span class="special">&lt;</span> <span class="keyword">class</span> <span class="identifier">Iter</span> <span class="special">&gt;</span>
+
+ <span class="identifier">requires</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">InputIterator</span><span class="special">&lt;</span><span class="identifier">Iter</span><span class="special">&gt;,</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">EqualityComparable</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">&gt;</span>
+
+ <span class="keyword">static</span> <span class="keyword">bool</span> <span class="identifier">all_equals</span><span class="special">(</span> <span class="identifier">Iter</span> <span class="identifier">first</span><span class="special">,</span> <span class="identifier">Iter</span> <span class="identifier">last</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">T</span><span class="special">&amp;</span> <span class="identifier">element</span> <span class="special">)</span>
+ <span class="identifier">precondition</span> <span class="special">{</span> <span class="identifier">first</span> <span class="special">&lt;</span> <span class="identifier">last</span><span class="special">;</span> <span class="special">}</span>
+ <span class="special">{</span>
+
+
+
+
+
+ <span class="comment">// No loop invariant/variant in [N1963].</span>
+ <span class="keyword">for</span><span class="special">(</span><span class="identifier">Iter</span> <span class="identifier">i</span> <span class="special">=</span> <span class="identifier">first</span><span class="special">;</span> <span class="identifier">i</span> <span class="special">&lt;</span> <span class="identifier">last</span><span class="special">;</span> <span class="special">++</span><span class="identifier">i</span><span class="special">)</span> <span class="special">{</span>
+
+
+
+ <span class="keyword">if</span><span class="special">(*</span><span class="identifier">i</span> <span class="special">!=</span> <span class="identifier">element</span><span class="special">)</span> <span class="keyword">return</span> <span class="keyword">false</span><span class="special">;</span>
+ <span class="special">}</span>
+ <span class="keyword">return</span> <span class="keyword">true</span><span class="special">;</span>
+ <span class="special">}</span>
+
+
+
+ <span class="keyword">bool</span> <span class="identifier">empty</span><span class="special">(</span><span class="keyword">void</span><span class="special">)</span> <span class="keyword">const</span> <span class="special">{</span> <span class="keyword">return</span> <span class="identifier">vector_</span><span class="special">.</span><span class="identifier">empty</span><span class="special">();</span> <span class="special">}</span>
+ <span class="identifier">size_type</span> <span class="identifier">size</span><span class="special">(</span><span class="keyword">void</span><span class="special">)</span> <span class="keyword">const</span> <span class="special">{</span> <span class="keyword">return</span> <span class="identifier">vector_</span><span class="special">.</span><span class="identifier">size</span><span class="special">();</span> <span class="special">}</span>
+ <span class="identifier">size_type</span> <span class="identifier">max_size</span><span class="special">(</span><span class="keyword">void</span><span class="special">)</span> <span class="keyword">const</span> <span class="special">{</span> <span class="keyword">return</span> <span class="identifier">vector_</span><span class="special">.</span><span class="identifier">max_size</span><span class="special">();</span> <span class="special">}</span>
+ <span class="identifier">size_type</span> <span class="identifier">capacity</span><span class="special">(</span><span class="keyword">void</span><span class="special">)</span> <span class="keyword">const</span> <span class="special">{</span> <span class="keyword">return</span> <span class="identifier">vector_</span><span class="special">.</span><span class="identifier">capacity</span><span class="special">();</span> <span class="special">}</span>
+ <span class="identifier">iterator</span> <span class="identifier">end</span><span class="special">(</span><span class="keyword">void</span><span class="special">)</span> <span class="special">{</span> <span class="keyword">return</span> <span class="identifier">vector_</span><span class="special">.</span><span class="identifier">end</span><span class="special">();</span> <span class="special">}</span>
+ <span class="identifier">const_iterator</span> <span class="identifier">end</span><span class="special">(</span><span class="keyword">void</span><span class="special">)</span> <span class="keyword">const</span> <span class="special">{</span> <span class="keyword">return</span> <span class="identifier">vector_</span><span class="special">.</span><span class="identifier">end</span><span class="special">();</span> <span class="special">}</span>
+ <span class="identifier">const_reference</span> <span class="identifier">back</span><span class="special">(</span><span class="keyword">void</span><span class="special">)</span> <span class="keyword">const</span> <span class="special">{</span> <span class="keyword">return</span> <span class="identifier">vector_</span><span class="special">.</span><span class="identifier">back</span><span class="special">();</span> <span class="special">}</span>
+
+<span class="keyword">private</span><span class="special">:</span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">vector</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">&gt;</span> <span class="identifier">vector_</span><span class="special">;</span>
+<span class="special">};</span>
+
+
+<span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> <span class="identifier">T</span><span class="special">&gt;</span>
+<span class="identifier">myvector</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">&gt;::</span><span class="identifier">myvector</span><span class="special">(</span> <span class="keyword">const</span> <span class="identifier">myvector</span><span class="special">&amp;</span> <span class="identifier">right</span> <span class="special">)</span> <span class="special">{</span>
+ <span class="identifier">vector_</span> <span class="special">=</span> <span class="identifier">right</span><span class="special">.</span><span class="identifier">vector_</span><span class="special">;</span>
+<span class="special">}</span>
+
+
+<span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> <span class="identifier">T</span><span class="special">&gt;</span>
+<span class="identifier">myvector</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">&gt;::~</span><span class="identifier">myvector</span><span class="special">()</span> <span class="special">{</span>
+
+<span class="special">}</span>
+
+
+<span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> <span class="identifier">T</span><span class="special">&gt;</span>
+<span class="keyword">typename</span> <span class="identifier">myvector</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">&gt;::</span><span class="identifier">iterator</span> <span class="identifier">myvector</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">&gt;::</span><span class="identifier">begin</span><span class="special">()</span> <span class="special">{</span>
+ <span class="keyword">return</span> <span class="identifier">vector_</span><span class="special">.</span><span class="identifier">begin</span><span class="special">();</span>
+<span class="special">}</span>
+
+
+<span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> <span class="identifier">T</span><span class="special">&gt;</span>
+<span class="keyword">typename</span> <span class="identifier">myvector</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">&gt;::</span><span class="identifier">const_reference</span> <span class="identifier">myvector</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">&gt;::</span>
+ <span class="keyword">operator</span><span class="special">[](</span> <span class="identifier">size_type</span> <span class="identifier">index</span> <span class="special">)</span> <span class="keyword">const</span> <span class="special">{</span>
+ <span class="keyword">return</span> <span class="identifier">vector_</span><span class="special">[</span><span class="identifier">index</span><span class="special">];</span>
+<span class="special">}</span>
+
+
+
+
+<span class="comment">// No named parameter (there is no C++ proposal that supports them).</span>
+<span class="keyword">double</span> <span class="identifier">abs_total</span><span class="special">(</span> <span class="identifier">myvector</span><span class="special">&lt;</span><span class="keyword">double</span><span class="special">&gt;&amp;</span> <span class="identifier">vector</span> <span class="special">)</span>
+ <span class="identifier">poscondition</span><span class="special">(</span> <span class="identifier">result</span> <span class="special">)</span> <span class="special">{</span> <span class="identifier">result</span> <span class="special">&gt;=</span> <span class="number">0.0</span><span class="special">;</span> <span class="special">}</span>
+<span class="special">{</span>
+ <span class="keyword">double</span> <span class="identifier">total</span> <span class="special">=</span> <span class="number">0.0</span><span class="special">;</span>
+
+ <span class="identifier">invariant</span> <span class="special">{</span> <span class="identifier">total</span> <span class="special">==</span> <span class="number">0.0</span><span class="special">;</span> <span class="special">}</span>
+
+ <span class="identifier">invariant</span> <span class="special">{</span> <span class="keyword">static</span> <span class="keyword">sizeof</span><span class="special">(</span><span class="keyword">double</span><span class="special">)</span> <span class="special">&gt;</span> <span class="number">0</span> <span class="special">:</span> <span class="identifier">O_1</span> <span class="special">}</span> <span class="comment">// No proposal for `static`.</span>
+
+ <span class="keyword">for</span><span class="special">(</span><span class="identifier">size_t</span> <span class="identifier">i</span> <span class="special">=</span> <span class="number">0</span><span class="special">;</span> <span class="identifier">i</span> <span class="special">&lt;</span> <span class="identifier">vector</span><span class="special">.</span><span class="identifier">size</span><span class="special">();</span> <span class="special">++</span><span class="identifier">i</span><span class="special">)</span> <span class="special">{</span>
+
+
+
+ <span class="identifier">invariant</span> <span class="special">{</span> <span class="identifier">i</span> <span class="special">&lt;</span> <span class="identifier">vector</span><span class="special">.</span><span class="identifier">size</span><span class="special">();</span> <span class="special">}</span>
+
+ <span class="comment">// No proposal for loop variants.</span>
+
+ <span class="identifier">total</span> <span class="special">+=</span> <span class="identifier">vector</span><span class="special">[</span><span class="identifier">i</span><span class="special">];</span>
+ <span class="special">}</span>
+
+ <span class="keyword">return</span> <span class="identifier">total</span> <span class="special">&lt;</span> <span class="number">0.0</span> <span class="special">?</span> <span class="special">-</span><span class="identifier">total</span> <span class="special">:</span> <span class="identifier">total</span><span class="special">;</span>
+<span class="special">}</span>
+</pre>
+<p>
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+
+</p>
+<pre xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="table-programlisting"><span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">contract</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span>
+
+<span class="identifier">CONTRACT_CLASS</span><span class="special">(</span>
+<span class="keyword">template</span><span class="special">(</span> <span class="keyword">typename</span> <span class="identifier">T</span> <span class="special">)</span>
+<span class="keyword">class</span> <span class="special">(</span><span class="identifier">pushable</span><span class="special">)</span>
+<span class="special">)</span> <span class="special">{</span>
+ <span class="comment">// No class invariants.</span>
+<span class="keyword">public</span><span class="special">:</span>
+ <span class="keyword">virtual</span> <span class="special">~</span><span class="identifier">pushable</span><span class="special">()</span> <span class="special">{}</span>
+
+ <span class="comment">// Contract for pure virtual function.</span>
+ <span class="identifier">CONTRACT_FUNCTION</span><span class="special">(</span>
+ <span class="keyword">public</span> <span class="keyword">virtual</span> <span class="keyword">void</span> <span class="special">(</span><span class="identifier">push_back</span><span class="special">)(</span> <span class="special">(</span><span class="keyword">const</span> <span class="identifier">T</span><span class="special">&amp;)</span> <span class="identifier">element</span> <span class="special">)</span>
+ <span class="comment">/** @todo No precondition here implies all preconditions of derived
+ * classes have no effect... */</span>
+ <span class="identifier">postcondition</span><span class="special">(</span> <span class="identifier">back</span><span class="special">()</span> <span class="special">==</span> <span class="identifier">element</span> <span class="special">)</span>
+ <span class="special">)</span> <span class="special">=</span> <span class="number">0</span><span class="special">;</span> <span class="comment">// Pure virtual body.</span>
+
+ <span class="keyword">virtual</span> <span class="keyword">const</span> <span class="identifier">T</span><span class="special">&amp;</span> <span class="identifier">back</span><span class="special">()</span> <span class="keyword">const</span> <span class="special">=</span> <span class="number">0</span><span class="special">;</span>
+<span class="special">};</span>
+</pre>
+<p>
+ </p>
+ </td>
+<td>
+ <p>
+
+</p>
+<pre xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="table-programlisting"><span class="comment">// Extra spaces, newlines, public, etc to better align code with library syntax.</span>
+
+
+<span class="keyword">template</span><span class="special">&lt;</span> <span class="keyword">typename</span> <span class="identifier">T</span> <span class="special">&gt;</span>
+<span class="keyword">class</span> <span class="identifier">pushable</span>
+<span class="special">{</span>
+
+<span class="keyword">public</span><span class="special">:</span>
+ <span class="keyword">virtual</span> <span class="special">~</span><span class="identifier">pushable</span><span class="special">()</span> <span class="special">{}</span>
+
+
+
+ <span class="keyword">public</span><span class="special">:</span> <span class="keyword">virtual</span> <span class="keyword">void</span> <span class="identifier">push_back</span><span class="special">(</span> <span class="keyword">const</span> <span class="identifier">T</span><span class="special">&amp;</span> <span class="identifier">element</span> <span class="special">)</span>
+
+
+ <span class="identifier">postcondition</span> <span class="special">{</span> <span class="identifier">back</span><span class="special">()</span> <span class="special">==</span> <span class="identifier">element</span><span class="special">;</span> <span class="special">}</span>
+ <span class="special">=</span> <span class="number">0</span><span class="special">;</span>
+
+ <span class="keyword">virtual</span> <span class="keyword">const</span> <span class="identifier">T</span><span class="special">&amp;</span> <span class="identifier">back</span><span class="special">()</span> <span class="keyword">const</span> <span class="special">=</span> <span class="number">0</span><span class="special">;</span>
+<span class="special">};</span>
+</pre>
+<p>
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+
+</p>
+<pre xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="table-programlisting"><span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">contract</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span>
+
+<span class="identifier">CONTRACT_CLASS</span><span class="special">(</span>
+<span class="keyword">template</span><span class="special">(</span> <span class="keyword">class</span> <span class="identifier">ConstIter</span> <span class="special">)</span>
+<span class="keyword">class</span> <span class="special">(</span><span class="identifier">boundable</span><span class="special">)</span>
+<span class="special">)</span> <span class="special">{</span>
+ <span class="identifier">CONTRACT_CLASS_INVARIANT</span><span class="special">(</span> <span class="identifier">begin</span><span class="special">()</span> <span class="special">&lt;=</span> <span class="identifier">end</span><span class="special">()</span> <span class="special">)</span>
+
+<span class="keyword">public</span><span class="special">:</span>
+ <span class="keyword">virtual</span> <span class="special">~</span><span class="identifier">boundable</span><span class="special">()</span> <span class="special">{}</span>
+
+ <span class="keyword">virtual</span> <span class="identifier">ConstIter</span> <span class="identifier">begin</span><span class="special">()</span> <span class="keyword">const</span> <span class="special">=</span> <span class="number">0</span><span class="special">;</span>
+ <span class="keyword">virtual</span> <span class="identifier">ConstIter</span> <span class="identifier">end</span><span class="special">()</span> <span class="keyword">const</span> <span class="special">=</span> <span class="number">0</span><span class="special">;</span>
+<span class="special">};</span>
+</pre>
+<p>
+ </p>
+ </td>
+<td>
+ <p>
+
+</p>
+<pre xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="table-programlisting"><span class="comment">// Extra spaces, newlines, public, etc to better align code with library syntax.</span>
+
+
+<span class="keyword">template</span><span class="special">&lt;</span> <span class="keyword">class</span> <span class="identifier">ConstIter</span> <span class="special">&gt;</span>
+<span class="keyword">class</span> <span class="identifier">boundable</span>
+<span class="special">{</span>
+ <span class="identifier">invariant</span> <span class="special">{</span> <span class="identifier">begin</span><span class="special">()</span> <span class="special">&lt;=</span> <span class="identifier">end</span><span class="special">();</span> <span class="special">}</span>
+
+<span class="keyword">public</span><span class="special">:</span>
+ <span class="keyword">virtual</span> <span class="special">~</span><span class="identifier">boundable</span><span class="special">()</span> <span class="special">{}</span>
+
+ <span class="keyword">virtual</span> <span class="identifier">ConstIter</span> <span class="identifier">begin</span><span class="special">()</span> <span class="keyword">const</span> <span class="special">=</span> <span class="number">0</span><span class="special">;</span>
+ <span class="keyword">virtual</span> <span class="identifier">ConstIter</span> <span class="identifier">end</span><span class="special">()</span> <span class="keyword">const</span> <span class="special">=</span> <span class="number">0</span><span class="special">;</span>
+<span class="special">};</span>
+</pre>
+<p>
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+
+</p>
+<pre xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="table-programlisting"><span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">contract</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span>
+
+<span class="identifier">CONTRACT_CLASS</span><span class="special">(</span>
+<span class="keyword">template</span><span class="special">(</span> <span class="keyword">class</span> <span class="identifier">ConstIter</span> <span class="special">)</span>
+<span class="keyword">class</span> <span class="special">(</span><span class="identifier">basic_begin</span><span class="special">)</span>
+<span class="special">)</span> <span class="special">{</span>
+ <span class="comment">// No class invariants.</span>
+<span class="keyword">public</span><span class="special">:</span>
+ <span class="keyword">virtual</span> <span class="special">~</span><span class="identifier">basic_begin</span><span class="special">()</span> <span class="special">{}</span>
+
+ <span class="identifier">CONTRACT_FUNCTION</span><span class="special">(</span>
+ <span class="keyword">public</span> <span class="keyword">virtual</span> <span class="special">(</span><span class="identifier">ConstIter</span><span class="special">)</span> <span class="special">(</span><span class="identifier">begin</span><span class="special">)()</span> <span class="keyword">const</span>
+ <span class="special">)</span> <span class="special">{</span>
+ <span class="keyword">return</span> <span class="identifier">ConstIter</span><span class="special">();</span> <span class="comment">// Dummy implementation (for example only).</span>
+ <span class="special">}</span>
+<span class="special">};</span>
+</pre>
+<p>
+ </p>
+ </td>
+<td>
+ <p>
+
+</p>
+<pre xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="table-programlisting"><span class="comment">// Extra spaces, newlines, public, etc to better align code with library syntax.</span>
+
+
+<span class="keyword">template</span><span class="special">&lt;</span> <span class="keyword">class</span> <span class="identifier">ConstIter</span> <span class="special">&gt;</span>
+<span class="keyword">class</span> <span class="identifier">basic_begin</span>
+<span class="special">{</span>
+
+<span class="keyword">public</span><span class="special">:</span>
+ <span class="keyword">virtual</span> <span class="special">~</span><span class="identifier">basic_begin</span><span class="special">()</span> <span class="special">{}</span>
+
+
+ <span class="keyword">public</span><span class="special">:</span> <span class="keyword">virtual</span> <span class="identifier">ConstIter</span> <span class="identifier">begin</span><span class="special">()</span> <span class="keyword">const</span>
+ <span class="special">{</span>
+ <span class="keyword">return</span> <span class="identifier">ConstIter</span><span class="special">();</span>
+ <span class="special">}</span>
+<span class="special">};</span>
+</pre>
+<p>
+ </p>
+ </td>
+</tr>
+</tbody>
+</table></div>
+</div>
+<div class="footnotes">
+<br><hr width="100" align="left">
+<div class="footnote"><p><sup>[<a id="ftn.id866529" href="#id866529" class="para">2</a>] </sup>
+ Static member functions cannot be virtual so they cannot be overridden
+ and they cannot subcontract.
+ </p></div>
+<div class="footnote"><p><sup>[<a id="ftn.id866892" href="#id866892" class="para">3</a>] </sup>
+ However, the destructor body should be programmed to <span class="emphasis"><em>never</em></span>
+ throw exceptions to comply with C++ STL exception safety requirements.
+ </p></div>
+<div class="footnote"><p><sup>[<a id="ftn.id867319" href="#id867319" class="para">4</a>] </sup>
+ As usual in C++, constant-correctness can be enforced at compile-time only
+ as long as programmers do not use <code class="computeroutput"><span class="keyword">const_cast</span></code>
+ and <code class="computeroutput"><span class="keyword">mutable</span></code>.
+ </p></div>
+<div class="footnote"><p><sup>[<a id="ftn.id867446" href="#id867446" class="para">5</a>] </sup>
+ To improve contract readability, it is recommended to configure your editor
+ C++ syntax highlighting to highlight also the macros <code class="computeroutput"><span class="identifier">CONTRACT_INVARIANT</span></code>,
+ <code class="computeroutput"><span class="identifier">CONTRACT_FUNCTION</span></code>, <code class="computeroutput"><span class="identifier">CONTRACT_CONSTRUCTOR</span></code>, <code class="computeroutput"><span class="identifier">CONTRACT_DESTRUCTOR</span></code>,
+ <code class="computeroutput"><span class="identifier">CONTRACT_OLDOF</span></code>, <code class="computeroutput"><span class="identifier">CONTRACT_BODY</span></code>, <code class="computeroutput"><span class="identifier">CONTRACT_CONSTRUCTOR_BODY</span></code>,
+ <code class="computeroutput"><span class="identifier">CONTRACT_DESTRUCTOR_BODY</span></code>,
+ <code class="computeroutput"><span class="identifier">CONTRACT_ASSERT</span></code>, <code class="computeroutput"><span class="identifier">CONTRACT_ASSERT_MSG</span></code>, <code class="computeroutput"><span class="identifier">CONTRACT_ASSERT_BLOCK_INVARIANT</span></code>,
+ <code class="computeroutput"><span class="identifier">CONTRACT_ASSERT_BLOCK_INVARIANT_MSG</span></code>,
+ <code class="computeroutput"><span class="identifier">CONTRACT_ASSERT_LOOP_VARIANT</span></code>,
+ <code class="computeroutput"><span class="identifier">CONTRACT_ASSERT_LOOP_VARIANT_MSG</span></code>,
+ <code class="computeroutput"><span class="identifier">CONTRACT_INIT_LOOP_VARIANT</span></code>,
+ and the sequence tokens <code class="computeroutput"><span class="identifier">precondition</span></code>,
+ <code class="computeroutput"><span class="identifier">postcondition</span></code>, <code class="computeroutput"><span class="identifier">body</span></code>, <code class="computeroutput"><span class="identifier">copyable</span></code>,
+ and <code class="computeroutput"><span class="identifier">inherit</span></code>. For example,
+ this can be done in the Vi IMproved (VIM) editor by adding these symbols
+ to the <code class="computeroutput"><span class="string">"cpp.vim"</span></code>
+ file (usually in the VIM system configuration directory).
+ </p></div>
+<div class="footnote"><p><sup>[<a id="ftn.id867766" href="#id867766" class="para">6</a>] </sup>
+ Some text editing programs might highlight curly brackets <code class="computeroutput"><span class="special">{}</span></code> within a macro parameter as a C++
+ syntax error. This is incorrect as the ISO C++ standard allows for
+ macro parameters to contain curly brackets and the editor might offer
+ an option for disabling this incorrect syntax error highlighting. For
+ example, when C++ syntax highlighting is turned on in the Vi IMproved
+ (VIM) editor, curly brackets within macro parameters are highlighted
+ as errors but that can be disabled by adding the line <code class="computeroutput"><span class="identifier">let</span> <span class="identifier">c_no_curly_error</span><span class="special">=</span><span class="number">1</span></code> in
+ the <code class="computeroutput"><span class="string">".vimrc"</span></code>
+ file (typically in your home directory).
+ </p></div>
+<div class="footnote"><p><sup>[<a id="ftn.id868651" href="#id868651" class="para">7</a>] </sup>
+ However, this is the only sensible semantics for copying pointers as
+ the pointer could of type <code class="computeroutput"><span class="keyword">void</span><span class="special">*</span></code> for which it is not possible to copy
+ the pointed object, plus there might cases where the functions actually
+ changed the pointer value so <code class="computeroutput">CONTRACT_OLDOF<span class="special">()</span></code> needs to the return the old pointer
+ value (and not the old pointed value), plus this the usual C++ pointer
+ copy semantic.
+ </p></div>
+<div class="footnote"><p><sup>[<a id="ftn.id871421" href="#id871421" class="para">8</a>] </sup>
+ <a class="link" href="bibliography.html" title="Bibliography">[Meyer1997]</a> argues preconditions
+ asserted using non-public members are ill written thus the Eiffel programming
+ language enforces this rule at compile-time. However, in C++ friend callers
+ could still be able to fully check preconditions via the friendship even
+ when non-public functions are used to assert them therefore this rule is
+ left as a recommended practice for programmers to follow and it is not
+ enforced by the library.
+ </p></div>
+<div class="footnote"><p><sup>[<a id="ftn.id871567" href="#id871567" class="para">9</a>] </sup>
+ If two Boost.Preprocessor
+ sequences are specified one after the other then they are automatically
+ concatenated into one larger sequence. For example let <code class="computeroutput"><span class="identifier">seq1</span></code>
+ be <code class="computeroutput"><span class="special">(</span><span class="identifier">token1</span><span class="special">)</span> <span class="special">(</span><span class="identifier">token2</span><span class="special">)</span></code> and <code class="computeroutput"><span class="identifier">seq2</span></code>
+ be <code class="computeroutput"><span class="special">(</span><span class="identifier">token3</span><span class="special">)</span> <span class="special">(</span><span class="identifier">token4</span><span class="special">)</span> <span class="special">(</span><span class="identifier">token5</span><span class="special">)</span></code> then <code class="computeroutput"><span class="identifier">seq1</span>
+ <span class="identifier">seq2</span></code> is <code class="computeroutput"><span class="special">(</span><span class="identifier">token1</span><span class="special">)</span> <span class="special">(</span><span class="identifier">token2</span><span class="special">)</span> <span class="special">(</span><span class="identifier">token3</span><span class="special">)</span> <span class="special">(</span><span class="identifier">token4</span><span class="special">)</span> <span class="special">(</span><span class="identifier">token5</span><span class="special">)</span></code>.
+ </p></div>
+<div class="footnote"><p><sup>[<a id="ftn.id871782" href="#id871782" class="para">10</a>] </sup>
+ Because the <span class="emphasis"><em>signature-sequence</em></span> essentially contains
+ all the tokens necessary to declare the function, the contract macros could
+ have been implemented to replace the function declaration entirely instead
+ of being specified right after the function declaration. This would have
+ saved the programmers from repeating the function declaration tokens twice,
+ first to declare the function and then to invoke the contract macro. However,
+ replacing the function declarations entirely with the unfamiliar looking
+ <span class="emphasis"><em>signature-sequence</em></span> would have drastically reduced
+ readability therefore it was intentionally avoided.
+ </p></div>
+<div class="footnote"><p><sup>[<a id="ftn.id873443" href="#id873443" class="para">11</a>] </sup>
+ A <span class="emphasis"><em>constant-correct copy constructor</em></span> constructs
+ the object copying it from a constant-reference of the source object
+ thus it cannot alter the state of the copied object.
+ </p></div>
+<div class="footnote"><p><sup>[<a id="ftn.id875088" href="#id875088" class="para">12</a>] </sup>
+ However, this could change in future revisions of the library if C++ were
+ to support delegating constructors (see <a class="link" href="bibliography.html" title="Bibliography">[Sutter2005]</a>).
+ Therefore, <code class="computeroutput"><span class="special">(</span><span class="keyword">explicit</span><span class="special">)</span></code> is part of the library API and it should
+ always be specified in <span class="emphasis"><em>signature-sequence</em></span> when the
+ contracted constructor is <code class="computeroutput"><span class="keyword">explicit</span></code>.
+ </p></div>
+<div class="footnote"><p><sup>[<a id="ftn.id875701" href="#id875701" class="para">13</a>] </sup>
+ One specific token ordering was fixed so to simplify the implementation
+ of the library code that parsers <span class="emphasis"><em>signature-sequence</em></span>.
+ </p></div>
+<div class="footnote"><p><sup>[<a id="ftn.id878201" href="#id878201" class="para">14</a>] </sup>
+ Using the augmented object state the library could detect infinite recursion
+ between overriding and overridden function. However, to break the recursion
+ the base contract will have to call the base body function forcing static
+ binding (otherwise using dynamic binding the overriding function will be
+ called causing the infinite recursion). The contract itself cannot perform
+ the static binding call (e.g., using static_cast&lt;&gt; to the object)
+ because the object state is changed only if pointers or references to the
+ objects are used to call the body, but if pointers or reference are used
+ then C++ uses dynamic binding for the call. So the contract function could
+ call a special method of the contract class which performs the static binding
+ call but such a static binding call will raise a compiler error if the
+ body function is pure virtual. The library does not know directly when
+ a function is pure virtual (body is <code class="computeroutput"><span class="special">=</span>
+ <span class="number">0</span><span class="special">;</span></code>)
+ or not so the library will have to define the contract class static binding
+ method also for pure virtual functions and in this case the static binding
+ call <code class="computeroutput"><span class="identifier">B</span><span class="special">::</span><span class="identifier">f</span><span class="special">()</span></code> will
+ raise a compile time error because the function called via static binding
+ is pure virtual.
+ </p></div>
+<div class="footnote"><p><sup>[<a id="ftn.id883083" href="#id883083" class="para">15</a>] </sup>
+ The library <span class="emphasis"><em>could</em></span> overcome this limitation if future
+ versions of the C++ standard were to support delegating constructors
+ (as proposed by <a class="link" href="bibliography.html" title="Bibliography">[Sutter2005]</a>).
+ </p></div>
+</div>
+</div>
+<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
+<td align="left"></td>
+<td align="right"><div class="copyright-footer">Copyright &#169; 2009, 2010 Lorenzo Caminiti<p>
+ Distributed under the Contract++ Software License, Version 1.0 (see accompanying
+ file LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="getting_started.html"><img src="../images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../images/home.png" alt="Home"></a><a accesskey="n" href="without_the_macros.html"><img src="../images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>

Added: sandbox/contract/libs/contract/doc/html/contract__/without_the_macros.html
==============================================================================
--- (empty file)
+++ sandbox/contract/libs/contract/doc/html/contract__/without_the_macros.html 2011-06-28 20:54:41 EDT (Tue, 28 Jun 2011)
@@ -0,0 +1,1425 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
+<title>Without the Macros</title>
+<link rel="stylesheet" href="../doc/html/boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
+<link rel="home" href="../index.html" title="Contract++ 0.3.490">
+<link rel="up" href="../index.html" title="Contract++ 0.3.490">
+<link rel="prev" href="tutorial.html" title="Tutorial">
+<link rel="next" href="examples.html" title="Examples">
+</head>
+<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
+<table cellpadding="2" width="100%"><tr><td valign="top"></td></tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="tutorial.html"><img src="../images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../images/home.png" alt="Home"></a><a accesskey="n" href="examples.html"><img src="../images/next.png" alt="Next"></a>
+</div>
+<div class="section">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="contract__.without_the_macros"></a><a class="link" href="without_the_macros.html" title="Without the Macros">Without the Macros</a>
+</h2></div></div></div>
+<div class="toc"><dl>
+<dt><span class="section"><a href="without_the_macros.html#contract__.without_the_macros.an_example__without_the_macros_">An
+ Example (Without the Macros)</a></span></dt>
+<dt><span class="section"><a href="without_the_macros.html#contract__.without_the_macros.optional_contract_compilation">Optional
+ Contract Compilation</a></span></dt>
+<dt><span class="section">Assertions</span></dt>
+<dt><span class="section"><a href="without_the_macros.html#contract__.without_the_macros.augmented_state">Augmented
+ State</a></span></dt>
+<dt><span class="section"><a href="without_the_macros.html#contract__.without_the_macros.class_invariants">Class
+ Invariants</a></span></dt>
+<dt><span class="section"><a href="without_the_macros.html#contract__.without_the_macros.contracted_function">Contracted
+ Function</a></span></dt>
+<dt><span class="section">Preconditions</span></dt>
+<dt><span class="section">Postconditions</span></dt>
+<dt><span class="section">Body</span></dt>
+<dt><span class="section"><a href="without_the_macros.html#contract__.without_the_macros.contract_class">Contract
+ Class</a></span></dt>
+<dt><span class="section"><a href="without_the_macros.html#contract__.without_the_macros.static_member_functions">Static
+ Member Functions</a></span></dt>
+<dt><span class="section">Constructors</span></dt>
+<dt><span class="section">Destructors</span></dt>
+<dt><span class="section"><a href="without_the_macros.html#contract__.without_the_macros.non_member_functions">Non-Member
+ Functions</a></span></dt>
+<dt><span class="section"><a href="without_the_macros.html#contract__.without_the_macros.a_fully_working_example__without_the_macros_">A
+ Fully Working Example (Without the Macros)</a></span></dt>
+</dl></div>
+<p>
+ This section explains how to program contracts without using the library macros.
+ This is useful to better understand how the library actually implements Contract
+ Programming and to occasionally implement workarounds for compiler standard
+ compliance issues. However:
+ </p>
+<div class="important"><table border="0" summary="Important">
+<tr>
+<td rowspan="2" align="center" valign="top" width="25"><img alt="[Important]" src="../images/important.png"></td>
+<th align="left">Important</th>
+</tr>
+<tr><td align="left" valign="top">
+<p>
+ <span class="bold"><strong>Recommended to Use Contract Macros</strong></span>
+ </p>
+<p>
+ In general, it is recommended to write contracts using the library macros
+ because they save programmers from writing a significant amount of setup
+ code.
+ </p>
+</td></tr>
+</table></div>
+<p>
+ All the macros described in the <a class="link" href="tutorial.html" title="Tutorial">Tutorial</a>
+ section expand to code equivalent to the one explained in this section (with
+ the exception of block invariants and loop variants which are not covered here).
+ See also the Reference section for more
+ details.
+ </p>
+<div class="section">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="contract__.without_the_macros.an_example__without_the_macros_"></a><a class="link" href="without_the_macros.html#contract__.without_the_macros.an_example__without_the_macros_" title="An Example (Without the Macros)">An
+ Example (Without the Macros)</a>
+</h3></div></div></div>
+<p>
+ The following example shows how to write a contract for the vector <code class="computeroutput"><span class="identifier">push_back</span><span class="special">()</span></code>
+ function without using the contract macros:
+ </p>
+<pre class="programlisting"><span class="preprocessor">#include</span> <span class="string">"pushable.hpp"</span> <span class="comment">// Base class for subcontracting.</span>
+<span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">contract</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span> <span class="comment">// This library.</span>
+<span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">vector</span><span class="special">&gt;</span> <span class="comment">// STL vector.</span>
+
+<span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> <span class="identifier">T</span><span class="special">&gt;</span>
+<span class="keyword">class</span> <span class="identifier">myvector</span><span class="special">:</span> <span class="keyword">public</span> <span class="identifier">pushable</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">&gt;</span> <span class="special">{</span>
+
+<span class="preprocessor">#if</span> <span class="identifier">defined</span> <span class="identifier">CONTRACT_CHECK_CLASS_INVARIANT</span> <span class="special">||</span> <span class="comment">/* Support for */</span> <span class="special">\</span>
+ <span class="identifier">defined</span> <span class="identifier">CONTRACT_CHECK_PRECONDITION</span> <span class="special">||</span> <span class="comment">/* optional contract */</span> <span class="special">\</span>
+ <span class="identifier">defined</span> <span class="identifier">CONTRACT_CHECK_POSTCONDITION</span> <span class="comment">/* compilation. */</span>
+ <span class="comment">// Augmented state.</span>
+ <span class="keyword">friend</span> <span class="keyword">class</span> <span class="identifier">contract</span><span class="special">::</span><span class="identifier">state</span><span class="special">;</span>
+ <span class="keyword">mutable</span> <span class="identifier">contract</span><span class="special">::</span><span class="identifier">state</span> <span class="identifier">contract_state_</span><span class="special">;</span>
+<span class="preprocessor">#endif</span> <span class="comment">// contracts</span>
+
+<span class="preprocessor">#if</span> <span class="identifier">defined</span> <span class="identifier">CONTRACT_CHECK_CLASS_INVARIANT</span>
+ <span class="comment">// Static class invariants</span>
+ <span class="keyword">static</span> <span class="keyword">void</span> <span class="identifier">contract_static_invariant_</span><span class="special">(</span><span class="keyword">void</span><span class="special">)</span> <span class="special">{</span>
+ <span class="comment">// Assert nothing in this case.</span>
+ <span class="special">}</span>
+ <span class="comment">// Class invariants.</span>
+ <span class="keyword">void</span> <span class="identifier">contract_invariant_</span><span class="special">(</span><span class="keyword">void</span><span class="special">)</span> <span class="keyword">const</span> <span class="special">{</span>
+ <span class="keyword">if</span> <span class="special">(!((</span><span class="identifier">size</span><span class="special">()</span> <span class="special">==</span> <span class="number">0</span><span class="special">)</span> <span class="special">==</span> <span class="identifier">empty</span><span class="special">()))</span>
+ <span class="keyword">throw</span> <span class="identifier">contract</span><span class="special">::</span><span class="identifier">failure</span><span class="special">(</span><span class="identifier">__FILE__</span><span class="special">,</span> <span class="identifier">__LINE__</span><span class="special">);</span>
+ <span class="comment">// More invariants here...</span>
+ <span class="special">}</span>
+<span class="preprocessor">#endif</span> <span class="comment">// invariants</span>
+
+<span class="keyword">public</span><span class="special">:</span>
+ <span class="keyword">void</span> <span class="identifier">push_back</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">T</span><span class="special">&amp;</span> <span class="identifier">element</span><span class="special">)</span>
+<span class="preprocessor">#if</span> <span class="identifier">defined</span> <span class="identifier">CONTRACT_CHECK_CLASS_INVARIANT</span> <span class="special">||</span> <span class="special">\</span>
+ <span class="identifier">defined</span> <span class="identifier">CONTRACT_CHECK_PRECONDITION</span> <span class="special">||</span> <span class="special">\</span>
+ <span class="identifier">defined</span> <span class="identifier">CONTRACT_CHECK_POSTCONDITION</span>
+ <span class="comment">// Contracted function.</span>
+ <span class="special">{</span> <span class="identifier">contract_push_back_element_</span><span class="special">&lt;</span><span class="number">0</span><span class="special">&gt;().</span><span class="identifier">call</span><span class="special">(</span><span class="keyword">this</span> <span class="special">,</span> <span class="identifier">element</span><span class="special">);</span> <span class="special">}</span>
+<span class="keyword">private</span><span class="special">:</span> <span class="comment">// Private so not to alter user call public API.</span>
+<span class="preprocessor">#if</span> <span class="identifier">defined</span> <span class="identifier">CONTRACT_CHECK_PRECONDITION</span>
+ <span class="keyword">void</span> <span class="identifier">contract_precondition_push_back_element_</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">T</span><span class="special">&amp;</span> <span class="identifier">element</span><span class="special">)</span> <span class="keyword">const</span> <span class="special">{</span>
+ <span class="keyword">if</span> <span class="special">(!(</span><span class="identifier">size</span><span class="special">()</span> <span class="special">&lt;</span> <span class="identifier">max_size</span><span class="special">()))</span>
+ <span class="keyword">throw</span> <span class="identifier">contract</span><span class="special">::</span><span class="identifier">failure</span><span class="special">(</span><span class="identifier">__FILE__</span><span class="special">,</span> <span class="identifier">__LINE__</span><span class="special">);</span>
+ <span class="comment">// More preconditions here...</span>
+ <span class="special">}</span>
+<span class="preprocessor">#endif</span> <span class="comment">// preconditions</span>
+<span class="preprocessor">#if</span> <span class="identifier">defined</span> <span class="identifier">CONTRACT_CHECK_POSTCONDITION</span>
+ <span class="keyword">void</span> <span class="identifier">contract_postcondition_push_back_element_</span><span class="special">(</span>
+ <span class="keyword">const</span> <span class="identifier">myvector</span><span class="special">*</span> <span class="identifier">old_this</span><span class="special">,</span> <span class="comment">// Old value for object.</span>
+ <span class="keyword">const</span> <span class="identifier">T</span><span class="special">&amp;</span> <span class="identifier">element</span><span class="special">,</span> <span class="identifier">contract</span><span class="special">::</span><span class="identifier">noold</span> <span class="comment">// No old for `element` argument.</span>
+ <span class="special">)</span> <span class="keyword">const</span> <span class="special">{</span>
+ <span class="keyword">if</span> <span class="special">(!(</span><span class="identifier">size</span><span class="special">()</span> <span class="special">==</span> <span class="special">(</span><span class="identifier">old_this</span><span class="special">-&gt;</span><span class="identifier">size</span><span class="special">()</span> <span class="special">+</span> <span class="number">1</span><span class="special">)))</span>
+ <span class="keyword">throw</span> <span class="identifier">contract</span><span class="special">::</span><span class="identifier">failure</span><span class="special">(</span><span class="identifier">__FILE__</span><span class="special">,</span> <span class="identifier">__LINE__</span><span class="special">);</span>
+ <span class="comment">// More postconditions here...</span>
+ <span class="special">}</span>
+<span class="preprocessor">#endif</span> <span class="comment">// postconditions</span>
+<span class="keyword">protected</span><span class="special">:</span> <span class="comment">// Must be protected (not private) to allow subcontracting.</span>
+ <span class="keyword">void</span> <span class="identifier">contract_body_push_back_</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">T</span><span class="special">&amp;</span> <span class="identifier">element</span><span class="special">)</span>
+<span class="preprocessor">#endif</span> <span class="comment">// contracts</span>
+ <span class="comment">// Original function definition (the body).</span>
+ <span class="special">{</span> <span class="identifier">vector_</span><span class="special">.</span><span class="identifier">push_back</span><span class="special">(</span><span class="identifier">element</span><span class="special">);</span> <span class="special">}</span>
+<span class="preprocessor">#if</span> <span class="identifier">defined</span> <span class="identifier">CONTRACT_CHECK_CLASS_INVARIANT</span> <span class="special">||</span> <span class="special">\</span>
+ <span class="identifier">defined</span> <span class="identifier">CONTRACT_CHECK_PRECONDITION</span> <span class="special">||</span> <span class="special">\</span>
+ <span class="identifier">defined</span> <span class="identifier">CONTRACT_CHECK_POSTCONDITION</span>
+ <span class="comment">// Contract class.</span>
+ <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">int</span> <span class="identifier">ZERO</span><span class="special">&gt;</span>
+ <span class="keyword">struct</span> <span class="identifier">contract_push_back_element_</span><span class="special">:</span> <span class="identifier">contract</span><span class="special">::</span><span class="identifier">nonstatic_member_function</span><span class="special">&lt;</span>
+ <span class="comment">// Function type for contracted function.</span>
+ <span class="comment">// Copyable class type for old object value in postconditions.</span>
+ <span class="comment">// For constant members use `myvector const` instead of `myvector`.</span>
+ <span class="keyword">void</span> <span class="special">(</span><span class="identifier">contract</span><span class="special">::</span><span class="identifier">copyable</span><span class="special">&lt;</span><span class="identifier">myvector</span><span class="special">&gt;*,</span> <span class="keyword">const</span> <span class="identifier">T</span><span class="special">&amp;),</span>
+ <span class="comment">// Base contract class for subcontracting.</span>
+ <span class="keyword">typename</span> <span class="identifier">pushable</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">&gt;::</span><span class="keyword">template</span> <span class="identifier">contract_push_back_element_</span><span class="special">&lt;</span><span class="number">0</span><span class="special">&gt;</span>
+ <span class="special">&gt;</span> <span class="special">{</span>
+ <span class="comment">// Constructor specifies body, preconditions, and postconditions.</span>
+ <span class="identifier">contract_push_back_element_</span><span class="special">():</span> <span class="identifier">contract</span><span class="special">::</span><span class="identifier">static_member_function</span><span class="special">&lt;</span>
+ <span class="keyword">void</span> <span class="special">(</span><span class="identifier">contract</span><span class="special">::</span><span class="identifier">copyable</span><span class="special">&lt;</span><span class="identifier">myvector</span><span class="special">&gt;*,</span> <span class="keyword">const</span> <span class="identifier">T</span><span class="special">&amp;),</span>
+ <span class="keyword">typename</span> <span class="identifier">pushable</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">&gt;::</span><span class="keyword">template</span> <span class="identifier">contract_push_back_element_</span><span class="special">&lt;</span><span class="number">0</span><span class="special">&gt;</span>
+ <span class="special">&gt;(</span> <span class="special">&amp;</span><span class="identifier">myvector</span><span class="special">::</span><span class="identifier">contract_body_push_back_</span>
+<span class="preprocessor">#if</span> <span class="identifier">defined</span> <span class="identifier">CONTRACT_CHECK_PRECONDITION</span>
+ <span class="special">,</span> <span class="special">&amp;</span><span class="identifier">myvector</span><span class="special">::</span><span class="identifier">contract_precondition_push_back_element_</span>
+<span class="preprocessor">#endif</span> <span class="comment">// preconditions</span>
+<span class="preprocessor">#if</span> <span class="identifier">defined</span> <span class="identifier">CONTRACT_CHECK_POSTCONDITION</span>
+ <span class="special">,</span> <span class="special">&amp;</span><span class="identifier">myvector</span><span class="special">::</span><span class="identifier">contract_postcondition_push_back_element_</span>
+<span class="preprocessor">#endif</span> <span class="comment">// postconditions</span>
+ <span class="special">)</span> <span class="special">{}</span>
+ <span class="special">};</span>
+<span class="keyword">public</span><span class="special">:</span> <span class="comment">// Restore original access level.</span>
+<span class="preprocessor">#endif</span> <span class="comment">// contracts</span>
+
+ <span class="special">...</span> <span class="comment">// Rest of the class.</span>
+
+<span class="keyword">private</span><span class="special">:</span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">vector</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">&gt;</span> <span class="identifier">vector_</span><span class="special">;</span>
+<span class="special">};</span>
+</pre>
+<p>
+ Let's take a close look at this code.
+ </p>
+</div>
+<div class="section">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="contract__.without_the_macros.optional_contract_compilation"></a><a class="link" href="without_the_macros.html#contract__.without_the_macros.optional_contract_compilation" title="Optional Contract Compilation">Optional
+ Contract Compilation</a>
+</h3></div></div></div>
+<p>
+ First of all, note that when programmers completely disable contract compilation
+ by not #defining any of the <code class="computeroutput">CONTRACT_CHECK_CLASS_INVARIANT</code>,
+ <code class="computeroutput">CONTRACT_CHECK_PRECONDITION</code>,
+ and <code class="computeroutput">CONTRACT_CHECK_POSTCONDITION</code>
+ macro symbols, the code above reduces to just the function declaration and
+ its definition without <span class="bold"><strong>any</strong></span> contract code
+ overhead:
+ </p>
+<pre class="programlisting"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> <span class="identifier">T</span><span class="special">&gt;</span>
+<span class="keyword">class</span> <span class="identifier">myvector</span> <span class="special">{</span>
+
+ <span class="bold"><strong>// Augmented state and class invariants disappear!</strong></span>
+
+<span class="keyword">public</span><span class="special">:</span>
+ <span class="keyword">void</span> <span class="identifier">push_back</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">T</span><span class="special">&amp;</span> <span class="identifier">value</span><span class="special">)</span>
+ <span class="bold"><strong>// Preconditions, postconditions, and body functions disappear!</strong></span>
+ <span class="special">{</span>
+ <span class="identifier">vector_</span><span class="special">.</span><span class="identifier">push_back</span><span class="special">(</span><span class="identifier">value</span><span class="special">);</span> <span class="comment">// Original function implementation.</span>
+ <span class="special">}</span>
+ <span class="bold"><strong>// Contract class disappears!</strong></span>
+<span class="keyword">public</span><span class="special">:</span>
+
+ <span class="special">...</span>
+<span class="keyword">private</span><span class="special">:</span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">vector</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">&gt;</span> <span class="identifier">vector_</span><span class="special">;</span>
+<span class="special">};</span>
+</pre>
+<p>
+ Note how the <code class="computeroutput">CONTRACT_CHECK_CLASS_INVARIANT</code>,
+ <code class="computeroutput">CONTRACT_CHECK_PRECONDITION</code>,
+ and <code class="computeroutput">CONTRACT_CHECK_POSTCONDITION</code>
+ macros can be #defined independently to selectively turn on or off the compilation
+ of class invariants only, preconditions only, postconditions only, or any
+ combination of the above.
+ </p>
+<p>
+ The rest of this section illustrates what happens when contract compilation
+ is turned on. Therefore, from here on, we will assume that <code class="computeroutput">CONTRACT_CHECK_CLASS_INVARIANT</code>
+ , <code class="computeroutput">CONTRACT_CHECK_PRECONDITION</code>,
+ and <code class="computeroutput">CONTRACT_CHECK_POSTCONDITION</code>
+ are all #defined.
+ </p>
+</div>
+<div class="section">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="contract__.without_the_macros.assertions"></a><a class="link" href="without_the_macros.html#contract__.without_the_macros.assertions" title="Assertions">Assertions</a>
+</h3></div></div></div>
+<p>
+ Note how class invariants, preconditions, and postconditions are asserted
+ using an <code class="computeroutput"><span class="keyword">if</span></code>-statement that throws
+ a <code class="computeroutput"><span class="identifier">contract</span><span class="special">::</span>failure</code> exception in case the
+ checked boolean condition is false (note the leading <code class="computeroutput"><span class="string">"!"</span></code>
+ within the <code class="computeroutput"><span class="keyword">if</span></code>-condition):
+ </p>
+<pre class="programlisting"><span class="comment">// Code from the non-static class invariants (but similar for</span>
+<span class="comment">// static class invariants, preconditions, and postconditions).</span>
+<span class="keyword">if</span> <span class="special">(</span><span class="bold"><strong>!</strong></span><span class="special">((</span><span class="identifier">size</span><span class="special">()</span> <span class="special">==</span> <span class="number">0</span><span class="special">)</span> <span class="special">==</span> <span class="identifier">empty</span><span class="special">()))</span>
+ <span class="keyword">throw</span> <span class="identifier">contract</span><span class="special">::</span><span class="identifier">failure</span><span class="special">(</span><span class="identifier">__FILE__</span><span class="special">,</span> <span class="identifier">__LINE__</span><span class="special">);</span>
+</pre>
+<p>
+ When an exception (<span class="emphasis"><em>any</em></span> exception) is thrown from within
+ class invariants, preconditions, or postconditions code blocks, the library
+ will handle the exception invoking the relative <code class="computeroutput"><span class="identifier">contract</span><span class="special">::</span>class_invariant_failed<span class="special">()</span></code>, <code class="computeroutput"><span class="identifier">contract</span><span class="special">::</span>precondition_failed<span class="special">()</span></code>, or <code class="computeroutput"><span class="identifier">contract</span><span class="special">::</span>postcondition_failed<span class="special">()</span></code> function (but only if that is necessary
+ according to subcontracting rules, see below). Therefore, the fact that the
+ contract condition check throws <code class="computeroutput"><span class="identifier">contract</span><span class="special">::</span>failure</code>
+ does <span class="emphasis"><em>not</em></span> necessarily imply that the program itself will
+ throw but only that the correct contract failure handler function will be
+ invoked by the library. All contract failure handler functions terminate
+ by default but they can be customized (see <a class="link" href="throw_on_failure.html" title="Annex: Throw on Failure">Throw
+ on Failure</a> for an example).
+ </p>
+<p>
+ It is not possible to directly call <code class="computeroutput"><span class="identifier">contract</span><span class="special">::</span>class_invariant_failed<span class="special">()</span></code>, <code class="computeroutput"><span class="identifier">contract</span><span class="special">::</span>precondition_failed<span class="special">()</span></code>, or <code class="computeroutput"><span class="identifier">contract</span><span class="special">::</span>postcondition_failed<span class="special">()</span></code> instead of throwing the exception because
+ of subcontracting. For example, if a precondition of a derived contract fails
+ but the preconditions of an overridden contract hold true then the library
+ will <span class="emphasis"><em>not</em></span> call <code class="computeroutput"><span class="identifier">contract</span><span class="special">::</span>precondition_failed<span class="special">()</span></code> even if the derived contract throws an
+ exception (as specified by subcontracting requirements in <a class="link" href="tutorial.html#contract__.tutorial.contract_programming_overview.member_function_call_semantics">Member
+ Function Call Semantics</a>).
+ </p>
+<p>
+ The first two arguments of the <code class="computeroutput"><span class="identifier">contract</span><span class="special">::</span>failure</code>
+ constructor are mandatory and they specify file name and line number of the
+ assertion (used the C++ macros <code class="computeroutput"><span class="identifier">__FILE__</span></code>
+ and <code class="computeroutput"><span class="identifier">__LINE__</span></code>). The third
+ argument of the constructor is an optional human readable description of
+ the asserted condition. For example:
+ </p>
+<pre class="programlisting"><span class="comment">// More verbose error message with .</span>
+<span class="keyword">if</span> <span class="special">(!((</span><span class="identifier">size</span><span class="special">()</span> <span class="special">==</span> <span class="number">0</span><span class="special">)</span> <span class="special">==</span> <span class="identifier">empty</span><span class="special">()))</span>
+ <span class="keyword">throw</span> <span class="identifier">contract</span><span class="special">::</span><span class="identifier">failure</span><span class="special">(</span><span class="identifier">__FILE__</span><span class="special">,</span> <span class="identifier">__LINE__</span><span class="special">,</span> <span class="string">"size zero iff empty"</span><span class="special">);</span>
+</pre>
+<p>
+ All this information is simply used to provide the user with a descriptive
+ error message in case of a contract failure, for example:
+ </p>
+<pre class="programlisting">class invariant: terminate called after throwing an instance of 'contract::failure'
+ what(): contract "size zero iff empty" failed at myvector_nomacros.cpp:37
+Aborted
+</pre>
+</div>
+<div class="section">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="contract__.without_the_macros.augmented_state"></a><a class="link" href="without_the_macros.html#contract__.without_the_macros.augmented_state" title="Augmented State">Augmented
+ State</a>
+</h3></div></div></div>
+<p>
+ This library needs to declare an additional member variable for the class.
+ This member variable is mainly used by the library to keep track of when
+ contracts are being checked so to disable assertion checking in nested member
+ function calls that could otherwise result in infinite recursion (this a
+ common requirement in Contract Programming).
+ </p>
+<pre class="programlisting"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> <span class="identifier">T</span><span class="special">&gt;</span>
+<span class="keyword">class</span> <span class="identifier">myvector</span><span class="special">:</span> <span class="keyword">public</span> <span class="identifier">pushable</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">&gt;</span> <span class="special">{</span>
+
+ <span class="comment">// Augmented state.</span>
+ <span class="keyword">friend</span> <span class="keyword">class</span> <span class="identifier">contract</span><span class="special">::</span><span class="identifier">state</span><span class="special">;</span>
+ <span class="keyword">mutable</span> <span class="identifier">contract</span><span class="special">::</span><span class="identifier">state</span> <span class="identifier">contract_state_</span><span class="special">;</span>
+
+ <span class="special">...</span>
+<span class="special">};</span>
+</pre>
+<p>
+ The state member variable must be declared of <code class="computeroutput"><span class="keyword">mutable</span></code>
+ type <code class="computeroutput"><span class="identifier">contract</span><span class="special">::</span>state</code> (so the library can modify
+ it while still ensuring constant-correctness for the contracts), it should
+ be in a private section of the class (so not to alter the class public API),
+ and it must have the predefined name <code class="computeroutput">contract_state_</code>
+ (so the library knows how to access it). Furthermore, the <code class="computeroutput"><span class="identifier">contract</span><span class="special">::</span>state</code>
+ class type must be declared a friend so the library can internally access
+ the entire user class including its private and protected members.
+ </p>
+<p>
+ The details of the <code class="computeroutput"><span class="identifier">contract</span><span class="special">::</span>state</code>
+ type are library implementation specific. The state variable name begins
+ with the <code class="computeroutput"><span class="identifier">contract</span></code> prefix
+ and ends with an underscore "<code class="computeroutput"><span class="identifier">_</span></code>"
+ so programmers should never directly use it in user code (see <a class="link" href="getting_started.html" title="Getting Started">Getting
+ Started</a>).
+ </p>
+</div>
+<div class="section">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="contract__.without_the_macros.class_invariants"></a><a class="link" href="without_the_macros.html#contract__.without_the_macros.class_invariants" title="Class Invariants">Class
+ Invariants</a>
+</h3></div></div></div>
+<p>
+ This library checks static and non-static class invariants invoking a static
+ and a constant member function with the predefined names <code class="computeroutput">contract_static_invariant_</code>
+ and <code class="computeroutput"><span class="identifier">__contract_invariant__</span></code>
+ respectively:
+ </p>
+<pre class="programlisting"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> <span class="identifier">T</span><span class="special">&gt;</span>
+<span class="keyword">class</span> <span class="identifier">myvector</span><span class="special">:</span> <span class="keyword">public</span> <span class="identifier">pushable</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">&gt;</span> <span class="special">{</span>
+ <span class="special">...</span>
+
+ <span class="comment">// Static class invariants</span>
+ <span class="keyword">static</span> <span class="keyword">void</span> <span class="identifier">contract_static_invariant_</span><span class="special">(</span><span class="keyword">void</span><span class="special">)</span> <span class="special">{</span>
+ <span class="comment">// Assert nothing in this case.</span>
+ <span class="special">}</span>
+ <span class="comment">// Class invariants.</span>
+ <span class="keyword">void</span> <span class="identifier">contract_invariant_</span><span class="special">(</span><span class="keyword">void</span><span class="special">)</span> <span class="keyword">const</span> <span class="special">{</span>
+ <span class="keyword">if</span> <span class="special">(!((</span><span class="identifier">size</span><span class="special">()</span> <span class="special">==</span> <span class="number">0</span><span class="special">)</span> <span class="special">==</span> <span class="identifier">empty</span><span class="special">()))</span>
+ <span class="keyword">throw</span> <span class="identifier">contract</span><span class="special">::</span><span class="identifier">failure</span><span class="special">(</span><span class="identifier">__FILE__</span><span class="special">,</span> <span class="identifier">__LINE__</span><span class="special">);</span>
+ <span class="comment">// More invariants here...</span>
+ <span class="special">}</span>
+
+ <span class="special">...</span>
+<span class="special">};</span>
+</pre>
+<p>
+ The non-static class invariant function must a constant member so to enforce
+ contract checking constant-correctness. The static class invariants function
+ is static so it cannot change the object state because it cannot access the
+ object (static member functions cannot be constant).
+ </p>
+<p>
+ The class invariant function names begin with the <code class="computeroutput"><span class="identifier">contract</span></code>
+ prefix and end with an underscore "<code class="computeroutput"><span class="identifier">_</span></code>"
+ so programmers should never directly use it in user code (see <a class="link" href="getting_started.html" title="Getting Started">Getting
+ Started</a>).
+ </p>
+</div>
+<div class="section">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="contract__.without_the_macros.contracted_function"></a><a class="link" href="without_the_macros.html#contract__.without_the_macros.contracted_function" title="Contracted Function">Contracted
+ Function</a>
+</h3></div></div></div>
+<p>
+ The <code class="computeroutput"><span class="identifier">push_back</span><span class="special">()</span></code>
+ function is programmed to construct the <code class="computeroutput"><span class="identifier">contract</span></code>
+ object and to invoke its <code class="computeroutput">call<span class="special">()</span></code> member function:
+ </p>
+<pre class="programlisting"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> <span class="identifier">T</span><span class="special">&gt;</span>
+<span class="keyword">class</span> <span class="identifier">myvector</span><span class="special">:</span> <span class="keyword">public</span> <span class="identifier">pushable</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">&gt;</span> <span class="special">{</span>
+ <span class="special">...</span>
+
+<span class="keyword">public</span><span class="special">:</span>
+ <span class="keyword">void</span> <span class="identifier">push_back</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">T</span><span class="special">&amp;</span> <span class="identifier">element</span><span class="special">)</span>
+ <span class="comment">// Contracted function.</span>
+ <span class="special">{</span>
+ <span class="identifier">contract_push_back_element_</span><span class="special">&lt;</span><span class="number">0</span><span class="special">&gt;().</span><span class="identifier">call</span><span class="special">(</span><span class="keyword">this</span> <span class="special">,</span> <span class="identifier">element</span><span class="special">);</span>
+ <span class="special">}</span>
+
+ <span class="special">...</span>
+<span class="special">};</span>
+</pre>
+<p>
+ The <code class="computeroutput">call<span class="special">()</span></code> function takes in input a pointer to the
+ object (<code class="computeroutput"><span class="keyword">this</span></code>) and the function
+ arguments (just <code class="computeroutput"><span class="identifier">element</span></code> in
+ this example) in the order they appear in the function declaration.
+ </p>
+<p>
+ The <code class="computeroutput">call<span class="special">()</span></code> function is the one implementing the correct
+ Contract Programming call semantics (see <a class="link" href="tutorial.html#contract__.tutorial.contract_programming_overview.member_function_call_semantics">Member
+ Function Call Semantics</a>). In this case, <code class="computeroutput">call<span class="special">()</span></code> checks class invariants and preconditions
+ (calling <code class="computeroutput">contract_static_invariant_<span class="special">()</span></code>, <code class="computeroutput">contract_invariant_<span class="special">()</span></code>, and the precondition
+ function, see below), then it executes the body, and lastly it checks class
+ invariants and postconditions (calling <code class="computeroutput">contract_static_invariant_<span class="special">()</span></code>, <code class="computeroutput">contract_invariant_<span class="special">()</span></code>, and the postcondition
+ function, see below).
+ </p>
+</div>
+<div class="section">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="contract__.without_the_macros.preconditions"></a><a class="link" href="without_the_macros.html#contract__.without_the_macros.preconditions" title="Preconditions">Preconditions</a>
+</h3></div></div></div>
+<p>
+ A member function is defined to check the preconditions:
+ </p>
+<pre class="programlisting"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> <span class="identifier">T</span><span class="special">&gt;</span>
+<span class="keyword">class</span> <span class="identifier">myvector</span><span class="special">:</span> <span class="keyword">public</span> <span class="identifier">pushable</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">&gt;</span> <span class="special">{</span>
+ <span class="special">...</span>
+
+<span class="keyword">private</span><span class="special">:</span>
+ <span class="keyword">void</span> <span class="identifier">contract_precondition_push_back_element_</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">T</span><span class="special">&amp;</span> <span class="identifier">element</span><span class="special">)</span> <span class="keyword">const</span> <span class="special">{</span>
+ <span class="keyword">if</span> <span class="special">(!(</span><span class="identifier">size</span><span class="special">()</span> <span class="special">&lt;</span> <span class="identifier">max_size</span><span class="special">()))</span>
+ <span class="keyword">throw</span> <span class="identifier">contract</span><span class="special">::</span><span class="identifier">failure</span><span class="special">(</span><span class="identifier">__FILE__</span><span class="special">,</span> <span class="identifier">__LINE__</span><span class="special">);</span>
+ <span class="comment">// More preconditions here...</span>
+ <span class="special">}</span>
+
+ <span class="special">...</span>
+<span class="special">};</span>
+</pre>
+<p>
+ Note the followings:
+ </p>
+<div class="itemizedlist"><ul class="itemizedlist" type="disc">
+<li class="listitem">
+ The precondition function is private so not to alter the user class public
+ API.
+ </li>
+<li class="listitem">
+ In order to support contracts for overloaded functions, the precondition
+ function name must contain the contracted function name, the name of
+ all arguments, and the trailing cv-qualifier if the contracted function
+ is cv-qualified (similarly to the contract class name, see below).
+ </li>
+<li class="listitem">
+ The precondition function must be a constant member plus all its arguments
+ must be constant so to enforce contract constant-correctness.
+ </li>
+<li class="listitem">
+ The precondition function must be <code class="computeroutput"><span class="keyword">volatile</span></code>
+ if the contracted function is <code class="computeroutput"><span class="keyword">volatile</span></code>.
+ </li>
+<li class="listitem">
+ The precondition function arguments are constant references to the contracted
+ function arguments.
+ </li>
+</ul></div>
+<p>
+ The precondition function name begins with the <code class="computeroutput"><span class="identifier">contract</span></code>
+ prefix and ends with an underscore "<code class="computeroutput"><span class="identifier">_</span></code>"
+ so programmers should never directly use it in user code (see <a class="link" href="getting_started.html" title="Getting Started">Getting
+ Started</a>).
+ </p>
+</div>
+<div class="section">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="contract__.without_the_macros.postconditions"></a><a class="link" href="without_the_macros.html#contract__.without_the_macros.postconditions" title="Postconditions">Postconditions</a>
+</h3></div></div></div>
+<p>
+ A member function is defined to check the postconditions:
+ </p>
+<pre class="programlisting"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> <span class="identifier">T</span><span class="special">&gt;</span>
+<span class="keyword">class</span> <span class="identifier">myvector</span><span class="special">:</span> <span class="keyword">public</span> <span class="identifier">pushable</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">&gt;</span> <span class="special">{</span>
+
+<span class="keyword">private</span><span class="special">:</span>
+ <span class="special">...</span> <span class="comment">// Preconditions.</span>
+ <span class="keyword">void</span> <span class="identifier">contract_postcondition_push_back_element_</span><span class="special">(</span>
+ <span class="keyword">const</span> <span class="identifier">myvector</span><span class="special">*</span> <span class="identifier">old_this</span><span class="special">,</span> <span class="comment">// Old value for object.</span>
+ <span class="keyword">const</span> <span class="identifier">T</span><span class="special">&amp;</span> <span class="identifier">element</span><span class="special">,</span> <span class="identifier">contract</span><span class="special">::</span><span class="identifier">noold</span> <span class="comment">// No old for `element` argument.</span>
+ <span class="special">)</span> <span class="keyword">const</span> <span class="special">{</span>
+ <span class="keyword">if</span> <span class="special">(!(</span><span class="identifier">size</span><span class="special">()</span> <span class="special">==</span> <span class="special">(</span><span class="identifier">old_this</span><span class="special">-&gt;</span><span class="identifier">size</span><span class="special">()</span> <span class="special">+</span> <span class="number">1</span><span class="special">)))</span>
+ <span class="keyword">throw</span> <span class="identifier">contract</span><span class="special">::</span><span class="identifier">failure</span><span class="special">(</span><span class="identifier">__FILE__</span><span class="special">,</span> <span class="identifier">__LINE__</span><span class="special">);</span>
+ <span class="comment">// More postconditions here...</span>
+ <span class="special">}</span>
+
+ <span class="special">...</span>
+<span class="special">};</span>
+</pre>
+<p>
+ Note the followings:
+ </p>
+<div class="itemizedlist"><ul class="itemizedlist" type="disc">
+<li class="listitem">
+ The postcondition function is private so not to alter the user class
+ public API.
+ </li>
+<li class="listitem">
+ In order to support contracts for overloaded functions, the postcondition
+ function name must contain the contracted function name, the name of
+ all arguments, and the trailing cv-qualifier if the contracted function
+ is cv-qualified (similarly to the contract class name, see below).
+ </li>
+<li class="listitem">
+ The postcondition function must be a constant member plus all its arguments
+ must be constant so to enforce contract constant-correctness.
+ </li>
+<li class="listitem">
+ The precondition function must be <code class="computeroutput"><span class="keyword">volatile</span></code>
+ if the contracted function is <code class="computeroutput"><span class="keyword">volatile</span></code>.
+ </li>
+<li class="listitem">
+ The first postcondition function argument is a constant pointer to the
+ object old value when the class type is tagged <code class="computeroutput"><span class="identifier">contract</span><span class="special">::</span>copyable</code>
+ within the contract class (see below), otherwise it is of type <code class="computeroutput"><span class="identifier">contract</span><span class="special">::</span><span class="identifier">noold</span></code>.
+ </li>
+<li class="listitem">
+ The remaining postcondition function arguments are constant references
+ to the contracted function argument current and old values. A function
+ argument old value is different from <code class="computeroutput"><span class="identifier">contract</span><span class="special">::</span><span class="identifier">nold</span></code>
+ only if the argument type is tagged <code class="computeroutput"><span class="identifier">contract</span><span class="special">::</span>copyable</code>
+ within the contract class (see below).
+ </li>
+<li class="listitem">
+ Finally, for non-void contracted functions, there is an extra argument
+ at the very end of the postcondition function argument list which is
+ a constant reference to the function result value being returned.
+ </li>
+</ul></div>
+<p>
+ The <code class="computeroutput"><span class="identifier">contract</span><span class="special">::</span><span class="identifier">noold</span></code> type is used as a "placeholder"
+ for an argument when its old value is <span class="emphasis"><em>not</em></span> provided in
+ the postconditions. An <code class="computeroutput"><span class="identifier">contract</span><span class="special">::</span><span class="identifier">noold</span></code>
+ argument cannot be mistakenly accessed or manipulated by programmers because
+ <code class="computeroutput"><span class="identifier">contract</span><span class="special">::</span><span class="identifier">noold</span></code> is an empty class with no member
+ at all. Furthermore, copying <code class="computeroutput"><span class="identifier">contract</span><span class="special">::</span><span class="identifier">noold</span></code>
+ performs no operation so <code class="computeroutput"><span class="identifier">contract</span><span class="special">::</span><span class="identifier">noold</span></code>
+ arguments can be passed to the postcondition function by value but without
+ adding any run-time overhead. This ensures that programmers can only access
+ old values in postconditions for types that are tagged <code class="computeroutput"><span class="identifier">contract</span><span class="special">::</span>copyable</code>.
+ </p>
+<p>
+ This is an example where the old value is provided for both the object and
+ one of the function arguments:
+ </p>
+<pre class="programlisting"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> <span class="identifier">T</span><span class="special">&gt;</span>
+<span class="keyword">class</span> <span class="identifier">myvector</span><span class="special">:</span> <span class="keyword">public</span> <span class="identifier">pushable</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">&gt;</span> <span class="special">{</span>
+ <span class="special">...</span>
+
+<span class="keyword">public</span><span class="special">:</span>
+ <span class="identifier">iterator</span> <span class="identifier">insert</span><span class="special">(</span><span class="identifier">iterator</span> <span class="identifier">where</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">T</span><span class="special">&amp;</span> <span class="identifier">element</span><span class="special">)</span>
+ <span class="special">...</span>
+ <span class="keyword">void</span> <span class="identifier">contract_postcondition_insert_insert_where_element_</span><span class="special">(</span>
+ <span class="keyword">const</span> <span class="identifier">myvector</span><span class="special">*</span> <span class="identifier">old_this</span><span class="special">,</span> <span class="comment">// Old value for object.</span>
+ <span class="keyword">const</span> <span class="identifier">iterator</span><span class="special">&amp;</span> <span class="identifier">where</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">iterator</span><span class="special">&amp;</span> <span class="identifier">old_where</span><span class="special">,</span> <span class="comment">// Old value for `where`.</span>
+
+ <span class="keyword">const</span> <span class="identifier">T</span><span class="special">&amp;</span> <span class="identifier">element</span><span class="special">,</span> <span class="identifier">contract</span><span class="special">::</span><span class="identifier">noold</span><span class="special">,</span> <span class="comment">// No old for `element` argument.</span>
+ <span class="keyword">const</span> <span class="identifier">iterator</span><span class="special">&amp;</span> <span class="identifier">result</span> <span class="comment">// Result value.</span>
+ <span class="special">)</span> <span class="keyword">const</span> <span class="special">{</span>
+ <span class="special">...</span> <span class="comment">// Assert postconditions using `old_this` and `old_where`.</span>
+ <span class="special">}</span>
+ <span class="special">...</span> <span class="comment">// Both class type and `where` type are tagged `contract::copyable`.</span>
+ <span class="comment">// in the contract class (see below).</span>
+
+ <span class="special">...</span>
+<span class="special">};</span>
+</pre>
+<p>
+ The postcondition function name begins with the <code class="computeroutput"><span class="identifier">contract</span></code>
+ prefix and ends with an underscore "<code class="computeroutput"><span class="identifier">_</span></code>"
+ so programmers should never directly use it in user code (see <a class="link" href="getting_started.html" title="Getting Started">Getting
+ Started</a>).
+ </p>
+</div>
+<div class="section">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="contract__.without_the_macros.body"></a><a class="link" href="without_the_macros.html#contract__.without_the_macros.body" title="Body">Body</a>
+</h3></div></div></div>
+<p>
+ A member function is declared as the body function and it is defined to be
+ the original function implementation as specified by the user:
+ </p>
+<pre class="programlisting"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> <span class="identifier">T</span><span class="special">&gt;</span>
+<span class="keyword">class</span> <span class="identifier">myvector</span><span class="special">:</span> <span class="keyword">public</span> <span class="identifier">pushable</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">&gt;</span> <span class="special">{</span>
+ <span class="special">...</span>
+
+<span class="keyword">protected</span><span class="special">:</span>
+ <span class="keyword">void</span> <span class="identifier">contract_body_push_back_</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">T</span><span class="special">&amp;</span> <span class="identifier">element</span><span class="special">)</span>
+ <span class="comment">// Original function definition (the body).</span>
+ <span class="special">{</span>
+ <span class="identifier">vector_</span><span class="special">.</span><span class="identifier">push_back</span><span class="special">(</span><span class="identifier">element</span><span class="special">);</span>
+ <span class="special">}</span>
+
+ <span class="special">...</span>
+<span class="special">};</span>
+</pre>
+<p>
+ Note the followings:
+ </p>
+<div class="itemizedlist"><ul class="itemizedlist" type="disc">
+<li class="listitem">
+ The body function is protected to avoid changing the user's class public
+ API but it cannot be private to allow for subcontracting of pure virtual
+ functions.
+ </li>
+<li class="listitem">
+ The body function declaration and definition must be <span class="emphasis"><em>exactly</em></span>
+ the ones specified by the user for the original <code class="computeroutput"><span class="identifier">push_back</span><span class="special">()</span></code> function (only the function name is
+ different). For example, if the original function is declared <code class="computeroutput"><span class="keyword">virtual</span></code>, the body function should be declared
+ <code class="computeroutput"><span class="keyword">virtual</span></code> as well. Also the
+ body function signature (return type, argument type, argument names,
+ eventual cv-qualifier, etc) must match exactly the signature of the original
+ <code class="computeroutput"><span class="identifier">push_back</span><span class="special">()</span></code>
+ function.
+ </li>
+</ul></div>
+<p>
+ The body function name begins with the <code class="computeroutput"><span class="identifier">contract</span></code>
+ prefix and ends with an underscore "<code class="computeroutput"><span class="identifier">_</span></code>"
+ so programmers should never directly use it in user code (see <a class="link" href="getting_started.html" title="Getting Started">Getting
+ Started</a>).
+ </p>
+<a name="contract__.without_the_macros.body.separating_the_definition"></a><h6>
+<a name="contract__.without_the_macros.body.separating_the_definition-heading"></a>
+ <a class="link" href="without_the_macros.html#contract__.without_the_macros.body.separating_the_definition">Separating
+ the Definition</a>
+ </h6>
+<p>
+ In this example, the body function definition <code class="computeroutput"><span class="special">{</span>
+ <span class="identifier">vector_</span><span class="special">.</span><span class="identifier">push_back</span><span class="special">(</span><span class="identifier">element</span><span class="special">);</span> <span class="special">}</span></code> is specified together with the body function
+ declaration. However, following C++ usual syntax, programmers can define
+ the body function to be "<code class="computeroutput"><span class="special">;</span></code>"
+ in order to separate the function definition from its declaration:
+ </p>
+<pre class="programlisting"><span class="comment">// Declarations (usually in header files).</span>
+
+<span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> <span class="identifier">T</span><span class="special">&gt;</span>
+<span class="keyword">class</span> <span class="identifier">myvector</span><span class="special">:</span> <span class="keyword">public</span> <span class="identifier">pushable</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">&gt;</span> <span class="special">{</span>
+ <span class="special">...</span>
+
+<span class="keyword">protected</span><span class="special">:</span>
+ <span class="keyword">void</span> <span class="identifier">contract_body_push_back_</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">T</span><span class="special">&amp;</span> <span class="identifier">element</span><span class="special">)</span>
+ <span class="bold"><strong>;</strong></span> <span class="comment">// Separating body definition using `;`.</span>
+
+ <span class="special">...</span>
+<span class="special">};</span>
+
+<span class="comment">// Separated definitions (eventually in a different file).</span>
+
+<span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> <span class="identifier">T</span><span class="special">&gt;</span>
+<span class="keyword">void</span> <span class="identifier">myvector</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">&gt;::</span>
+<span class="preprocessor">#if</span> <span class="identifier">defined</span> <span class="identifier">CONTRACT_CHECK_CLASS_INVARIANT</span> <span class="special">||</span> <span class="special">\</span>
+ <span class="identifier">defined</span> <span class="identifier">CONTRACT_CHECK_PRECONDITION</span> <span class="special">||</span> <span class="special">\</span>
+ <span class="identifier">defined</span> <span class="identifier">CONTRACT_CHECK_POSTCONDITION</span>
+ <span class="bold"><strong>contract_body_push_back_</strong></span> <span class="comment">// Body function name.</span>
+<span class="preprocessor">#else</span>
+ <span class="bold"><strong>push_back</strong></span> <span class="comment">// Actual function name if contract compilation is off.</span>
+<span class="preprocessor">#endif</span>
+ <span class="special">(</span><span class="keyword">const</span> <span class="identifier">T</span><span class="special">&amp;</span> <span class="identifier">element</span><span class="special">)</span> <span class="special">{</span>
+ <span class="identifier">vector_</span><span class="special">.</span><span class="identifier">push_back</span><span class="special">(</span><span class="identifier">element</span><span class="special">);</span> <span class="comment">// Original function definition.</span>
+<span class="special">}</span>
+</pre>
+<p>
+ In this case, it is recommended to used the <code class="computeroutput">CONTRACT_BODY<span class="special">()</span></code> macro instead of the hard to read <code class="computeroutput"><span class="preprocessor">#if</span></code> around the function name. If contract
+ compilation is on, <code class="computeroutput">CONTRACT_BODY<span class="special">(</span><span class="identifier">push_back</span><span class="special">)</span></code> expands to <code class="computeroutput"><span class="identifier">contract_body_push_back_</span></code>,
+ otherwise it expands to <code class="computeroutput"><span class="identifier">push_back</span></code>
+ (see Reference and <a class="link" href="tutorial.html" title="Tutorial">Tutorial</a>
+ sections). Using this macro, the above function definition is equivalently
+ written as:
+ </p>
+<pre class="programlisting"><span class="comment">// Separated definitions (eventually in a different file).</span>
+
+<span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> <span class="identifier">T</span><span class="special">&gt;</span>
+<span class="keyword">void</span> <span class="identifier">myvector</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">&gt;::</span><span class="bold"><strong>CONTRACT_FUNCTION_BODY(push_back)</strong></span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">T</span><span class="special">&amp;</span> <span class="identifier">element</span><span class="special">)</span> <span class="special">{</span>
+ <span class="identifier">vector_</span><span class="special">.</span><span class="identifier">push_back</span><span class="special">(</span><span class="identifier">element</span><span class="special">);</span> <span class="comment">// Original function definition.</span>
+<span class="special">}</span>
+</pre>
+<a name="contract__.without_the_macros.body.pure_virtual_functions"></a><h6>
+<a name="contract__.without_the_macros.body.pure_virtual_functions-heading"></a>
+ <a class="link" href="without_the_macros.html#contract__.without_the_macros.body.pure_virtual_functions">Pure
+ Virtual Functions</a>
+ </h6>
+<p>
+ Programmers can also define the body function to be pure virtual so to defer
+ its definition to derived classes. In this case the usual C++ syntax "<code class="computeroutput">
+ <span class="special">=</span> <span class="number">0</span><span class="special">;</span></code>" is used:
+ </p>
+<pre class="programlisting"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> <span class="identifier">T</span><span class="special">&gt;</span>
+<span class="keyword">class</span> <span class="identifier">pushable</span> <span class="special">{</span>
+ <span class="special">...</span>
+
+<span class="keyword">protected</span><span class="special">:</span>
+ <span class="keyword">void</span> <span class="identifier">contract_body_push_back_</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">T</span><span class="special">&amp;</span> <span class="identifier">element</span><span class="special">)</span>
+ <span class="bold"><strong>= 0;</strong></span> <span class="comment">// Contract for pure virtual functions.</span>
+
+ <span class="special">...</span>
+<span class="special">};</span>
+</pre>
+</div>
+<div class="section">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="contract__.without_the_macros.contract_class"></a><a class="link" href="without_the_macros.html#contract__.without_the_macros.contract_class" title="Contract Class">Contract
+ Class</a>
+</h3></div></div></div>
+<p>
+ A member class is defined as the contract class:
+ </p>
+<pre class="programlisting"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> <span class="identifier">T</span><span class="special">&gt;</span>
+<span class="keyword">class</span> <span class="identifier">myvector</span><span class="special">:</span> <span class="keyword">public</span> <span class="identifier">pushable</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">&gt;</span> <span class="special">{</span>
+ <span class="special">...</span>
+
+<span class="keyword">protected</span><span class="special">:</span>
+ <span class="special">...</span>
+ <span class="comment">// Contract class.</span>
+ <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">int</span> <span class="identifier">ZERO</span><span class="special">&gt;</span>
+ <span class="keyword">struct</span> <span class="identifier">contract_push_back_element_</span><span class="special">:</span> <span class="identifier">contract</span><span class="special">::</span><span class="identifier">nonstatic_member_function</span><span class="special">&lt;</span>
+ <span class="comment">// Function type for contracted function.</span>
+ <span class="comment">// Copyable class type for old object value in postconditions.</span>
+ <span class="comment">// For const members, use `myvector const` instead of `myvector`.</span>
+ <span class="keyword">void</span> <span class="special">(</span><span class="identifier">contract</span><span class="special">::</span><span class="identifier">copyable</span><span class="special">&lt;</span><span class="identifier">myvector</span><span class="special">&gt;*,</span> <span class="keyword">const</span> <span class="identifier">T</span><span class="special">&amp;),</span>
+ <span class="comment">// Base contract class for subcontracting.</span>
+ <span class="keyword">typename</span> <span class="identifier">pushable</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">&gt;::</span><span class="keyword">template</span> <span class="identifier">contract_push_back_element_</span><span class="special">&lt;</span><span class="number">0</span><span class="special">&gt;</span>
+ <span class="special">&gt;</span> <span class="special">{</span>
+ <span class="comment">// Constructor specifies body, preconditions, and postconditions.</span>
+ <span class="identifier">contract_push_back_element_</span><span class="special">():</span> <span class="identifier">contract</span><span class="special">::</span><span class="identifier">nonstatic_member_function</span><span class="special">&lt;</span>
+ <span class="keyword">void</span> <span class="special">(</span><span class="identifier">contract</span><span class="special">::</span><span class="identifier">copyable</span><span class="special">&lt;</span><span class="identifier">myvector</span><span class="special">&gt;*,</span> <span class="keyword">const</span> <span class="identifier">T</span><span class="special">&amp;),</span>
+ <span class="keyword">typename</span> <span class="identifier">pushable</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">&gt;::</span><span class="keyword">template</span> <span class="identifier">contract_push_back_element_</span><span class="special">&lt;</span><span class="number">0</span><span class="special">&gt;</span>
+ <span class="special">&gt;(</span> <span class="special">&amp;</span><span class="identifier">myvector</span><span class="special">::</span><span class="identifier">contract_body_push_back_</span>
+ <span class="special">,</span> <span class="special">&amp;</span><span class="identifier">myvector</span><span class="special">::</span><span class="identifier">contract_precondition_push_back_element_</span>
+ <span class="special">,</span> <span class="special">&amp;</span><span class="identifier">myvector</span><span class="special">::</span><span class="identifier">contract_postcondition_push_back_element_</span>
+ <span class="special">)</span> <span class="special">{}</span>
+ <span class="special">};</span>
+<span class="keyword">public</span><span class="special">:</span> <span class="comment">// Restore original access level.</span>
+
+ <span class="special">...</span>
+<span class="special">};</span>
+</pre>
+<p>
+ Note the followings:
+ </p>
+<div class="itemizedlist"><ul class="itemizedlist" type="disc">
+<li class="listitem">
+ The contract class is protected to avoid changing the user's class public
+ API but it cannot be private because derived classes might need to access
+ it for subcontracting.
+ </li>
+<li class="listitem">
+ The contract class publicly inherits (it is a <code class="computeroutput"><span class="keyword">struct</span></code>)
+ from <code class="computeroutput"><span class="identifier">contract</span><span class="special">::</span>nonstatic_member_function</code>.
+ The <code class="computeroutput">call<span class="special">()</span></code> function, which implements the contract
+ call semantics, is inherited from this base class.
+ </li>
+<li class="listitem">
+ The <code class="computeroutput"><span class="identifier">contract</span><span class="special">::</span>nonstatic_member_function</code>
+ template takes as first parameter the a function type matching the signature
+ of the contracted <code class="computeroutput"><span class="identifier">push_back</span><span class="special">()</span></code> function.
+ <div class="itemizedlist"><ul class="itemizedlist" type="circle">
+<li class="listitem">
+ For member functions (including static members, constructors, and
+ destructors, see <code class="computeroutput"><span class="identifier">contract</span><span class="special">::</span>static_member_function</code>,
+ <code class="computeroutput"><span class="identifier">contract</span><span class="special">::</span>constructor</code>, and
+ <code class="computeroutput"><span class="identifier">contract</span><span class="special">::</span>destructor</code> respectively),
+ the first argument of the function type if a pointer to the class
+ type, followed by the contracted function argument types. Instead,
+ for non-member functions (see <code class="computeroutput"><span class="identifier">contract</span><span class="special">::</span>nonmember_function</code>),
+ there is no class pointer type and the first argument of the function
+ type matches the first argument type of the contract function.
+ (This is the same syntax used by Boost.Function
+ <sup>[<a name="id913594" href="#ftn.id913594" class="footnote">16</a>]</sup>.)
+ </li>
+<li class="listitem">
+ For cv-qualified member functions, the first argument is specified
+ as a cv-qualified pointer to the class type. For example, if the
+ function in this example were to be a <code class="computeroutput"><span class="keyword">const</span></code>
+ member function <code class="computeroutput"><span class="keyword">void</span> <span class="identifier">push_back</span><span class="special">(...)</span>
+ <span class="keyword">const</span></code> then the function
+ type would have been <code class="computeroutput"><span class="keyword">void</span>
+ <span class="special">(</span><span class="identifier">contract</span><span class="special">::</span>copyable<span class="special">&lt;</span><span class="identifier">myvector</span>
+ <span class="keyword">const</span><span class="special">&gt;*,</span>
+ <span class="keyword">const</span> <span class="identifier">T</span><span class="special">&amp;)</span></code>. Note that when both <code class="computeroutput"><span class="keyword">const</span></code> and <code class="computeroutput"><span class="identifier">contract</span><span class="special">::</span>copyable</code>
+ are used, <code class="computeroutput"><span class="keyword">const</span></code> must
+ be used within <code class="computeroutput"><span class="identifier">contract</span><span class="special">::</span>copyable</code>
+ <sup>[<a name="id913920" href="#ftn.id913920" class="footnote">17</a>]</sup>. Similarly, for <code class="computeroutput"><span class="keyword">volatile</span></code>
+ and <code class="computeroutput"><span class="keyword">const</span> <span class="keyword">volatile</span></code>.
+ </li>
+<li class="listitem">
+ In the function type, the class type (which is specified only for
+ member functions) and the argument types can be tagged <code class="computeroutput"><span class="identifier">contract</span><span class="special">::</span>copyable</code> if the relative
+ old values are needed in postconditions. Any type tagged <code class="computeroutput"><span class="identifier">contract</span><span class="special">::</span>copyable</code> (<code class="computeroutput"><span class="identifier">myvector</span></code> in this example) must
+ have an accessible constant-correct copy constructor otherwise
+ the library will generate a compile-time error (see <code class="computeroutput"><span class="identifier">contract</span><span class="special">::</span>copy</code>). Note that the object
+ <code class="computeroutput"><span class="identifier">contract</span><span class="special">::</span>copyable</code> only wraps
+ the class type and not the pointer (i.e., <code class="computeroutput"><span class="identifier">contract</span><span class="special">::</span>copyable<span class="special">&lt;</span><span class="identifier">myvector</span><span class="special">*&gt;</span></code> is invalid) but for all the
+ contracted function argument types <code class="computeroutput"><span class="identifier">contract</span><span class="special">::</span>copyable</code>
+ wraps the entire type including eventual pointers -- this is because
+ for member functions, the first argument of the function type must
+ always be a pointer to the class type (even when the class type
+ is tagged <code class="computeroutput"><span class="identifier">contract</span><span class="special">::</span>copyable</code>
+ and/or it is qualified <code class="computeroutput"><span class="keyword">const</span></code>).
+ </li>
+</ul></div>
+ </li>
+<li class="listitem">
+ When subcontracting, the base contract classes are specified as the optional
+ template parameters following the function type for <code class="computeroutput"><span class="identifier">contract</span><span class="special">::</span>nonstatic_member_function</code>
+ (one base contract is specified in this case <code class="computeroutput"><span class="identifier">pushable</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">&gt;::</span><span class="identifier">contract_push_back_element</span><span class="special">&lt;</span><span class="number">0</span><span class="special">&gt;</span></code>).
+ All these template parameters are optional and multiple base contract
+ classes can be specified to support subcontracting for multiple inheritance.
+ </li>
+<li class="listitem">
+ The contract class must define a public default constructor (i.e., with
+ no arguments) which constructs the base class <code class="computeroutput"><span class="identifier">contract</span><span class="special">::</span>nonstatic_member_function</code>
+ passing function pointers to the body, precondition, and postcondition
+ (so the contract knows which function to invoke to execute the body,
+ check preconditions, and check postconditions).
+ </li>
+</ul></div>
+<div class="note"><table border="0" summary="Note">
+<tr>
+<td rowspan="2" align="center" valign="top" width="25"><img alt="[Note]" src="../images/note.png"></td>
+<th align="left">Note</th>
+</tr>
+<tr><td align="left" valign="top">
+<p>
+ The contract class is declared as a template using the <span class="emphasis"><em>artificial</em></span>
+ template parameter <code class="computeroutput"><span class="keyword">int</span> <span class="identifier">ZERO</span></code>
+ to support an internal library workaround. This allows the library to internally
+ use the <code class="computeroutput"><span class="keyword">typename</span></code> and <code class="computeroutput"><span class="keyword">template</span></code> keywords freely to explicitly characterize
+ types even without knowing if the contracted class is a template or not.
+ The artificial template parameter <code class="computeroutput"><span class="keyword">int</span>
+ <span class="identifier">ZERO</span></code> is not needed if the contracted
+ function is already a template (in which case <code class="computeroutput"><span class="keyword">int</span>
+ <span class="identifier">ZERO</span></code> is replaced by the actual
+ function template parameters).
+ </p>
+<p>
+ The value of artificial template parameter <code class="computeroutput"><span class="keyword">int</span>
+ <span class="identifier">ZERO</span></code> is not used so any value
+ can be specified. However, it is recommended to always specify the value
+ <code class="computeroutput"><span class="number">0</span></code> for consistency (this is
+ practice followed by this documentation).
+ </p>
+</td></tr>
+</table></div>
+<a name="contract__.without_the_macros.contract_class.contract_class_name"></a><h6>
+<a name="contract__.without_the_macros.contract_class.contract_class_name-heading"></a>
+ <a class="link" href="without_the_macros.html#contract__.without_the_macros.contract_class.contract_class_name">Contract
+ Class Name</a>
+ </h6>
+<p>
+ Note how, similarly to the precondition and postcondition function names,
+ the contract class name repeats the function name and the argument names.
+ Furthermore, for cv-qualified member functions, the contract class name should
+ end with the cv-qualifier. This is necessary to support contracts for overloaded
+ functions (with the limitation that overloaded functions, with the same number
+ of arguments and same constant qualifier, must have different argument names
+ and not just different argument types otherwise contract names will clash).
+ In summary, the contract class name should be as follow:
+ </p>
+<pre class="programlisting"><span class="identifier">contract_</span><span class="emphasis"><em>function-name</em></span><span class="identifier">_</span><span class="emphasis"><em>argument-name1</em></span><span class="identifier">_</span><span class="emphasis"><em>argument-name2</em></span><span class="identifier">_</span><span class="emphasis"><em>...argument-nameN</em></span><span class="identifier">_</span>/[/<span class="identifier">const_</span>/]//[/<span class="identifier">volatile_</span>/]/
+</pre>
+<p>
+ In order to allow the contract macros to subcontract from hand-written contracts,
+ you must follow the above convention in naming the contract class at all
+ times (because this is the convention that the contract macros assume).
+ </p>
+<p>
+ The contract class name begins with the <code class="computeroutput"><span class="identifier">contract</span></code>
+ prefix and ends with an underscore "<code class="computeroutput"><span class="identifier">_</span></code>"
+ thus programmers should never directly use this class in user code (see
+ <a class="link" href="getting_started.html" title="Getting Started">Getting Started</a>).
+ </p>
+</div>
+<div class="section">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="contract__.without_the_macros.static_member_functions"></a><a class="link" href="without_the_macros.html#contract__.without_the_macros.static_member_functions" title="Static Member Functions">Static
+ Member Functions</a>
+</h3></div></div></div>
+<p>
+ Contracts can also be programmed for static member functions (see the example
+ at the end of this section). However, compared with non-static member function
+ contracts the following differences apply:
+ </p>
+<div class="itemizedlist"><ul class="itemizedlist" type="disc">
+<li class="listitem">
+ The <code class="computeroutput"><span class="identifier">contract</span><span class="special">::</span>static_member_function</code>
+ class template is used instead of <code class="computeroutput"><span class="identifier">contract</span><span class="special">::</span>nonstatic_member_function</code>.
+ </li>
+<li class="listitem">
+ The class type cannot be tagged <code class="computeroutput"><span class="identifier">contract</span><span class="special">::</span>copyable</code>
+ or qualified <code class="computeroutput"><span class="keyword">const</span></code> (because
+ there is no object to copy or to not modify).
+ </li>
+<li class="listitem">
+ The precondition, postcondition, and body functions must be <code class="computeroutput"><span class="keyword">static</span></code> members (and therefore they cannot
+ be <code class="computeroutput"><span class="keyword">const</span></code>).
+ </li>
+<li class="listitem">
+ No base contract class can be specified because <code class="computeroutput"><span class="keyword">static</span></code>
+ members cannot be <code class="computeroutput"><span class="keyword">virtual</span></code>
+ so they cannot subcontract.
+ </li>
+</ul></div>
+<p>
+ All these constraints are enforced by the library at compile-time.
+ </p>
+</div>
+<div class="section">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="contract__.without_the_macros.constructors"></a><a class="link" href="without_the_macros.html#contract__.without_the_macros.constructors" title="Constructors">Constructors</a>
+</h3></div></div></div>
+<p>
+ Contracts can also be programmed for constructors (see the example at the
+ end of this section). However, compared with non-static member function contracts
+ the following differences apply:
+ </p>
+<div class="itemizedlist"><ul class="itemizedlist" type="disc">
+<li class="listitem">
+ The <code class="computeroutput"><span class="identifier">contract</span><span class="special">::</span>constructor</code> class template
+ is used instead of <code class="computeroutput"><span class="identifier">contract</span><span class="special">::</span>nonstatic_member_function</code>.
+ </li>
+<li class="listitem">
+ The class type cannot be tagged <code class="computeroutput"><span class="identifier">contract</span><span class="special">::</span>copyable</code>
+ or qualified <code class="computeroutput"><span class="keyword">const</span></code> (because
+ there is no object before body execution to copy and the object is always
+ modified by the body as it is constructed).
+ </li>
+<li class="listitem">
+ The <code class="computeroutput"><span class="identifier">contract</span><span class="special">::</span>constructor</code> function type
+ template parameter must always specify a <code class="computeroutput"><span class="keyword">void</span></code>
+ return type (because constructors return no value).
+ </li>
+<li class="listitem">
+ The precondition function must be <code class="computeroutput"><span class="keyword">static</span></code>
+ because constructor preconditions cannot access the object (as there
+ is no object before constructor body execution).
+ </li>
+<li class="listitem">
+ The postcondition function always specifies <code class="computeroutput"><span class="identifier">contract</span><span class="special">::</span>noold</code>
+ for the object old value because constructor postconditions can never
+ access the object old value (as there was no object before constructor
+ body execution). Furthermore, the function type passed to <code class="computeroutput"><span class="identifier">contract</span><span class="special">::</span>constructor</code> cannot tag
+ the class type <code class="computeroutput"><span class="identifier">contract</span><span class="special">::</span>copyable</code>.
+ </li>
+<li class="listitem">
+ No base contract class can be specified because constructors do not directly
+ subcontract (the C++ object construction mechanism will automatically
+ invoke the base class constructor contracts if present).
+ </li>
+</ul></div>
+<p>
+ All these constraints are enforced by the library at compile-time.
+ </p>
+</div>
+<div class="section">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="contract__.without_the_macros.destructors"></a><a class="link" href="without_the_macros.html#contract__.without_the_macros.destructors" title="Destructors">Destructors</a>
+</h3></div></div></div>
+<p>
+ Contracts can also be programmed for destructors (see the example at the
+ end of this section). However, compared with non-static member function contracts
+ the following differences apply:
+ </p>
+<div class="itemizedlist"><ul class="itemizedlist" type="disc">
+<li class="listitem">
+ The <code class="computeroutput"><span class="identifier">contract</span><span class="special">::</span>destructor</code> class template
+ is used instead of <code class="computeroutput"><span class="identifier">contract</span><span class="special">::</span>nonstatic_member_function</code>.
+ </li>
+<li class="listitem">
+ The class type cannot be tagged <code class="computeroutput"><span class="identifier">contract</span><span class="special">::</span>copyable</code>
+ or qualified <code class="computeroutput"><span class="keyword">const</span></code> (because
+ there are no postconditions to accessed to copied object and the object
+ is always modified by the body as it is destructed).
+ </li>
+<li class="listitem">
+ The <code class="computeroutput"><span class="identifier">contract</span><span class="special">::</span>destructor</code> function type
+ template parameter must always specify a <code class="computeroutput"><span class="keyword">void</span></code>
+ return type and have no argument (because destructors return no value
+ and have no argument). Furthermore, the function pointer cannot tag the
+ class type <code class="computeroutput"><span class="identifier">contract</span><span class="special">::</span>copyable</code>.
+ </li>
+<li class="listitem">
+ The <code class="computeroutput"><span class="identifier">contract</span><span class="special">::</span>destructor</code> constructor
+ only takes the body function pointer and it does not take the precondition
+ and postcondition function pointers (because destructors have no preconditions
+ and no postconditions as they have no arguments and there is no object
+ after destructor body execution).
+ </li>
+<li class="listitem">
+ No base contract class can be specified because destructors do not directly
+ subcontract (the C++ object destruction mechanism will automatically
+ invoke the base class destructor contracts if present).
+ </li>
+</ul></div>
+<p>
+ All these constraints are enforced by the library at compile-time.
+ </p>
+</div>
+<div class="section">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="contract__.without_the_macros.non_member_functions"></a><a class="link" href="without_the_macros.html#contract__.without_the_macros.non_member_functions" title="Non-Member Functions">Non-Member
+ Functions</a>
+</h3></div></div></div>
+<p>
+ Contracts can also be programmed for non-member functions (see the example
+ at the end of this section). However, compared with non-static member function
+ contracts the following differences apply:
+ </p>
+<div class="itemizedlist"><ul class="itemizedlist" type="disc">
+<li class="listitem">
+ The <code class="computeroutput"><span class="identifier">contract</span><span class="special">::</span>nonmember_function</code>
+ class template is used instead of <code class="computeroutput"><span class="identifier">contract</span><span class="special">::</span>nonstatic_member_function</code>.
+ </li>
+<li class="listitem">
+ The function type passed as the first template parameter to <code class="computeroutput"><span class="identifier">contract</span><span class="special">::</span>nonmember_function</code>
+ does <span class="emphasis"><em>not</em></span> specify the class type (i.e., <span class="emphasis"><em>result-type</em></span><code class="computeroutput">
+ <span class="special">(</span></code><span class="emphasis"><em>argument-type1</em></span><code class="computeroutput"><span class="special">,</span> <span class="special">...)</span></code>
+ is used instead of <span class="emphasis"><em>result-type</em></span><code class="computeroutput"> <span class="special">(</span></code><span class="emphasis"><em>class-type</em></span><code class="computeroutput"><span class="special">*,</span></code> <span class="emphasis"><em>argument-type1</em></span><code class="computeroutput"><span class="special">,</span> <span class="special">...)</span></code>).
+ </li>
+<li class="listitem">
+ The precondition, postcondition, body functions, and the contract class
+ are not members.
+ </li>
+<li class="listitem">
+ The contracted function definition must be <code class="computeroutput"><span class="keyword">inline</span></code>
+ and it must appear at the very end of the contract after the precondition,
+ postcondition, body functions, and the contract class (to avoid duplicate
+ definitions and missing definitions compile-time errors).
+ </li>
+</ul></div>
+<p>
+ All these constraints are enforced by the library at compile-time.
+ </p>
+</div>
+<div class="section">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="contract__.without_the_macros.a_fully_working_example__without_the_macros_"></a><a class="link" href="without_the_macros.html#contract__.without_the_macros.a_fully_working_example__without_the_macros_" title="A Fully Working Example (Without the Macros)">A
+ Fully Working Example (Without the Macros)</a>
+</h3></div></div></div>
+<p>
+ We conclude this section with a fully working example that can be compiled.
+ This example illustrates how to use the library to program contracts without
+ the macros.
+ </p>
+<p>
+ For simplicity, this example only exposes a limited subset of the <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">vector</span></code>
+ operations and it only programs simple contracts for them (see the STL Vector
+ <a class="link" href="examples.html" title="Examples">Example</a> for <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">vector</span></code>
+ complete contracts). Furthermore, the somewhat artificial base classes have
+ been deliberately introduced to illustrate subcontracting and they will probably
+ not be part of real code.
+ </p>
+<p>
+ Comparing this example with the one presented in the <a class="link" href="tutorial.html" title="Tutorial">Tutorial</a>
+ section, it is easy to note how much more setup code around the contract
+ assertions is required when the contract macros are not used. Therefore,
+ the use of the contract macros is always recommended.
+ </p>
+<p>
+
+</p>
+<pre class="programlisting"><span class="preprocessor">#include</span> <span class="string">"pushable.hpp"</span> <span class="comment">// Base class for subcontracting.</span>
+<span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">contract</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span> <span class="comment">// This library.</span>
+<span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">vector</span><span class="special">&gt;</span> <span class="comment">// STL vector.</span>
+
+<span class="comment">// Wrapper that adds simple (not complete) contracts to C++ STL</span>
+<span class="comment">// without using the library contract macros.</span>
+<span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> <span class="identifier">T</span><span class="special">&gt;</span>
+<span class="keyword">class</span> <span class="identifier">myvector</span><span class="special">:</span> <span class="keyword">public</span> <span class="identifier">pushable</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">&gt;</span> <span class="special">{</span>
+
+<span class="preprocessor">#if</span> <span class="identifier">defined</span> <span class="identifier">CONTRACT_CHECK_CLASS_INVARIANT</span> <span class="special">||</span> <span class="comment">/* Allow for */</span> <span class="special">\</span>
+ <span class="identifier">defined</span> <span class="identifier">CONTRACT_CHECK_PRECONDITION</span> <span class="special">||</span> <span class="comment">/* optional contract */</span> <span class="special">\</span>
+ <span class="identifier">defined</span> <span class="identifier">CONTRACT_CHECK_POSTCONDITION</span> <span class="comment">/* compilation. */</span>
+ <span class="comment">// Augmented state.</span>
+ <span class="keyword">friend</span> <span class="keyword">class</span> <span class="identifier">contract</span><span class="special">::</span><span class="identifier">state</span><span class="special">;</span>
+ <span class="keyword">mutable</span> <span class="identifier">contract</span><span class="special">::</span><span class="identifier">state</span> <span class="identifier">contract_state_</span><span class="special">;</span>
+<span class="preprocessor">#endif</span> <span class="comment">// contracts</span>
+
+<span class="preprocessor">#if</span> <span class="identifier">defined</span> <span class="identifier">CONTRACT_CHECK_CLASS_INVARIANT</span>
+ <span class="comment">// Static class invariants</span>
+ <span class="keyword">static</span> <span class="keyword">void</span> <span class="identifier">contract_static_invariant_</span><span class="special">(</span><span class="keyword">void</span><span class="special">)</span> <span class="special">{</span>
+ <span class="comment">// Assert nothing in this case.</span>
+ <span class="special">}</span>
+ <span class="comment">// Class invariants.</span>
+ <span class="keyword">void</span> <span class="identifier">contract_invariant_</span><span class="special">(</span><span class="keyword">void</span><span class="special">)</span> <span class="keyword">const</span> <span class="special">{</span>
+ <span class="keyword">if</span> <span class="special">(!((</span><span class="identifier">size</span><span class="special">()</span> <span class="special">==</span> <span class="number">0</span><span class="special">)</span> <span class="special">==</span> <span class="identifier">empty</span><span class="special">()))</span>
+ <span class="keyword">throw</span> <span class="identifier">contract</span><span class="special">::</span><span class="identifier">failure</span><span class="special">(</span><span class="identifier">__FILE__</span><span class="special">,</span> <span class="identifier">__LINE__</span><span class="special">);</span>
+ <span class="comment">// More invariants here...</span>
+ <span class="special">}</span>
+<span class="preprocessor">#endif</span> <span class="comment">// invariants</span>
+
+<span class="keyword">public</span><span class="special">:</span>
+ <span class="keyword">typedef</span> <span class="keyword">typename</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">vector</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">&gt;::</span><span class="identifier">size_type</span> <span class="identifier">size_type</span><span class="special">;</span>
+ <span class="keyword">typedef</span> <span class="keyword">typename</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">vector</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">&gt;::</span><span class="identifier">const_reference</span> <span class="identifier">const_reference</span><span class="special">;</span>
+ <span class="keyword">typedef</span> <span class="keyword">typename</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">vector</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">&gt;::</span><span class="identifier">const_iterator</span> <span class="identifier">const_iterator</span><span class="special">;</span>
+
+ <span class="comment">// Contract for constructor.</span>
+ <span class="keyword">explicit</span> <span class="identifier">myvector</span><span class="special">(</span><span class="identifier">size_type</span> <span class="identifier">count</span><span class="special">):</span> <span class="identifier">vector_</span><span class="special">(</span><span class="identifier">count</span><span class="special">)</span>
+<span class="preprocessor">#if</span> <span class="identifier">defined</span> <span class="identifier">CONTRACT_CHECK_CLASS_INVARIANT</span> <span class="special">||</span> <span class="special">\</span>
+ <span class="identifier">defined</span> <span class="identifier">CONTRACT_CHECK_PRECONDITION</span> <span class="special">||</span> <span class="special">\</span>
+ <span class="identifier">defined</span> <span class="identifier">CONTRACT_CHECK_POSTCONDITION</span>
+ <span class="special">{</span>
+ <span class="identifier">contract_contract_constructor_count_</span><span class="special">&lt;</span><span class="number">0</span><span class="special">&gt;().</span><span class="identifier">call</span><span class="special">(</span><span class="keyword">this</span><span class="special">,</span> <span class="identifier">count</span><span class="special">);</span>
+ <span class="special">}</span>
+<span class="keyword">private</span><span class="special">:</span>
+<span class="preprocessor">#if</span> <span class="identifier">defined</span> <span class="identifier">CONTRACT_CHECK_PRECONDITION</span>
+ <span class="comment">// Static preconditions (i.e., no object).</span>
+ <span class="keyword">static</span> <span class="keyword">void</span> <span class="identifier">contract_precondition_contract_constructor_count_</span><span class="special">(</span>
+ <span class="keyword">const</span> <span class="identifier">size_type</span><span class="special">&amp;</span> <span class="identifier">count</span><span class="special">)</span> <span class="comment">/* no `const` (it is `static`) */</span> <span class="special">{</span>
+ <span class="special">}</span>
+<span class="preprocessor">#endif</span> <span class="comment">// preconditions</span>
+<span class="preprocessor">#if</span> <span class="identifier">defined</span> <span class="identifier">CONTRACT_CHECK_POSTCONDITION</span>
+ <span class="keyword">void</span> <span class="identifier">contract_postcondition_contract_constructor_count_</span><span class="special">(</span>
+ <span class="identifier">contract</span><span class="special">::</span><span class="identifier">noold</span><span class="special">,</span> <span class="comment">// Always `noold` for old object.</span>
+ <span class="keyword">const</span> <span class="identifier">size_type</span><span class="special">&amp;</span> <span class="identifier">count</span><span class="special">,</span> <span class="identifier">contract</span><span class="special">::</span><span class="identifier">noold</span><span class="special">)</span> <span class="keyword">const</span> <span class="special">{</span>
+ <span class="keyword">if</span> <span class="special">(!(</span><span class="identifier">size</span><span class="special">()</span> <span class="special">==</span> <span class="identifier">count</span><span class="special">))</span>
+ <span class="keyword">throw</span> <span class="identifier">contract</span><span class="special">::</span><span class="identifier">failure</span><span class="special">(</span><span class="identifier">__FILE__</span><span class="special">,</span> <span class="identifier">__LINE__</span><span class="special">);</span>
+ <span class="special">}</span>
+<span class="preprocessor">#endif</span> <span class="comment">// postconditions</span>
+<span class="keyword">protected</span><span class="special">:</span>
+ <span class="keyword">void</span> <span class="identifier">contract_body_contract_constructor_</span><span class="special">(</span><span class="identifier">size_type</span> <span class="identifier">count</span><span class="special">)</span>
+<span class="preprocessor">#endif</span> <span class="comment">// contracts</span>
+ <span class="special">{</span>
+ <span class="comment">// Do nothing in this case</span>
+ <span class="special">}</span>
+<span class="preprocessor">#if</span> <span class="identifier">defined</span> <span class="identifier">CONTRACT_CHECK_CLASS_INVARIANT</span> <span class="special">||</span> <span class="special">\</span>
+ <span class="identifier">defined</span> <span class="identifier">CONTRACT_CHECK_PRECONDITION</span> <span class="special">||</span> <span class="special">\</span>
+ <span class="identifier">defined</span> <span class="identifier">CONTRACT_CHECK_POSTCONDITION</span>
+ <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">int</span> <span class="identifier">ZERO</span><span class="special">&gt;</span>
+ <span class="keyword">struct</span> <span class="identifier">contract_contract_constructor_count_</span><span class="special">:</span>
+ <span class="identifier">contract</span><span class="special">::</span><span class="identifier">constructor</span><span class="special">&lt;</span> <span class="comment">// Use `constructor` (not `function`).</span>
+ <span class="comment">// Class type can never be tagged `copyable`.</span>
+ <span class="keyword">void</span> <span class="special">(</span><span class="identifier">myvector</span><span class="special">*,</span> <span class="identifier">size_type</span><span class="special">)&gt;</span> <span class="special">{</span>
+ <span class="identifier">contract_contract_constructor_count_</span><span class="special">():</span> <span class="identifier">contract</span><span class="special">::</span><span class="identifier">constructor</span> <span class="special">&lt;</span>
+ <span class="keyword">void</span> <span class="special">(</span><span class="identifier">myvector</span><span class="special">*,</span> <span class="identifier">size_type</span><span class="special">)</span>
+ <span class="special">&gt;(</span> <span class="special">&amp;</span><span class="identifier">myvector</span><span class="special">::</span><span class="identifier">contract_body_contract_constructor_</span>
+<span class="preprocessor">#if</span> <span class="identifier">defined</span> <span class="identifier">CONTRACT_CHECK_PRECONDITION</span>
+ <span class="special">,</span> <span class="special">&amp;</span><span class="identifier">myvector</span><span class="special">::</span><span class="identifier">contract_precondition_contract_constructor_count_</span>
+<span class="preprocessor">#endif</span> <span class="comment">// preconditions</span>
+<span class="preprocessor">#if</span> <span class="identifier">defined</span> <span class="identifier">CONTRACT_CHECK_POSTCONDITION</span>
+ <span class="special">,</span> <span class="special">&amp;</span><span class="identifier">myvector</span><span class="special">::</span><span class="identifier">contract_postcondition_contract_constructor_count_</span>
+<span class="preprocessor">#endif</span> <span class="comment">// postconditions</span>
+ <span class="special">)</span> <span class="special">{}</span>
+ <span class="special">};</span>
+<span class="keyword">public</span><span class="special">:</span>
+<span class="preprocessor">#endif</span> <span class="comment">// contracts</span>
+
+ <span class="comment">// Contract for destructor.</span>
+ <span class="keyword">virtual</span> <span class="special">~</span><span class="identifier">myvector</span><span class="special">(</span><span class="keyword">void</span><span class="special">)</span>
+ <span class="comment">// Destructors only check invariants.</span>
+<span class="preprocessor">#if</span> <span class="identifier">defined</span> <span class="identifier">CONTRACT_CHECK_CLASS_INVARIANT</span>
+ <span class="special">{</span>
+ <span class="identifier">contract_contract_destructor_</span><span class="special">&lt;</span><span class="number">0</span><span class="special">&gt;().</span><span class="identifier">call</span><span class="special">(</span><span class="keyword">this</span><span class="special">);</span>
+ <span class="special">}</span>
+<span class="keyword">protected</span><span class="special">:</span>
+ <span class="comment">// No precondition and no postcondition functions.</span>
+ <span class="keyword">virtual</span> <span class="keyword">void</span> <span class="identifier">contract_body_contract_destructor_</span><span class="special">(</span><span class="keyword">void</span><span class="special">)</span>
+<span class="preprocessor">#endif</span> <span class="comment">// invariant</span>
+ <span class="special">{</span>
+ <span class="comment">// Do nothing in this case.</span>
+ <span class="special">}</span>
+<span class="preprocessor">#if</span> <span class="identifier">defined</span> <span class="identifier">CONTRACT_CHECK_CLASS_INVARIANT</span>
+ <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">int</span> <span class="identifier">ZERO</span><span class="special">&gt;</span>
+ <span class="keyword">struct</span> <span class="identifier">contract_contract_destructor_</span><span class="special">:</span>
+ <span class="identifier">contract</span><span class="special">::</span><span class="identifier">destructor</span><span class="special">&lt;</span> <span class="comment">// Use `destructor` (not `function`).</span>
+ <span class="comment">// Class type can never be tagged `copyable`.</span>
+ <span class="keyword">void</span> <span class="special">(</span><span class="identifier">myvector</span><span class="special">*)&gt;</span> <span class="special">{</span>
+ <span class="identifier">contract_contract_destructor_</span><span class="special">():</span> <span class="identifier">contract</span><span class="special">::</span><span class="identifier">destructor</span><span class="special">&lt;</span>
+ <span class="keyword">void</span> <span class="special">(</span><span class="identifier">myvector</span><span class="special">*)</span>
+ <span class="special">&gt;(&amp;</span><span class="identifier">myvector</span><span class="special">::</span><span class="identifier">contract_body_contract_destructor_</span> <span class="special">)</span> <span class="special">{}</span>
+ <span class="special">};</span>
+<span class="keyword">public</span><span class="special">:</span>
+<span class="preprocessor">#endif</span> <span class="comment">// invariant</span>
+
+ <span class="comment">// Contract for non-static member functions.</span>
+ <span class="keyword">void</span> <span class="identifier">push_back</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">T</span><span class="special">&amp;</span> <span class="identifier">element</span><span class="special">)</span>
+<span class="preprocessor">#if</span> <span class="identifier">defined</span> <span class="identifier">CONTRACT_CHECK_CLASS_INVARIANT</span> <span class="special">||</span> <span class="special">\</span>
+ <span class="identifier">defined</span> <span class="identifier">CONTRACT_CHECK_PRECONDITION</span> <span class="special">||</span> <span class="special">\</span>
+ <span class="identifier">defined</span> <span class="identifier">CONTRACT_CHECK_POSTCONDITION</span>
+ <span class="comment">// Contracted function.</span>
+ <span class="special">{</span>
+ <span class="identifier">contract_push_back_element_</span><span class="special">&lt;</span><span class="number">0</span><span class="special">&gt;().</span><span class="identifier">call</span><span class="special">(</span><span class="keyword">this</span> <span class="special">,</span> <span class="identifier">element</span><span class="special">);</span>
+ <span class="special">}</span>
+<span class="keyword">private</span><span class="special">:</span> <span class="comment">// Private so not to alter user call public API.</span>
+<span class="preprocessor">#if</span> <span class="identifier">defined</span> <span class="identifier">CONTRACT_CHECK_PRECONDITION</span>
+ <span class="keyword">void</span> <span class="identifier">contract_precondition_push_back_element_</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">T</span><span class="special">&amp;</span> <span class="identifier">element</span><span class="special">)</span> <span class="keyword">const</span> <span class="special">{</span>
+ <span class="keyword">if</span> <span class="special">(!(</span><span class="identifier">size</span><span class="special">()</span> <span class="special">&lt;</span> <span class="identifier">max_size</span><span class="special">()))</span>
+ <span class="keyword">throw</span> <span class="identifier">contract</span><span class="special">::</span><span class="identifier">failure</span><span class="special">(</span><span class="identifier">__FILE__</span><span class="special">,</span> <span class="identifier">__LINE__</span><span class="special">);</span>
+ <span class="comment">// More preconditions here...</span>
+ <span class="special">}</span>
+<span class="preprocessor">#endif</span> <span class="comment">// preconditions</span>
+<span class="preprocessor">#if</span> <span class="identifier">defined</span> <span class="identifier">CONTRACT_CHECK_POSTCONDITION</span>
+ <span class="keyword">void</span> <span class="identifier">contract_postcondition_push_back_element_</span><span class="special">(</span>
+ <span class="keyword">const</span> <span class="identifier">myvector</span><span class="special">*</span> <span class="identifier">contract_old_this_</span><span class="special">,</span> <span class="comment">// Old value for object.</span>
+ <span class="keyword">const</span> <span class="identifier">T</span><span class="special">&amp;</span> <span class="identifier">element</span><span class="special">,</span> <span class="identifier">contract</span><span class="special">::</span><span class="identifier">noold</span> <span class="comment">// No old for element argument.</span>
+ <span class="special">)</span> <span class="keyword">const</span> <span class="special">{</span>
+ <span class="keyword">if</span> <span class="special">(!(</span><span class="identifier">size</span><span class="special">()</span> <span class="special">==</span> <span class="special">(</span><span class="identifier">contract_old_this_</span><span class="special">-&gt;</span><span class="identifier">size</span><span class="special">()</span> <span class="special">+</span> <span class="number">1</span><span class="special">)))</span>
+ <span class="keyword">throw</span> <span class="identifier">contract</span><span class="special">::</span><span class="identifier">failure</span><span class="special">(</span><span class="identifier">__FILE__</span><span class="special">,</span> <span class="identifier">__LINE__</span><span class="special">);</span>
+ <span class="comment">// More postconditions here...</span>
+ <span class="special">}</span>
+<span class="preprocessor">#endif</span> <span class="comment">// postconditions</span>
+<span class="keyword">protected</span><span class="special">:</span> <span class="comment">// Must be protected (not private) to allow subcontracting.</span>
+ <span class="keyword">void</span> <span class="identifier">contract_body_push_back_</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">T</span><span class="special">&amp;</span> <span class="identifier">element</span><span class="special">)</span>
+<span class="preprocessor">#endif</span> <span class="comment">// contracts</span>
+ <span class="comment">// Original function definition (the body).</span>
+ <span class="special">{</span>
+ <span class="identifier">vector_</span><span class="special">.</span><span class="identifier">push_back</span><span class="special">(</span><span class="identifier">element</span><span class="special">);</span>
+ <span class="special">}</span>
+<span class="preprocessor">#if</span> <span class="identifier">defined</span> <span class="identifier">CONTRACT_CHECK_CLASS_INVARIANT</span> <span class="special">||</span> <span class="special">\</span>
+ <span class="identifier">defined</span> <span class="identifier">CONTRACT_CHECK_PRECONDITION</span> <span class="special">||</span> <span class="special">\</span>
+ <span class="identifier">defined</span> <span class="identifier">CONTRACT_CHECK_POSTCONDITION</span>
+ <span class="comment">// Contract class.</span>
+ <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">int</span> <span class="identifier">ZERO</span><span class="special">&gt;</span>
+ <span class="keyword">struct</span> <span class="identifier">contract_push_back_element_</span><span class="special">:</span> <span class="identifier">contract</span><span class="special">::</span><span class="identifier">nonstatic_member_function</span><span class="special">&lt;</span>
+ <span class="comment">// Function type with class type pointer as 1st argument.</span>
+ <span class="comment">// Copyable class type for old object value in postconditions.</span>
+ <span class="comment">// For constant members, change `myvector` to `myvector const`.</span>
+ <span class="keyword">void</span> <span class="special">(</span><span class="identifier">contract</span><span class="special">::</span><span class="identifier">copyable</span><span class="special">&lt;</span><span class="identifier">myvector</span><span class="special">&gt;*,</span> <span class="keyword">const</span> <span class="identifier">T</span><span class="special">&amp;),</span>
+ <span class="comment">// Base contract class for subcontracting.</span>
+ <span class="keyword">typename</span> <span class="identifier">pushable</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">&gt;::</span><span class="keyword">template</span>
+ <span class="identifier">contract_virtual_push_back_element_</span><span class="special">&lt;</span><span class="number">0</span><span class="special">&gt;</span>
+ <span class="special">&gt;</span> <span class="special">{</span>
+ <span class="comment">// Constructor specifies body, preconditions, and postconditions.</span>
+ <span class="identifier">contract_push_back_element_</span><span class="special">():</span> <span class="identifier">contract</span><span class="special">::</span><span class="identifier">nonstatic_member_function</span><span class="special">&lt;</span>
+ <span class="keyword">void</span> <span class="special">(</span><span class="identifier">contract</span><span class="special">::</span><span class="identifier">copyable</span><span class="special">&lt;</span><span class="identifier">myvector</span><span class="special">&gt;*,</span> <span class="keyword">const</span> <span class="identifier">T</span><span class="special">&amp;),</span>
+ <span class="keyword">typename</span> <span class="identifier">pushable</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">&gt;::</span><span class="keyword">template</span>
+ <span class="identifier">contract_virtual_push_back_element_</span><span class="special">&lt;</span><span class="number">0</span><span class="special">&gt;</span>
+ <span class="special">&gt;(</span> <span class="special">&amp;</span><span class="identifier">myvector</span><span class="special">::</span><span class="identifier">contract_body_push_back_</span>
+<span class="preprocessor">#if</span> <span class="identifier">defined</span> <span class="identifier">CONTRACT_CHECK_PRECONDITION</span>
+ <span class="special">,</span> <span class="special">&amp;</span><span class="identifier">myvector</span><span class="special">::</span><span class="identifier">contract_precondition_push_back_element_</span>
+<span class="preprocessor">#endif</span> <span class="comment">// preconditions</span>
+<span class="preprocessor">#if</span> <span class="identifier">defined</span> <span class="identifier">CONTRACT_CHECK_POSTCONDITION</span>
+ <span class="special">,</span> <span class="special">&amp;</span><span class="identifier">myvector</span><span class="special">::</span><span class="identifier">contract_postcondition_push_back_element_</span>
+<span class="preprocessor">#endif</span> <span class="comment">// postconditions</span>
+ <span class="special">)</span> <span class="special">{}</span>
+ <span class="special">};</span>
+<span class="keyword">public</span><span class="special">:</span> <span class="comment">// Restore original access level.</span>
+<span class="preprocessor">#endif</span> <span class="comment">// contracts</span>
+
+ <span class="comment">// Contract for template plus static member function.</span>
+ <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">Iter</span><span class="special">&gt;</span>
+ <span class="keyword">static</span> <span class="keyword">bool</span> <span class="identifier">all_equals</span><span class="special">(</span><span class="identifier">Iter</span> <span class="identifier">first</span><span class="special">,</span> <span class="identifier">Iter</span> <span class="identifier">last</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">T</span><span class="special">&amp;</span> <span class="identifier">element</span><span class="special">)</span>
+ <span class="comment">// Static members also check (static) class invariants.</span>
+<span class="preprocessor">#if</span> <span class="identifier">defined</span> <span class="identifier">CONTRACT_CHECK_CLASS_INVARIANT</span> <span class="special">||</span> <span class="special">\</span>
+ <span class="identifier">defined</span> <span class="identifier">CONTRACT_CHECK_PRECONDITION</span> <span class="special">||</span> <span class="special">\</span>
+ <span class="identifier">defined</span> <span class="identifier">CONTRACT_CHECK_POSTCONDITION</span>
+ <span class="special">{</span>
+ <span class="keyword">return</span> <span class="identifier">contract_all_equals_first_last_element_</span><span class="special">&lt;</span><span class="identifier">Iter</span><span class="special">&gt;().</span><span class="identifier">call</span><span class="special">(</span>
+ <span class="identifier">first</span><span class="special">,</span> <span class="identifier">last</span><span class="special">,</span> <span class="identifier">element</span><span class="special">);</span>
+ <span class="special">}</span>
+<span class="keyword">private</span><span class="special">:</span>
+ <span class="comment">// Static template precondition and postcondition functions.</span>
+<span class="preprocessor">#if</span> <span class="identifier">defined</span> <span class="identifier">CONTRACT_CHECK_PRECONDITION</span>
+ <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">Iter</span><span class="special">&gt;</span>
+ <span class="keyword">static</span> <span class="keyword">void</span> <span class="identifier">contract_precondition_all_equals_first_last_element_</span><span class="special">(</span>
+ <span class="keyword">const</span> <span class="identifier">Iter</span><span class="special">&amp;</span> <span class="identifier">first</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">Iter</span><span class="special">&amp;</span> <span class="identifier">last</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">T</span><span class="special">&amp;</span> <span class="identifier">element</span><span class="special">)</span>
+ <span class="comment">/* no `const` */</span> <span class="special">{</span>
+ <span class="keyword">if</span> <span class="special">(!(</span><span class="identifier">first</span> <span class="special">&lt;</span> <span class="identifier">last</span><span class="special">))</span>
+ <span class="keyword">throw</span> <span class="identifier">contract</span><span class="special">::</span><span class="identifier">failure</span><span class="special">(</span><span class="identifier">__FILE__</span><span class="special">,</span> <span class="identifier">__LINE__</span><span class="special">);</span>
+ <span class="special">}</span>
+<span class="preprocessor">#endif</span> <span class="comment">// preconditions</span>
+<span class="preprocessor">#if</span> <span class="identifier">defined</span> <span class="identifier">CONTRACT_CHECK_POSTCONDITION</span>
+ <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">Iter</span><span class="special">&gt;</span>
+ <span class="keyword">static</span> <span class="keyword">void</span> <span class="identifier">contract_postcondition_all_equals_first_last_element_</span><span class="special">(</span>
+ <span class="keyword">const</span> <span class="identifier">Iter</span><span class="special">&amp;</span> <span class="identifier">first</span><span class="special">,</span> <span class="identifier">contract</span><span class="special">::</span><span class="identifier">noold</span><span class="special">,</span>
+ <span class="keyword">const</span> <span class="identifier">Iter</span><span class="special">&amp;</span> <span class="identifier">last</span><span class="special">,</span> <span class="identifier">contract</span><span class="special">::</span><span class="identifier">noold</span><span class="special">,</span>
+ <span class="keyword">const</span> <span class="identifier">T</span><span class="special">&amp;</span> <span class="identifier">element</span><span class="special">,</span> <span class="identifier">contract</span><span class="special">::</span><span class="identifier">noold</span><span class="special">,</span>
+ <span class="keyword">const</span> <span class="keyword">bool</span><span class="special">&amp;</span> <span class="identifier">result</span> <span class="special">)</span> <span class="comment">// Result value.</span>
+ <span class="comment">/* no `const` */</span> <span class="special">{</span>
+ <span class="special">}</span>
+<span class="preprocessor">#endif</span> <span class="comment">// postconditions</span>
+<span class="keyword">protected</span><span class="special">:</span>
+ <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">Iter</span><span class="special">&gt;</span>
+ <span class="keyword">static</span> <span class="keyword">bool</span> <span class="identifier">contract_body_all_equals_</span><span class="special">(</span>
+ <span class="identifier">Iter</span> <span class="identifier">first</span><span class="special">,</span> <span class="identifier">Iter</span> <span class="identifier">last</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">T</span><span class="special">&amp;</span> <span class="identifier">element</span><span class="special">)</span>
+<span class="preprocessor">#endif</span> <span class="comment">// contracts</span>
+ <span class="special">{</span>
+ <span class="keyword">for</span> <span class="special">(</span><span class="identifier">Iter</span> <span class="identifier">i</span> <span class="special">=</span> <span class="identifier">first</span><span class="special">;</span> <span class="identifier">i</span> <span class="special">&lt;</span> <span class="identifier">last</span><span class="special">;</span> <span class="special">++</span><span class="identifier">i</span><span class="special">)</span> <span class="special">{</span>
+ <span class="keyword">if</span> <span class="special">(*</span><span class="identifier">i</span> <span class="special">!=</span> <span class="identifier">element</span><span class="special">)</span> <span class="keyword">return</span> <span class="keyword">false</span><span class="special">;</span>
+ <span class="special">}</span>
+ <span class="keyword">return</span> <span class="keyword">true</span><span class="special">;</span>
+ <span class="special">}</span>
+<span class="preprocessor">#if</span> <span class="identifier">defined</span> <span class="identifier">CONTRACT_CHECK_CLASS_INVARIANT</span> <span class="special">||</span> <span class="special">\</span>
+ <span class="identifier">defined</span> <span class="identifier">CONTRACT_CHECK_PRECONDITION</span> <span class="special">||</span> <span class="special">\</span>
+ <span class="identifier">defined</span> <span class="identifier">CONTRACT_CHECK_POSTCONDITION</span>
+ <span class="comment">// Function template parameter `class Iter` already present so</span>
+ <span class="comment">// no artificial `int ZERO` parameter.</span>
+ <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">Iter</span><span class="special">&gt;</span>
+ <span class="keyword">struct</span> <span class="identifier">contract_all_equals_first_last_element_</span><span class="special">:</span> <span class="identifier">contract</span><span class="special">::</span><span class="identifier">static_member_function</span><span class="special">&lt;</span>
+ <span class="keyword">bool</span> <span class="special">(</span><span class="identifier">myvector</span><span class="special">*,</span> <span class="identifier">Iter</span><span class="special">,</span> <span class="identifier">Iter</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">T</span><span class="special">&amp;)</span>
+ <span class="special">&gt;</span> <span class="special">{</span>
+ <span class="identifier">contract_all_equals_first_last_element_</span><span class="special">():</span> <span class="identifier">contract</span><span class="special">::</span> <span class="identifier">static_member_function</span><span class="special">&lt;</span>
+ <span class="keyword">bool</span> <span class="special">(</span><span class="identifier">myvector</span><span class="special">*,</span> <span class="identifier">Iter</span><span class="special">,</span> <span class="identifier">Iter</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">T</span><span class="special">&amp;)</span>
+ <span class="special">&gt;(</span> <span class="special">&amp;</span><span class="identifier">myvector</span><span class="special">::</span><span class="keyword">template</span> <span class="identifier">contract_body_all_equals_</span><span class="special">&lt;</span><span class="identifier">Iter</span><span class="special">&gt;</span>
+<span class="preprocessor">#if</span> <span class="identifier">defined</span> <span class="identifier">CONTRACT_CHECK_PRECONDITION</span>
+ <span class="special">,</span> <span class="special">&amp;</span><span class="identifier">myvector</span><span class="special">::</span><span class="keyword">template</span> <span class="identifier">contract_precondition_all_equals_first_last_element_</span><span class="special">&lt;</span><span class="identifier">Iter</span><span class="special">&gt;</span>
+<span class="preprocessor">#endif</span> <span class="comment">// preconditions</span>
+<span class="preprocessor">#if</span> <span class="identifier">defined</span> <span class="identifier">CONTRACT_CHECK_POSTCONDITION</span>
+ <span class="special">,</span> <span class="special">&amp;</span><span class="identifier">myvector</span><span class="special">::</span><span class="keyword">template</span> <span class="identifier">contract_postcondition_all_equals_first_last_element_</span><span class="special">&lt;</span><span class="identifier">Iter</span><span class="special">&gt;</span>
+<span class="preprocessor">#endif</span> <span class="comment">// postconditions</span>
+ <span class="special">)</span> <span class="special">{}</span>
+ <span class="special">};</span>
+<span class="keyword">public</span><span class="special">:</span>
+<span class="preprocessor">#endif</span> <span class="comment">// contracts</span>
+
+ <span class="comment">// Similarly, complete contracts sketched here and add contracts</span>
+ <span class="comment">// for all other functions (see [Crowl2006] vector example).</span>
+ <span class="identifier">size_type</span> <span class="identifier">size</span><span class="special">(</span><span class="keyword">void</span><span class="special">)</span> <span class="keyword">const</span> <span class="special">{</span> <span class="keyword">return</span> <span class="identifier">vector_</span><span class="special">.</span><span class="identifier">size</span><span class="special">();</span> <span class="special">}</span>
+ <span class="identifier">size_type</span> <span class="identifier">max_size</span><span class="special">(</span><span class="keyword">void</span><span class="special">)</span> <span class="keyword">const</span> <span class="special">{</span> <span class="keyword">return</span> <span class="identifier">vector_</span><span class="special">.</span><span class="identifier">max_size</span><span class="special">();</span> <span class="special">}</span>
+ <span class="keyword">bool</span> <span class="identifier">empty</span><span class="special">(</span><span class="keyword">void</span><span class="special">)</span> <span class="keyword">const</span> <span class="special">{</span> <span class="keyword">return</span> <span class="identifier">vector_</span><span class="special">.</span><span class="identifier">empty</span><span class="special">();</span> <span class="special">}</span>
+ <span class="identifier">const_reference</span> <span class="identifier">back</span><span class="special">(</span><span class="keyword">void</span><span class="special">)</span> <span class="keyword">const</span> <span class="special">{</span> <span class="keyword">return</span> <span class="identifier">vector_</span><span class="special">.</span><span class="identifier">back</span><span class="special">();</span> <span class="special">}</span>
+ <span class="identifier">const_iterator</span> <span class="identifier">begin</span><span class="special">(</span><span class="keyword">void</span><span class="special">)</span> <span class="keyword">const</span> <span class="special">{</span> <span class="keyword">return</span> <span class="identifier">vector_</span><span class="special">.</span><span class="identifier">begin</span><span class="special">();</span> <span class="special">}</span>
+ <span class="identifier">const_iterator</span> <span class="identifier">end</span><span class="special">(</span><span class="keyword">void</span><span class="special">)</span> <span class="keyword">const</span> <span class="special">{</span> <span class="keyword">return</span> <span class="identifier">vector_</span><span class="special">.</span><span class="identifier">end</span><span class="special">();</span> <span class="special">}</span>
+ <span class="identifier">const_reference</span> <span class="keyword">operator</span><span class="special">[](</span><span class="identifier">size_type</span> <span class="identifier">index</span><span class="special">)</span> <span class="keyword">const</span>
+ <span class="special">{</span> <span class="keyword">return</span> <span class="identifier">vector_</span><span class="special">[</span><span class="identifier">index</span><span class="special">];</span> <span class="special">}</span>
+
+<span class="keyword">private</span><span class="special">:</span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">vector</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">&gt;</span> <span class="identifier">vector_</span><span class="special">;</span>
+<span class="special">};</span>
+
+<span class="comment">// Contract for non-member function.</span>
+<span class="keyword">double</span> <span class="identifier">abs_total</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">myvector</span><span class="special">&lt;</span><span class="keyword">double</span><span class="special">&gt;&amp;</span> <span class="identifier">vector</span><span class="special">)</span>
+<span class="comment">// Non-member members do not check invariants.</span>
+<span class="preprocessor">#if</span> <span class="identifier">defined</span> <span class="identifier">CONTRACT_CHECK_PRECONDITION</span> <span class="special">||</span> <span class="special">\</span>
+ <span class="identifier">defined</span> <span class="identifier">CONTRACT_CHECK_POSTCONDITION</span>
+<span class="special">;</span>
+<span class="keyword">void</span> <span class="identifier">contract_precondition_abs_total_vector_</span><span class="special">(</span>
+ <span class="keyword">const</span> <span class="identifier">myvector</span><span class="special">&lt;</span><span class="keyword">double</span><span class="special">&gt;&amp;</span> <span class="identifier">vector</span> <span class="special">)</span> <span class="special">{</span>
+<span class="special">}</span>
+<span class="keyword">void</span> <span class="identifier">contract_postcondition_abs_total_vector_</span><span class="special">(</span>
+ <span class="keyword">const</span> <span class="identifier">myvector</span><span class="special">&lt;</span><span class="keyword">double</span><span class="special">&gt;&amp;</span> <span class="identifier">vector</span><span class="special">,</span> <span class="identifier">contract</span><span class="special">::</span><span class="identifier">noold</span><span class="special">,</span>
+ <span class="keyword">const</span> <span class="keyword">double</span><span class="special">&amp;</span> <span class="identifier">total</span><span class="special">)</span> <span class="special">{</span>
+ <span class="keyword">if</span> <span class="special">(!(</span><span class="identifier">total</span> <span class="special">&gt;=</span> <span class="number">0.0</span><span class="special">))</span>
+ <span class="keyword">throw</span> <span class="identifier">contract</span><span class="special">::</span><span class="identifier">failure</span><span class="special">(</span><span class="identifier">__FILE__</span><span class="special">,</span> <span class="identifier">__LINE__</span><span class="special">);</span>
+<span class="special">}</span>
+<span class="keyword">double</span> <span class="identifier">contract_body_abs_total_</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">myvector</span><span class="special">&lt;</span><span class="keyword">double</span><span class="special">&gt;&amp;</span> <span class="identifier">vector</span><span class="special">)</span>
+<span class="preprocessor">#endif</span> <span class="comment">// preconditions or postconditions</span>
+<span class="special">{</span>
+ <span class="keyword">double</span> <span class="identifier">total</span> <span class="special">=</span> <span class="number">0.0</span><span class="special">;</span>
+ <span class="identifier">CONTRACT_ASSERT_BLOCK_INVARIANT</span><span class="special">(</span> <span class="identifier">total</span> <span class="special">==</span> <span class="number">0.0</span> <span class="special">);</span>
+ <span class="special">{</span>
+ <span class="identifier">CONTRACT_INIT_LOOP_VARIANT</span><span class="special">;</span>
+ <span class="keyword">for</span> <span class="special">(</span><span class="identifier">size_t</span> <span class="identifier">i</span> <span class="special">=</span> <span class="number">0</span><span class="special">;</span> <span class="identifier">i</span> <span class="special">&lt;</span> <span class="identifier">vector</span><span class="special">.</span><span class="identifier">size</span><span class="special">();</span> <span class="special">++</span><span class="identifier">i</span><span class="special">)</span> <span class="special">{</span>
+ <span class="identifier">CONTRACT_ASSERT_BLOCK_INVARIANT</span><span class="special">(</span> <span class="identifier">i</span> <span class="special">&lt;</span> <span class="identifier">vector</span><span class="special">.</span><span class="identifier">size</span><span class="special">()</span> <span class="special">);</span>
+ <span class="identifier">CONTRACT_ASSERT_LOOP_VARIANT</span><span class="special">(</span> <span class="identifier">vector</span><span class="special">.</span><span class="identifier">size</span><span class="special">()</span> <span class="special">-</span> <span class="identifier">i</span> <span class="special">);</span>
+
+ <span class="identifier">total</span> <span class="special">+=</span> <span class="identifier">vector</span><span class="special">[</span><span class="identifier">i</span><span class="special">];</span>
+ <span class="special">}</span>
+ <span class="special">}</span>
+ <span class="keyword">return</span> <span class="identifier">total</span> <span class="special">&lt;</span> <span class="number">0.0</span> <span class="special">?</span> <span class="special">-</span><span class="identifier">total</span> <span class="special">:</span> <span class="identifier">total</span><span class="special">;</span>
+<span class="special">}</span>
+<span class="preprocessor">#if</span> <span class="identifier">defined</span> <span class="identifier">CONTRACT_CHECK_PRECONDITION</span> <span class="special">||</span> <span class="special">\</span>
+ <span class="identifier">defined</span> <span class="identifier">CONTRACT_CHECK_POSTCONDITION</span>
+<span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">int</span> <span class="identifier">ZERO</span><span class="special">&gt;</span>
+<span class="keyword">struct</span> <span class="identifier">contract_abs_total_vector_</span><span class="special">:</span> <span class="identifier">contract</span><span class="special">::</span><span class="identifier">nonmember_function</span><span class="special">&lt;</span>
+ <span class="comment">// Still use `function` but no class type pointer as 1st argument.</span>
+ <span class="keyword">double</span> <span class="special">(</span><span class="keyword">const</span> <span class="identifier">myvector</span><span class="special">&lt;</span><span class="keyword">double</span><span class="special">&gt;&amp;)</span>
+ <span class="special">&gt;</span> <span class="special">{</span>
+ <span class="identifier">contract_abs_total_vector_</span><span class="special">():</span> <span class="identifier">contract</span><span class="special">::</span><span class="identifier">nonmember_function</span><span class="special">&lt;</span>
+ <span class="keyword">double</span> <span class="special">(</span><span class="keyword">const</span> <span class="identifier">myvector</span><span class="special">&lt;</span><span class="keyword">double</span><span class="special">&gt;&amp;)&gt;</span>
+ <span class="special">(</span> <span class="special">&amp;</span><span class="identifier">contract_body_abs_total_</span>
+<span class="preprocessor">#if</span> <span class="identifier">defined</span> <span class="identifier">CONTRACT_CHECK_PRECONDITION</span>
+ <span class="special">,</span> <span class="special">&amp;</span><span class="identifier">contract_precondition_abs_total_vector_</span>
+<span class="preprocessor">#endif</span> <span class="comment">// preconditions</span>
+<span class="preprocessor">#if</span> <span class="identifier">defined</span> <span class="identifier">CONTRACT_CHECK_POSTCONDITION</span>
+ <span class="special">,</span> <span class="special">&amp;</span><span class="identifier">contract_postcondition_abs_total_vector_</span>
+<span class="preprocessor">#endif</span> <span class="comment">// postconditions</span>
+ <span class="special">)</span> <span class="special">{}</span>
+<span class="special">};</span>
+<span class="comment">// Contracted function defined last and always `inline`.</span>
+<span class="keyword">inline</span> <span class="keyword">double</span> <span class="identifier">abs_total</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">myvector</span><span class="special">&lt;</span><span class="keyword">double</span><span class="special">&gt;&amp;</span> <span class="identifier">vector</span><span class="special">)</span> <span class="special">{</span>
+ <span class="keyword">return</span> <span class="identifier">contract_abs_total_vector_</span><span class="special">&lt;</span><span class="number">0</span><span class="special">&gt;().</span><span class="identifier">call</span><span class="special">(</span><span class="identifier">vector</span><span class="special">);</span>
+<span class="special">}</span>
+<span class="preprocessor">#endif</span> <span class="comment">// preconditions or postconditions</span>
+
+</pre>
+<p>
+ </p>
+</div>
+<div class="footnotes">
+<br><hr width="100" align="left">
+<div class="footnote"><p><sup>[<a id="ftn.id913594" href="#id913594" class="para">16</a>] </sup>
+ A more natural syntax would have been to use C++ function pointer
+ types because they already provide a syntax for non-member functions
+ <span class="emphasis"><em>result-type</em></span><code class="computeroutput"> <span class="special">(*)(</span></code><span class="emphasis"><em>argument-type1</em></span><code class="computeroutput"><span class="special">,</span> <span class="special">...)</span></code>
+ and a different syntax for member function <span class="emphasis"><em>result-type</em></span><code class="computeroutput">
+ <span class="special">(</span></code><span class="emphasis"><em>class-type</em></span><code class="computeroutput"><span class="special">::*)(</span></code><span class="emphasis"><em>argument-type1</em></span>,<code class="computeroutput">
+ <span class="special">...)</span></code>. However, the use
+ of function pointer types to resolve partial template specializations
+ (as needed by this library) it not fully supported by all compilers
+ (notably MVSC 8.0 has issues in resolving template specializations
+ between void constant and non-void constant member functions
+ using function pointer types). Therefore, the Boost.Function
+ preferred syntax was adopted for this library (also this harmonizes
+ this library more with the Boost
+ libraries). The Boost.Function
+ portable syntax was not used because it is maintained by Boost.Function
+ for backward compatibility only and it is not recommended (even
+ if that would have been the most portable syntax across the different
+ compilers, see Boost.Function
+ for more information).
+ </p></div>
+<div class="footnote"><p><sup>[<a id="ftn.id913920" href="#id913920" class="para">17</a>] </sup>
+ However, if the member function is constant it cannot modify
+ the object so there is in principle no need to copy the object
+ value before body execution because the body cannot modify the
+ object in the first place
+ </p></div>
+</div>
+</div>
+<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
+<td align="left"></td>
+<td align="right"><div class="copyright-footer">Copyright &#169; 2009, 2010 Lorenzo Caminiti<p>
+ Distributed under the Contract++ Software License, Version 1.0 (see accompanying
+ file LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="tutorial.html"><img src="../images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../images/home.png" alt="Home"></a><a accesskey="n" href="examples.html"><img src="../images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>

Added: sandbox/contract/libs/contract/doc/html/doc/html/boostbook.css
==============================================================================
--- (empty file)
+++ sandbox/contract/libs/contract/doc/html/doc/html/boostbook.css 2011-06-28 20:54:41 EDT (Tue, 28 Jun 2011)
@@ -0,0 +1,594 @@
+/*=============================================================================
+ Copyright (c) 2004 Joel de Guzman
+ http://spirit.sourceforge.net/
+
+ Distributed under the Boost Software License, Version 1.0. (See accompany-
+ ing file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+=============================================================================*/
+
+/*=============================================================================
+ Body defaults
+=============================================================================*/
+
+ body
+ {
+ margin: 1em;
+ font-family: sans-serif;
+ }
+
+/*=============================================================================
+ Paragraphs
+=============================================================================*/
+
+ p
+ {
+ text-align: left;
+ font-size: 10pt;
+ line-height: 1.15;
+ }
+
+/*=============================================================================
+ Program listings
+=============================================================================*/
+
+ /* Code on paragraphs */
+ p tt.computeroutput
+ {
+ font-size: 9pt;
+ }
+
+ pre.synopsis
+ {
+ font-size: 90%;
+ margin: 1pc 4% 0pc 4%;
+ padding: 0.5pc 0.5pc 0.5pc 0.5pc;
+ }
+
+ .programlisting,
+ .screen
+ {
+ font-size: 9pt;
+ display: block;
+ margin: 1pc 4% 0pc 4%;
+ padding: 0.5pc 0.5pc 0.5pc 0.5pc;
+ }
+
+ /* Program listings in tables don't get borders */
+ td .programlisting,
+ td .screen
+ {
+ margin: 0pc 0pc 0pc 0pc;
+ padding: 0pc 0pc 0pc 0pc;
+ }
+
+/*=============================================================================
+ Headings
+=============================================================================*/
+
+ h1, h2, h3, h4, h5, h6
+ {
+ text-align: left;
+ margin: 1em 0em 0.5em 0em;
+ font-weight: bold;
+ }
+
+ h1 { font: 140% }
+ h2 { font: bold 140% }
+ h3 { font: bold 130% }
+ h4 { font: bold 120% }
+ h5 { font: italic 110% }
+ h6 { font: italic 100% }
+
+ /* Top page titles */
+ title,
+ h1.title,
+ h2.title
+ h3.title,
+ h4.title,
+ h5.title,
+ h6.title,
+ .refentrytitle
+ {
+ font-weight: bold;
+ margin-bottom: 1pc;
+ }
+
+ h1.title { font-size: 140% }
+ h2.title { font-size: 140% }
+ h3.title { font-size: 130% }
+ h4.title { font-size: 120% }
+ h5.title { font-size: 110% }
+ h6.title { font-size: 100% }
+
+ .section h1
+ {
+ margin: 0em 0em 0.5em 0em;
+ font-size: 140%;
+ }
+
+ .section h2 { font-size: 140% }
+ .section h3 { font-size: 130% }
+ .section h4 { font-size: 120% }
+ .section h5 { font-size: 110% }
+ .section h6 { font-size: 100% }
+
+ /* Code on titles */
+ h1 tt.computeroutput { font-size: 140% }
+ h2 tt.computeroutput { font-size: 140% }
+ h3 tt.computeroutput { font-size: 130% }
+ h4 tt.computeroutput { font-size: 120% }
+ h5 tt.computeroutput { font-size: 110% }
+ h6 tt.computeroutput { font-size: 100% }
+
+/*=============================================================================
+ Author
+=============================================================================*/
+
+ h3.author
+ {
+ font-size: 100%
+ }
+
+/*=============================================================================
+ Lists
+=============================================================================*/
+
+ li
+ {
+ font-size: 10pt;
+ line-height: 1.3;
+ }
+
+ /* Unordered lists */
+ ul
+ {
+ text-align: left;
+ }
+
+ /* Ordered lists */
+ ol
+ {
+ text-align: left;
+ }
+
+/*=============================================================================
+ Links
+=============================================================================*/
+
+ a
+ {
+ text-decoration: none; /* no underline */
+ }
+
+ a:hover
+ {
+ text-decoration: underline;
+ }
+
+/*=============================================================================
+ Spirit style navigation
+=============================================================================*/
+
+ .spirit-nav
+ {
+ text-align: right;
+ }
+
+ .spirit-nav a
+ {
+ color: white;
+ padding-left: 0.5em;
+ }
+
+ .spirit-nav img
+ {
+ border-width: 0px;
+ }
+
+/*=============================================================================
+ Copyright footer
+=============================================================================*/
+ .copyright-footer
+ {
+ text-align: right;
+ font-size: 70%;
+ }
+
+ .copyright-footer p
+ {
+ text-align: right;
+ font-size: 80%;
+ }
+
+/*=============================================================================
+ Table of contents
+=============================================================================*/
+
+ .toc
+ {
+ margin: 1pc 4% 0pc 4%;
+ padding: 0.1pc 1pc 0.1pc 1pc;
+ font-size: 80%;
+ line-height: 1.15;
+ }
+
+ .boost-toc
+ {
+ float: right;
+ padding: 0.5pc;
+ }
+
+/*=============================================================================
+ Tables
+=============================================================================*/
+
+ .table-title,
+ div.table p.title
+ {
+ margin-left: 4%;
+ padding-right: 0.5em;
+ padding-left: 0.5em;
+ }
+
+ .informaltable table,
+ .table table
+ {
+ width: 92%;
+ margin-left: 4%;
+ margin-right: 4%;
+ }
+
+ div.informaltable table,
+ div.table table
+ {
+ padding: 4px;
+ }
+
+ /* Table Cells */
+ div.informaltable table tr td,
+ div.table table tr td
+ {
+ padding: 0.5em;
+ text-align: left;
+ font-size: 9pt;
+ }
+
+ div.informaltable table tr th,
+ div.table table tr th
+ {
+ padding: 0.5em 0.5em 0.5em 0.5em;
+ border: 1pt solid white;
+ font-size: 80%;
+ }
+
+ table.simplelist
+ {
+ width: auto !important;
+ margin: 0em !important;
+ padding: 0em !important;
+ border: none !important;
+ }
+ table.simplelist td
+ {
+ margin: 0em !important;
+ padding: 0em !important;
+ text-align: left !important;
+ font-size: 9pt !important;
+ border: none !important;
+ }
+
+/*=============================================================================
+ Blurbs
+=============================================================================*/
+
+ div.note,
+ div.tip,
+ div.important,
+ div.caution,
+ div.warning,
+ p.blurb
+ {
+ font-size: 9pt; /* A little bit smaller than the main text */
+ line-height: 1.2;
+ display: block;
+ margin: 1pc 4% 0pc 4%;
+ padding: 0.5pc 0.5pc 0.5pc 0.5pc;
+ }
+
+ p.blurb img
+ {
+ padding: 1pt;
+ }
+
+/*=============================================================================
+ Variable Lists
+=============================================================================*/
+
+ div.variablelist
+ {
+ margin: 1em 0;
+ }
+
+ /* Make the terms in definition lists bold */
+ div.variablelist dl dt,
+ span.term
+ {
+ font-weight: bold;
+ font-size: 10pt;
+ }
+
+ div.variablelist table tbody tr td
+ {
+ text-align: left;
+ vertical-align: top;
+ padding: 0em 2em 0em 0em;
+ font-size: 10pt;
+ margin: 0em 0em 0.5em 0em;
+ line-height: 1;
+ }
+
+ div.variablelist dl dt
+ {
+ margin-bottom: 0.2em;
+ }
+
+ div.variablelist dl dd
+ {
+ margin: 0em 0em 0.5em 2em;
+ font-size: 10pt;
+ }
+
+ div.variablelist table tbody tr td p,
+ div.variablelist dl dd p
+ {
+ margin: 0em 0em 0.5em 0em;
+ line-height: 1;
+ }
+
+/*=============================================================================
+ Misc
+=============================================================================*/
+
+ /* Title of books and articles in bibliographies */
+ span.title
+ {
+ font-style: italic;
+ }
+
+ span.underline
+ {
+ text-decoration: underline;
+ }
+
+ span.strikethrough
+ {
+ text-decoration: line-through;
+ }
+
+ /* Copyright, Legal Notice */
+ div div.legalnotice p
+ {
+ text-align: left
+ }
+
+/*=============================================================================
+ Colors
+=============================================================================*/
+
+ @media screen
+ {
+ body {
+ background-color: #FFFFFF;
+ color: #000000;
+ }
+
+ /* Links */
+ a
+ {
+ color: #005a9c;
+ }
+
+ a:visited
+ {
+ color: #9c5a9c;
+ }
+
+ h1 a, h2 a, h3 a, h4 a, h5 a, h6 a,
+ h1 a:hover, h2 a:hover, h3 a:hover, h4 a:hover, h5 a:hover, h6 a:hover,
+ h1 a:visited, h2 a:visited, h3 a:visited, h4 a:visited, h5 a:visited, h6 a:visited
+ {
+ text-decoration: none; /* no underline */
+ color: #000000;
+ }
+
+ /* Syntax Highlighting */
+ .keyword { color: #0000AA; }
+ .identifier { color: #000000; }
+ .special { color: #707070; }
+ .preprocessor { color: #402080; }
+ .char { color: teal; }
+ .comment { color: #800000; }
+ .string { color: teal; }
+ .number { color: teal; }
+ .white_bkd { background-color: #FFFFFF; }
+ .dk_grey_bkd { background-color: #999999; }
+
+ /* Copyright, Legal Notice */
+ .copyright
+ {
+ color: #666666;
+ font-size: small;
+ }
+
+ div div.legalnotice p
+ {
+ color: #666666;
+ }
+
+ /* Program listing */
+ pre.synopsis
+ {
+ border: 1px solid #DCDCDC;
+ }
+
+ .programlisting,
+ .screen
+ {
+ border: 1px solid #DCDCDC;
+ }
+
+ td .programlisting,
+ td .screen
+ {
+ border: 0px solid #DCDCDC;
+ }
+
+ /* Blurbs */
+ div.note,
+ div.tip,
+ div.important,
+ div.caution,
+ div.warning,
+ p.blurb
+ {
+ border: 1px solid #DCDCDC;
+ }
+
+ /* Table of contents */
+ .toc
+ {
+ border: 1px solid #DCDCDC;
+ }
+
+ /* Tables */
+ div.informaltable table tr td,
+ div.table table tr td
+ {
+ border: 1px solid #DCDCDC;
+ }
+
+ div.informaltable table tr th,
+ div.table table tr th
+ {
+ background-color: #F0F0F0;
+ border: 1px solid #DCDCDC;
+ }
+
+ .copyright-footer
+ {
+ color: #8F8F8F;
+ }
+
+ /* Misc */
+ span.highlight
+ {
+ color: #00A000;
+ }
+ }
+
+ @media print
+ {
+ /* Links */
+ a
+ {
+ color: black;
+ }
+
+ a:visited
+ {
+ color: black;
+ }
+
+ .spirit-nav
+ {
+ display: none;
+ }
+
+ /* Program listing */
+ pre.synopsis
+ {
+ border: 1px solid gray;
+ }
+
+ .programlisting,
+ .screen
+ {
+ border: 1px solid gray;
+ }
+
+ td .programlisting,
+ td .screen
+ {
+ border: 0px solid #DCDCDC;
+ }
+
+ /* Table of contents */
+ .toc
+ {
+ border: 1px solid gray;
+ }
+
+ .informaltable table,
+ .table table
+ {
+ border: 1px solid gray;
+ border-collapse: collapse;
+ }
+
+ /* Tables */
+ div.informaltable table tr td,
+ div.table table tr td
+ {
+ border: 1px solid gray;
+ }
+
+ div.informaltable table tr th,
+ div.table table tr th
+ {
+ border: 1px solid gray;
+ }
+
+ table.simplelist tr td
+ {
+ border: none !important;
+ }
+
+ /* Misc */
+ span.highlight
+ {
+ font-weight: bold;
+ }
+ }
+
+/*=============================================================================
+ Images
+=============================================================================*/
+
+ span.inlinemediaobject img
+ {
+ vertical-align: middle;
+ }
+
+/*==============================================================================
+ Super and Subscript: style so that line spacing isn't effected, see
+ http://www.adobe.com/cfusion/communityengine/index.cfm?event=showdetails&productId=1&postId=5341
+==============================================================================*/
+
+sup,
+sub {
+ height: 0;
+ line-height: 1;
+ vertical-align: baseline;
+ _vertical-align: bottom;
+ position: relative;
+
+}
+
+sup {
+ bottom: 1ex;
+}
+
+sub {
+ top: .5ex;
+}
+

Added: sandbox/contract/libs/contract/doc/html/doc/html/images/alert.png
==============================================================================
Binary file. No diff available.

Added: sandbox/contract/libs/contract/doc/html/doc/html/images/blank.png
==============================================================================
Binary file. No diff available.

Added: sandbox/contract/libs/contract/doc/html/doc/html/images/caution.png
==============================================================================
Binary file. No diff available.

Added: sandbox/contract/libs/contract/doc/html/doc/html/images/draft.png
==============================================================================
Binary file. No diff available.

Added: sandbox/contract/libs/contract/doc/html/doc/html/images/home.png
==============================================================================
Binary file. No diff available.

Added: sandbox/contract/libs/contract/doc/html/doc/html/images/important.png
==============================================================================
Binary file. No diff available.

Added: sandbox/contract/libs/contract/doc/html/doc/html/images/next.png
==============================================================================
Binary file. No diff available.

Added: sandbox/contract/libs/contract/doc/html/doc/html/images/next_disabled.png
==============================================================================
Binary file. No diff available.

Added: sandbox/contract/libs/contract/doc/html/doc/html/images/note.png
==============================================================================
Binary file. No diff available.

Added: sandbox/contract/libs/contract/doc/html/doc/html/images/prev.png
==============================================================================
Binary file. No diff available.

Added: sandbox/contract/libs/contract/doc/html/doc/html/images/prev_disabled.png
==============================================================================
Binary file. No diff available.

Added: sandbox/contract/libs/contract/doc/html/doc/html/images/smiley.png
==============================================================================
Binary file. No diff available.

Added: sandbox/contract/libs/contract/doc/html/doc/html/images/tip.png
==============================================================================
Binary file. No diff available.

Added: sandbox/contract/libs/contract/doc/html/doc/html/images/toc-blank.png
==============================================================================
Binary file. No diff available.

Added: sandbox/contract/libs/contract/doc/html/doc/html/images/toc-minus.png
==============================================================================
Binary file. No diff available.

Added: sandbox/contract/libs/contract/doc/html/doc/html/images/toc-plus.png
==============================================================================
Binary file. No diff available.

Added: sandbox/contract/libs/contract/doc/html/doc/html/images/up.png
==============================================================================
Binary file. No diff available.

Added: sandbox/contract/libs/contract/doc/html/doc/html/images/up_disabled.png
==============================================================================
Binary file. No diff available.

Added: sandbox/contract/libs/contract/doc/html/doc/html/images/warning.png
==============================================================================
Binary file. No diff available.

Added: sandbox/contract/libs/contract/doc/html/doc/src/images/callouts/1.png
==============================================================================
Binary file. No diff available.


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk