Skip to content

Commit 273526b

Browse files
committed
various documentation corrections
1 parent 82bf435 commit 273526b

26 files changed

+290
-479
lines changed

doc/boostbook/motor.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
<section>
2424
<title>How a Stepper Motor Works</title>
2525

26-
<figure float="1">
26+
<figure float="0">
2727
<title>Stepper Motor</title>
2828

2929
<mediaobject>

doc/boostbook/safe.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@
123123
<entry><link linkend="safe_numerics.numeric"><link
124124
linkend="safe_numerics.promotion_policy">PromotionPolicy&lt;PP&gt;</link></link></entry>
125125

126-
<entry><para>Default value is <link
126+
<entry><para>Optional promotion policy. Default value is <link
127127
linkend="safe_numerics.promotion_policies.native"><code>boost::numeric::native</code></link></para></entry>
128128
</row>
129129

@@ -134,7 +134,7 @@
134134
linkend="safe_numerics.exception_policy">Exception
135135
Policy&lt;EP&gt;</link></link></entry>
136136

137-
<entry><para>Default value is <link
137+
<entry><para>Optional exception policy. Default value is <link
138138
linkend="safe_numerics.exception_policies.default_exception_policy"><code>boost::numeric::default_exception_policy</code></link></para></entry>
139139
</row>
140140
</tbody>

doc/boostbook/safe_literal.xml

Lines changed: 10 additions & 119 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,8 @@
9696
<entry><link linkend="safe_numerics.numeric"><link
9797
linkend="safe_numerics.promotion_policy">PromotionPolicy&lt;PP&gt;</link></link></entry>
9898

99-
<entry><para>Default value is <code>void</code></para></entry>
99+
<entry><para>Optional promotion policy. Default value is
100+
<code>void</code></para></entry>
100101
</row>
101102

102103
<row>
@@ -106,7 +107,8 @@
106107
linkend="safe_numerics.exception_policy">Exception
107108
Policy&lt;EP&gt;</link></link></entry>
108109

109-
<entry><para>Default value is <code>void</code></para></entry>
110+
<entry><para>Optional exception policy. Default value is
111+
<code>void</code></para></entry>
110112
</row>
111113
</tbody>
112114
</tgroup>
@@ -117,9 +119,9 @@
117119
<title>Inherited Valid Expressions</title>
118120

119121
<para>safe literal types are immutable. Hence they only inherit those
120-
valid expressions which don't change the value. This excludes assignment,
121-
increment, and decrement and all unary operators except unary -, + and ~.
122-
Other than that, they can be used anywhere a <link
122+
valid expressions which don't change the value. <emphasis>This excludes
123+
assignment, increment, and decrement and all unary operators except unary
124+
-, + and ~</emphasis>. Other than that, they can be used anywhere a <link
123125
linkend="safe_numerics.safe_numeric_concept">SafeNumeric</link> type can
124126
be used. Note that the default promotion and exception policies are void.
125127
This is usually convenient since when a safe literal is used in a binary
@@ -145,121 +147,10 @@ constexpr safe&lt;int&gt; z = x / y;
145147
</programlisting></para>
146148
</section>
147149

148-
<section>
149-
<title>Valid Expression</title>
150-
151-
<para><informaltable>
152-
<tgroup cols="3">
153-
<colspec align="left" colwidth="1*"/>
154-
155-
<colspec align="left" colwidth="1*"/>
156-
157-
<colspec align="left" colwidth="3*"/>
158-
159-
<thead>
160-
<row>
161-
<entry align="left">Expression</entry>
162-
163-
<entry align="left">Result Type</entry>
164-
165-
<entry>Description</entry>
166-
</row>
167-
</thead>
168-
169-
<tbody>
170-
<row>
171-
<entry><code>t op s</code></entry>
172-
173-
<entry>unspecified S</entry>
174-
175-
<entry><para>invoke C++ operator op and return another
176-
SafeNumeric type.</para></entry>
177-
</row>
178-
179-
<row>
180-
<entry><code>s1 op s2</code></entry>
181-
182-
<entry>unspecified S</entry>
183-
184-
<entry><para>invoke C++ operator op and return another
185-
SafeNumeric type.</para></entry>
186-
</row>
187-
188-
<row>
189-
<entry><code>prefix_op S</code></entry>
190-
191-
<entry>unspecified S</entry>
192-
193-
<entry><para>invoke C++ operator <code>prefix_op</code> and
194-
return another SafeNumeric type.</para></entry>
195-
</row>
196-
197-
<row>
198-
<entry><code>S postfix_op</code></entry>
199-
200-
<entry>unspecified S</entry>
201-
202-
<entry><para>invoke C++ operator <code>postfix_op</code> and
203-
return another SafeNumeric type.</para></entry>
204-
</row>
205-
206-
<row>
207-
<entry><code>s assign_op t</code></entry>
208-
209-
<entry>S1</entry>
210-
211-
<entry><para>convert t to type S and assign it to s. If the
212-
value t cannot be represented as an instance of type S, it is an
213-
error.</para></entry>
214-
</row>
215-
216-
<row>
217-
<entry><code>S(t)</code></entry>
218-
219-
<entry>unspecified S</entry>
220-
221-
<entry><para>construct an instance of S from a value of type T.
222-
If the value t cannot be represented as an instance of type S,
223-
it is an error.</para></entry>
224-
</row>
225-
226-
<row>
227-
<entry><code>S</code></entry>
228-
229-
<entry>S</entry>
230-
231-
<entry><para>construct an uninitialized instance of
232-
S.</para></entry>
233-
</row>
234-
235-
<row>
236-
<entry><code>is_safe&lt;S&gt;</code></entry>
237-
238-
<entry><code>std::true_type</code> or
239-
<code>std::false_type</code></entry>
240-
241-
<entry><para>type trait to query whether any type S fulfills the
242-
requirements for a SafeNumeric type.</para></entry>
243-
</row>
244-
245-
<row>
246-
<entry><code>static_cast&lt;T&gt;(s)</code></entry>
247-
248-
<entry>T</entry>
249-
250-
<entry><para>convert the value of s to type T. If the value of s
251-
cannot be correctly represented as a type T, it is an error.
252-
</para></entry>
253-
</row>
254-
</tbody>
255-
</tgroup>
256-
</informaltable></para>
257-
</section>
258-
259150
<section>
260151
<title>Example of use</title>
261152

262-
<programlisting>#include &lt;boost/numeric/safe_numerics/safe_literal.hpp&gt;
153+
<programlisting><ulink url="../../include/safe_integer_literal.hpp">#include &lt;boost/numeric/safe_numerics/safe_integer_literal.hpp&gt;</ulink>
263154

264155
constexpr boost::numeric::safe_signed_literal&lt;42&gt; x;
265156
</programlisting>
@@ -276,7 +167,7 @@ constexpr boost::numeric::safe_signed_literal&lt;42&gt; x;
276167
<section>
277168
<title>Header</title>
278169

279-
<para><ulink url="../../include/safe_literal.hpp">#include
280-
&lt;boost/numeric/safe_numerics/safe_literal.hpp&gt;</ulink></para>
170+
<para><ulink url="../../include/safe_integer_literal.hpp">#include
171+
&lt;boost/numeric/safe_numerics/safe_integer_literal.hpp&gt;</ulink></para>
281172
</section>
282173
</section>

doc/html/bibliography.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
<a name="safe_numerics.bibliography"></a>Bibliography</h2></div></div></div>
2222
<div class="bibliography">
2323
<div class="titlepage"><div><div><h3 class="title">
24-
<a name="idm450398272592"></a>Bibliography</h3></div></div></div>
24+
<a name="idm63514675872"></a>Bibliography</h3></div></div></div>
2525
<div class="biblioentry">
2626
<a name="coker"></a><p>[<abbr class="abbrev">Coker</abbr>] <span class="author"><span class="firstname">Zack</span> <span class="surname">Coker</span>. </span><span class="author"><span class="firstname">Samir</span> <span class="surname">Hasan</span>. </span><span class="author"><span class="firstname">Jeffrey</span> <span class="surname">Overbey</span>. </span><span class="author"><span class="firstname">Munawar</span> <span class="surname">Hafiz</span>. </span><span class="author"><span class="firstname">Christian</span> <span class="surname">K&#228;stner</span>. </span><span class="title"><i>
2727
<a href="http://www.cert.org/secure-coding/publications/books/secure-coding-c-c-second-edition.cfm?" target="_top">

doc/html/checked_arithmetic.html

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -21,43 +21,43 @@
2121
<div class="titlepage"><div><div><h3 class="title">
2222
<a name="safe_numerics.checked_arithmetic"></a>Checked Arithmetic</h3></div></div></div>
2323
<div class="toc"><dl class="toc">
24-
<dt><span class="section"><a href="checked_arithmetic.html#idm450399112032">Description</a></span></dt>
25-
<dt><span class="section"><a href="checked_arithmetic.html#idm450399110704">Type requirements</a></span></dt>
26-
<dt><span class="section"><a href="checked_arithmetic.html#idm450399108704">Complexity</a></span></dt>
27-
<dt><span class="section"><a href="checked_arithmetic.html#idm450399107552">Example of use</a></span></dt>
28-
<dt><span class="section"><a href="checked_arithmetic.html#idm450399090288">Notes</a></span></dt>
29-
<dt><span class="section"><a href="checked_arithmetic.html#idm450399088720">Synopsis</a></span></dt>
30-
<dt><span class="section"><a href="checked_arithmetic.html#idm450398844080">See Also</a></span></dt>
31-
<dt><span class="section"><a href="checked_arithmetic.html#idm450398842352">Header</a></span></dt>
24+
<dt><span class="section"><a href="checked_arithmetic.html#idm63514893328">Description</a></span></dt>
25+
<dt><span class="section"><a href="checked_arithmetic.html#idm63514892000">Type requirements</a></span></dt>
26+
<dt><span class="section"><a href="checked_arithmetic.html#idm63514890000">Complexity</a></span></dt>
27+
<dt><span class="section"><a href="checked_arithmetic.html#idm63514888848">Example of use</a></span></dt>
28+
<dt><span class="section"><a href="checked_arithmetic.html#idm63514871584">Notes</a></span></dt>
29+
<dt><span class="section"><a href="checked_arithmetic.html#idm63514869616">Synopsis</a></span></dt>
30+
<dt><span class="section"><a href="checked_arithmetic.html#idm63523346416">See Also</a></span></dt>
31+
<dt><span class="section"><a href="checked_arithmetic.html#idm63523344912">Header</a></span></dt>
3232
</dl></div>
3333
<div class="section">
3434
<div class="titlepage"><div><div><h4 class="title">
35-
<a name="idm450399112032"></a>Description</h4></div></div></div>
35+
<a name="idm63514893328"></a>Description</h4></div></div></div>
3636
<p>Perform binary operations on arithmetic types. Return either a valid
3737
result or an error code. Under no circumstances should an incorrect result
3838
be returned.</p>
3939
</div>
4040
<div class="section">
4141
<div class="titlepage"><div><div><h4 class="title">
42-
<a name="idm450399110704"></a>Type requirements</h4></div></div></div>
42+
<a name="idm63514892000"></a>Type requirements</h4></div></div></div>
4343
<p>All template parameters of the functions must model <a class="link" href="integer.html" title="Integer&lt;T&gt;">Numeric</a> type requirements.</p>
4444
</div>
4545
<div class="section">
4646
<div class="titlepage"><div><div><h4 class="title">
47-
<a name="idm450399108704"></a>Complexity</h4></div></div></div>
47+
<a name="idm63514890000"></a>Complexity</h4></div></div></div>
4848
<p>Each function performs one and only one arithmetic operation.</p>
4949
</div>
5050
<div class="section">
5151
<div class="titlepage"><div><div><h4 class="title">
52-
<a name="idm450399107552"></a>Example of use</h4></div></div></div>
52+
<a name="idm63514888848"></a>Example of use</h4></div></div></div>
5353
<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">numeric</span><span class="special">/</span><span class="identifier">safe_numerics</span><span class="special">/</span><span class="identifier">checked_default</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span>
5454

5555
<span class="identifier">checked_result</span><span class="special">&lt;</span><span class="keyword">int</span><span class="special">&gt;</span> <span class="identifier">r</span> <span class="special">=</span> <span class="identifier">checked</span><span class="special">::</span><span class="identifier">multiply</span><span class="special">&lt;</span><span class="keyword">int</span><span class="special">&gt;</span><span class="special">(</span><span class="number">24</span><span class="special">,</span> <span class="number">42</span><span class="special">)</span><span class="special">;</span>
5656
</pre>
5757
</div>
5858
<div class="section">
5959
<div class="titlepage"><div><div><h4 class="title">
60-
<a name="idm450399090288"></a>Notes</h4></div></div></div>
60+
<a name="idm63514871584"></a>Notes</h4></div></div></div>
6161
<p>Some compilers have command line switches (e.g. -ftrapv) which
6262
enable special behavior such that erroneous integer operations are
6363
detected at run time. The library has been implemented in such a way that
@@ -67,7 +67,7 @@
6767
</div>
6868
<div class="section">
6969
<div class="titlepage"><div><div><h4 class="title">
70-
<a name="idm450399088720"></a>Synopsis</h4></div></div></div>
70+
<a name="idm63514869616"></a>Synopsis</h4></div></div></div>
7171
<pre class="programlisting"><span class="comment">// safe casting on primitive types</span>
7272
<span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">R</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">T</span><span class="special">&gt;</span>
7373
<span class="identifier">checked_result</span><span class="special">&lt;</span><span class="identifier">R</span><span class="special">&gt;</span> <span class="keyword">constexpr</span> <span class="identifier">checked</span><span class="special">::</span><span class="identifier">cast</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">T</span> <span class="special">&amp;</span> <span class="identifier">t</span><span class="special">)</span><span class="special">;</span>
@@ -133,12 +133,12 @@
133133
</div>
134134
<div class="section">
135135
<div class="titlepage"><div><div><h4 class="title">
136-
<a name="idm450398844080"></a>See Also</h4></div></div></div>
136+
<a name="idm63523346416"></a>See Also</h4></div></div></div>
137137
<p><a class="link" href="checked_result.html" title="checked_result&lt;R&gt;">checked_result&lt;R&gt;</a></p>
138138
</div>
139139
<div class="section">
140140
<div class="titlepage"><div><div><h4 class="title">
141-
<a name="idm450398842352"></a>Header</h4></div></div></div>
141+
<a name="idm63523344912"></a>Header</h4></div></div></div>
142142
<p><a href="../../include/checked.hpp" target="_top"><code class="computeroutput">#include
143143
&lt;boost/numeric/safe_numerics/checked_default.hpp&gt;
144144
</code></a></p>

doc/html/checked_integer_arithmetic.html

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -21,16 +21,16 @@
2121
<div class="titlepage"><div><div><h3 class="title">
2222
<a name="safe_numerics.checked_integer_arithmetic"></a>safe_compare&lt;T, U&gt;</h3></div></div></div>
2323
<div class="toc"><dl class="toc">
24-
<dt><span class="section"><a href="checked_integer_arithmetic.html#idm450398629472">Synopsis</a></span></dt>
25-
<dt><span class="section"><a href="checked_integer_arithmetic.html#idm450398541296">Description</a></span></dt>
26-
<dt><span class="section"><a href="checked_integer_arithmetic.html#idm450398533952">Type requirements</a></span></dt>
27-
<dt><span class="section"><a href="checked_integer_arithmetic.html#idm450398530448">Complexity</a></span></dt>
28-
<dt><span class="section"><a href="checked_integer_arithmetic.html#idm450398529216">Example of use</a></span></dt>
29-
<dt><span class="section"><a href="checked_integer_arithmetic.html#idm450398498560">Header</a></span></dt>
24+
<dt><span class="section"><a href="checked_integer_arithmetic.html#idm63523147904">Synopsis</a></span></dt>
25+
<dt><span class="section"><a href="checked_integer_arithmetic.html#idm63523063424">Description</a></span></dt>
26+
<dt><span class="section"><a href="checked_integer_arithmetic.html#idm63523056992">Type requirements</a></span></dt>
27+
<dt><span class="section"><a href="checked_integer_arithmetic.html#idm63523053824">Complexity</a></span></dt>
28+
<dt><span class="section"><a href="checked_integer_arithmetic.html#idm63523052608">Example of use</a></span></dt>
29+
<dt><span class="section"><a href="checked_integer_arithmetic.html#idm63523023200">Header</a></span></dt>
3030
</dl></div>
3131
<div class="section">
3232
<div class="titlepage"><div><div><h4 class="title">
33-
<a name="idm450398629472"></a>Synopsis</h4></div></div></div>
33+
<a name="idm63523147904"></a>Synopsis</h4></div></div></div>
3434
<pre class="programlisting"><span class="comment">// compare any pair of integers</span>
3535
<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">U</span><span class="special">&gt;</span>
3636
<span class="keyword">bool</span> <span class="keyword">constexpr</span> <span class="identifier">safe_compare</span><span class="special">::</span><span class="identifier">less_than</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">T</span> <span class="special">&amp;</span> <span class="identifier">lhs</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">U</span> <span class="special">&amp;</span> <span class="identifier">rhs</span><span class="special">)</span><span class="special">;</span>
@@ -52,7 +52,7 @@
5252
</div>
5353
<div class="section">
5454
<div class="titlepage"><div><div><h4 class="title">
55-
<a name="idm450398541296"></a>Description</h4></div></div></div>
55+
<a name="idm63523063424"></a>Description</h4></div></div></div>
5656
<p>Compare two primitive integers. These functions will return a
5757
correct result regardless of the type of the operands. Specifically it is
5858
guaranteed to return the correct arithmetic result when comparing signed
@@ -67,19 +67,19 @@
6767
</div>
6868
<div class="section">
6969
<div class="titlepage"><div><div><h4 class="title">
70-
<a name="idm450398533952"></a>Type requirements</h4></div></div></div>
70+
<a name="idm63523056992"></a>Type requirements</h4></div></div></div>
7171
<p>All template parameters of the functions must be C/C++ built-in
7272
integer types, <code class="computeroutput"><code class="computeroutput">char</code></code>,
7373
<code class="computeroutput"><code class="computeroutput">int</code></code> ....</p>
7474
</div>
7575
<div class="section">
7676
<div class="titlepage"><div><div><h4 class="title">
77-
<a name="idm450398530448"></a>Complexity</h4></div></div></div>
77+
<a name="idm63523053824"></a>Complexity</h4></div></div></div>
7878
<p>Each function performs one and only one arithmetic operation.</p>
7979
</div>
8080
<div class="section">
8181
<div class="titlepage"><div><div><h4 class="title">
82-
<a name="idm450398529216"></a>Example of use</h4></div></div></div>
82+
<a name="idm63523052608"></a>Example of use</h4></div></div></div>
8383
<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">cassert</span><span class="special">&gt;</span>
8484
<span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">safe_compare</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span>
8585

@@ -92,7 +92,7 @@
9292
</div>
9393
<div class="section">
9494
<div class="titlepage"><div><div><h4 class="title">
95-
<a name="idm450398498560"></a>Header</h4></div></div></div>
95+
<a name="idm63523023200"></a>Header</h4></div></div></div>
9696
<p><a href="../../include/safe_compare.hpp" target="_top"><code class="computeroutput">#include
9797
&lt;boost/numeric/safe_numerics/safe_compare.hpp&gt;
9898
</code></a></p>

0 commit comments

Comments
 (0)