[29] | 1 | <html> |
---|
| 2 | <head> |
---|
| 3 | <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> |
---|
| 4 | <title>Concept SignedInteger</title> |
---|
| 5 | <link rel="stylesheet" href="boostbook.css" type="text/css"> |
---|
| 6 | <meta name="generator" content="DocBook XSL Stylesheets V1.68.1"> |
---|
| 7 | <link rel="start" href="index.html" title="The Boost C++ Libraries BoostBook Documentation Subset"> |
---|
| 8 | <link rel="up" href="id620092-bb.html#concepts.reference" title="Concept reference"> |
---|
| 9 | <link rel="prev" href="LessThanComparable.html" title="Concept LessThanComparable"> |
---|
| 10 | <link rel="next" href="date_time.html" title="Chapter 4. Boost.Date_Time"> |
---|
| 11 | </head> |
---|
| 12 | <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"> |
---|
| 13 | <table cellpadding="2" width="100%"> |
---|
| 14 | <td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../boost.png"></td> |
---|
| 15 | <td align="center"><a href="../../index.htm">Home</a></td> |
---|
| 16 | <td align="center"><a href="../../libs/libraries.htm">Libraries</a></td> |
---|
| 17 | <td align="center"><a href="../../people/people.htm">People</a></td> |
---|
| 18 | <td align="center"><a href="../../more/faq.htm">FAQ</a></td> |
---|
| 19 | <td align="center"><a href="../../more/index.htm">More</a></td> |
---|
| 20 | </table> |
---|
| 21 | <hr> |
---|
| 22 | <div class="spirit-nav"> |
---|
| 23 | <a accesskey="p" href="LessThanComparable.html"><img src="images/prev.png" alt="Prev"></a><a accesskey="u" href="id620092-bb.html#concepts.reference"><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="date_time.html"><img src="images/next.png" alt="Next"></a> |
---|
| 24 | </div> |
---|
| 25 | <div class="refentry" lang="en"> |
---|
| 26 | <a name="SignedInteger"></a><div class="titlepage"></div> |
---|
| 27 | <div class="refnamediv"> |
---|
| 28 | <h2><span class="refentrytitle">Concept SignedInteger</span></h2> |
---|
| 29 | <p>SignedInteger</p> |
---|
| 30 | </div> |
---|
| 31 | <div class="refsect1" lang="en"> |
---|
| 32 | <a name="id962799"></a><h2>Refinement of</h2> |
---|
| 33 | <div class="itemizedlist"><ul type="disc"> |
---|
| 34 | <li><p><a href="CopyConstructible.html" title="Concept CopyConstructible">CopyConstructible</a></p></li> |
---|
| 35 | <li><p><a href="Assignable.html" title="Concept Assignable">Assignable</a></p></li> |
---|
| 36 | <li><p><a href="DefaultConstructible.html" title="Concept DefaultConstructible">DefaultConstructible</a></p></li> |
---|
| 37 | <li><p><a href="EqualityComparable.html" title="Concept EqualityComparable">EqualityComparable</a></p></li> |
---|
| 38 | <li><p><a href="LessThanComparable.html" title="Concept LessThanComparable">LessThanComparable</a></p></li> |
---|
| 39 | </ul></div> |
---|
| 40 | </div> |
---|
| 41 | <div class="refsect1" lang="en"> |
---|
| 42 | <a name="id962845"></a><h2>Notation</h2> |
---|
| 43 | <div class="variablelist"><dl> |
---|
| 44 | <dt><span class="term">T</span></dt> |
---|
| 45 | <dd>A type playing the role of integral-type in the <a href="SignedInteger.html" title="Concept SignedInteger">SignedInteger</a> concept.</dd> |
---|
| 46 | <dt> |
---|
| 47 | <span class="term"><code class="varname">x</code>, </span><span class="term"><code class="varname">y</code>, </span><span class="term"><code class="varname">z</code></span> |
---|
| 48 | </dt> |
---|
| 49 | <dd>Objects of type T</dd> |
---|
| 50 | <dt> |
---|
| 51 | <span class="term"><code class="varname">a</code>, </span><span class="term"><code class="varname">b</code></span> |
---|
| 52 | </dt> |
---|
| 53 | <dd>Objects of type int</dd> |
---|
| 54 | </dl></div> |
---|
| 55 | </div> |
---|
| 56 | <div class="refsect1" lang="en"> |
---|
| 57 | <a name="id962890"></a><h2>Type expressions</h2> |
---|
| 58 | <div class="variablelist"><dl> |
---|
| 59 | <dt><span class="term">Conversion to int</span></dt> |
---|
| 60 | <dd><p><span class="type">T</span> must be |
---|
| 61 | convertible to <span class="type">int</span>. |
---|
| 62 | </p></dd> |
---|
| 63 | </dl></div> |
---|
| 64 | </div> |
---|
| 65 | <div class="refsect1" lang="en"> |
---|
| 66 | <a name="id962909"></a><h2>Valid expressions</h2> |
---|
| 67 | <div class="informaltable"><table class="table"> |
---|
| 68 | <colgroup> |
---|
| 69 | <col> |
---|
| 70 | <col> |
---|
| 71 | <col> |
---|
| 72 | </colgroup> |
---|
| 73 | <thead><tr> |
---|
| 74 | <th>Name</th> |
---|
| 75 | <th>Expression</th> |
---|
| 76 | <th>Type</th> |
---|
| 77 | </tr></thead> |
---|
| 78 | <tbody> |
---|
| 79 | <tr> |
---|
| 80 | <td><p>Conversion from int</p></td> |
---|
| 81 | <td><p>T(a)</p></td> |
---|
| 82 | <td><p><span class="type">T</span></p></td> |
---|
| 83 | </tr> |
---|
| 84 | <tr> |
---|
| 85 | <td><p>Preincrement</p></td> |
---|
| 86 | <td><p>++x</p></td> |
---|
| 87 | <td><p><span class="type">T &</span></p></td> |
---|
| 88 | </tr> |
---|
| 89 | <tr> |
---|
| 90 | <td><p>Predecrement</p></td> |
---|
| 91 | <td><p>--x</p></td> |
---|
| 92 | <td><p><span class="type">T &</span></p></td> |
---|
| 93 | </tr> |
---|
| 94 | <tr> |
---|
| 95 | <td><p>Postincrement</p></td> |
---|
| 96 | <td><p>x++</p></td> |
---|
| 97 | <td><p><span class="type">T</span></p></td> |
---|
| 98 | </tr> |
---|
| 99 | <tr> |
---|
| 100 | <td><p>Postdecrement</p></td> |
---|
| 101 | <td><p>x--</p></td> |
---|
| 102 | <td><p><span class="type">T</span></p></td> |
---|
| 103 | </tr> |
---|
| 104 | <tr> |
---|
| 105 | <td><p>Sum</p></td> |
---|
| 106 | <td><p>x + y</p></td> |
---|
| 107 | <td><p><span class="type">T</span></p></td> |
---|
| 108 | </tr> |
---|
| 109 | <tr> |
---|
| 110 | <td><p>Sum with int</p></td> |
---|
| 111 | <td><p>x + a</p></td> |
---|
| 112 | <td><p><span class="type">T</span></p></td> |
---|
| 113 | </tr> |
---|
| 114 | <tr> |
---|
| 115 | <td><p>Sum-assignment</p></td> |
---|
| 116 | <td><p>x += y</p></td> |
---|
| 117 | <td><p><span class="type">T &</span></p></td> |
---|
| 118 | </tr> |
---|
| 119 | <tr> |
---|
| 120 | <td><p>Sum-assignment with int</p></td> |
---|
| 121 | <td><p>x += a</p></td> |
---|
| 122 | <td><p><span class="type">T &</span></p></td> |
---|
| 123 | </tr> |
---|
| 124 | <tr> |
---|
| 125 | <td><p>Difference</p></td> |
---|
| 126 | <td><p>x - y</p></td> |
---|
| 127 | <td><p><span class="type">T</span></p></td> |
---|
| 128 | </tr> |
---|
| 129 | <tr> |
---|
| 130 | <td><p>Difference with int</p></td> |
---|
| 131 | <td><p>x - a</p></td> |
---|
| 132 | <td><p><span class="type">T</span></p></td> |
---|
| 133 | </tr> |
---|
| 134 | <tr> |
---|
| 135 | <td><p>Product</p></td> |
---|
| 136 | <td><p>x * y</p></td> |
---|
| 137 | <td><p><span class="type">T</span></p></td> |
---|
| 138 | </tr> |
---|
| 139 | <tr> |
---|
| 140 | <td><p>Product with int</p></td> |
---|
| 141 | <td><p>x * a</p></td> |
---|
| 142 | <td><p><span class="type">T</span></p></td> |
---|
| 143 | </tr> |
---|
| 144 | <tr> |
---|
| 145 | <td><p>Product-assignment with int</p></td> |
---|
| 146 | <td><p>x *= a</p></td> |
---|
| 147 | <td><p><span class="type">T &</span></p></td> |
---|
| 148 | </tr> |
---|
| 149 | <tr> |
---|
| 150 | <td><p>Product with int on left</p></td> |
---|
| 151 | <td><p>a * x</p></td> |
---|
| 152 | <td><p><span class="type">T</span></p></td> |
---|
| 153 | </tr> |
---|
| 154 | <tr> |
---|
| 155 | <td><p>Quotient</p></td> |
---|
| 156 | <td><p>x / y</p></td> |
---|
| 157 | <td><p><span class="type">T</span></p></td> |
---|
| 158 | </tr> |
---|
| 159 | <tr> |
---|
| 160 | <td><p>Quotient with int</p></td> |
---|
| 161 | <td><p>x / a</p></td> |
---|
| 162 | <td><p><span class="type">T</span></p></td> |
---|
| 163 | </tr> |
---|
| 164 | <tr> |
---|
| 165 | <td><p>Right-shift</p></td> |
---|
| 166 | <td><p>x >> y</p></td> |
---|
| 167 | <td><p><span class="type">T</span></p></td> |
---|
| 168 | </tr> |
---|
| 169 | <tr> |
---|
| 170 | <td><p>Right-shift with int</p></td> |
---|
| 171 | <td><p>x >> a</p></td> |
---|
| 172 | <td><p><span class="type">T</span></p></td> |
---|
| 173 | </tr> |
---|
| 174 | <tr> |
---|
| 175 | <td><p>Right-shift-assignment with int</p></td> |
---|
| 176 | <td><p>x >>= a</p></td> |
---|
| 177 | <td><p><span class="type">T &</span></p></td> |
---|
| 178 | </tr> |
---|
| 179 | <tr> |
---|
| 180 | <td><p>Less-than comparison</p></td> |
---|
| 181 | <td><p>x < y</p></td> |
---|
| 182 | <td><p>Convertible to <span class="type">bool</span></p></td> |
---|
| 183 | </tr> |
---|
| 184 | <tr> |
---|
| 185 | <td><p>Less-than comparison with int</p></td> |
---|
| 186 | <td><p>x < a</p></td> |
---|
| 187 | <td><p>Convertible to <span class="type">bool</span></p></td> |
---|
| 188 | </tr> |
---|
| 189 | <tr> |
---|
| 190 | <td><p>Less-than comparison with size_t</p></td> |
---|
| 191 | <td><p>x < boost::sample_value < std::size_t >()</p></td> |
---|
| 192 | <td><p>Convertible to <span class="type">bool</span></p></td> |
---|
| 193 | </tr> |
---|
| 194 | <tr> |
---|
| 195 | <td><p>Greater-than comparison</p></td> |
---|
| 196 | <td><p>x > y</p></td> |
---|
| 197 | <td><p>Convertible to <span class="type">bool</span></p></td> |
---|
| 198 | </tr> |
---|
| 199 | <tr> |
---|
| 200 | <td><p>Greater-than comparison with int</p></td> |
---|
| 201 | <td><p>x > a</p></td> |
---|
| 202 | <td><p>Convertible to <span class="type">bool</span></p></td> |
---|
| 203 | </tr> |
---|
| 204 | <tr> |
---|
| 205 | <td><p>Less-than-or-equal comparison</p></td> |
---|
| 206 | <td><p>x <= y</p></td> |
---|
| 207 | <td><p>Convertible to <span class="type">bool</span></p></td> |
---|
| 208 | </tr> |
---|
| 209 | <tr> |
---|
| 210 | <td><p>Less-than-or-equal comparison with int</p></td> |
---|
| 211 | <td><p>x <= a</p></td> |
---|
| 212 | <td><p>Convertible to <span class="type">bool</span></p></td> |
---|
| 213 | </tr> |
---|
| 214 | <tr> |
---|
| 215 | <td><p>Greater-than-or-equal comparison</p></td> |
---|
| 216 | <td><p>x >= y</p></td> |
---|
| 217 | <td><p>Convertible to <span class="type">bool</span></p></td> |
---|
| 218 | </tr> |
---|
| 219 | <tr> |
---|
| 220 | <td><p>Greater-than-or-equal comparison with int</p></td> |
---|
| 221 | <td><p>x >= a</p></td> |
---|
| 222 | <td><p>Convertible to <span class="type">bool</span></p></td> |
---|
| 223 | </tr> |
---|
| 224 | <tr> |
---|
| 225 | <td><p>Greater-than-or-equal comparison with int on left</p></td> |
---|
| 226 | <td><p>a >= x</p></td> |
---|
| 227 | <td><p>Convertible to <span class="type">bool</span></p></td> |
---|
| 228 | </tr> |
---|
| 229 | <tr> |
---|
| 230 | <td><p>Equality comparison</p></td> |
---|
| 231 | <td><p>x == y</p></td> |
---|
| 232 | <td><p>Convertible to <span class="type">bool</span></p></td> |
---|
| 233 | </tr> |
---|
| 234 | <tr> |
---|
| 235 | <td><p>Equality comparison with int</p></td> |
---|
| 236 | <td><p>x == a</p></td> |
---|
| 237 | <td><p>Convertible to <span class="type">bool</span></p></td> |
---|
| 238 | </tr> |
---|
| 239 | </tbody> |
---|
| 240 | </table></div> |
---|
| 241 | </div> |
---|
| 242 | <div class="refsect1" lang="en"> |
---|
| 243 | <a name="id963348"></a><h2>See also</h2> |
---|
| 244 | <div class="itemizedlist"><ul type="disc"></ul></div> |
---|
| 245 | </div> |
---|
| 246 | </div> |
---|
| 247 | <table width="100%"><tr> |
---|
| 248 | <td align="left"></td> |
---|
| 249 | <td align="right"><small>Copyright © 2001, 2002 Indiana University<br>Copyright © 2000, 2001 University of Notre Dame du Lac<br>Copyright © 2000 Jeremy Siek, Lie-Quan Lee, Andrew Lumsdaine<br>Copyright © 1996-1999 Silicon Graphics Computer Systems, Inc.<br>Copyright © 1994 Hewlett-Packard Company</small></td> |
---|
| 250 | </tr></table> |
---|
| 251 | <hr> |
---|
| 252 | <div class="spirit-nav"> |
---|
| 253 | <a accesskey="p" href="LessThanComparable.html"><img src="images/prev.png" alt="Prev"></a><a accesskey="u" href="id620092-bb.html#concepts.reference"><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="date_time.html"><img src="images/next.png" alt="Next"></a> |
---|
| 254 | </div> |
---|
| 255 | </body> |
---|
| 256 | </html> |
---|