copy from develop

This commit is contained in:
Beman
2015-04-03 08:17:26 -04:00
parent ea0aa5280f
commit 206cf059b0
4 changed files with 67 additions and 176 deletions
+4 -64
View File
@@ -68,7 +68,7 @@
</table>
<h2><a name="Introduction">Introduction</a></h2>
<p>Header <a href="arithmetic.html">boost/endian/arithmetic.hpp</a>
provides integer and floating point binary types with control over
provides integer binary types with control over
byte order, value type, size, and alignment. Typedefs provide easy-to-use names
for common configurations.</p>
<p>These types provide portable byte-holders for integer data, independent of
@@ -201,7 +201,6 @@ will no longer be relying on unspecified behavior.</p>
<li>Big endian| little endian | native endian byte ordering.</li>
<li>Signed | unsigned</li>
<li>Unaligned | aligned</li>
<li>Integer | floating point</li>
<li>1-8 byte (unaligned) | 1, 2, 4, 8 byte (aligned)</li>
<li>Choice of value type</li>
</ul>
@@ -244,13 +243,6 @@ conventions for common use cases:</p>
<td width="10%" align="center">unsigned</td>
<td width="15%">8,16,24,32,40,48,56,64</td>
</tr>
<tr>
<td width="18%"><code>big_float</code><i><b>n</b></i><code>_t</code></td>
<td width="49%" align="center"><code>no</code></td>
<td width="10%" align="center"><code>big</code></td>
<td width="10%" align="center">signed</td>
<td width="15%">32,64</td>
</tr>
<tr>
<td width="18%"><code>little_int</code><i><b>n</b></i><code>_t</code></td>
<td width="49%" align="center"><code>no</code></td>
@@ -265,13 +257,6 @@ conventions for common use cases:</p>
<td width="10%" align="center">unsigned</td>
<td width="15%">8,16,24,32,40,48,56,64</td>
</tr>
<tr>
<td width="18%"><code>little_float</code><i><b>n</b></i><code>_t</code></td>
<td width="49%" align="center"><code>no</code></td>
<td width="10%" align="center"><code>little</code></td>
<td width="10%" align="center">signed</td>
<td width="15%">32,64</td>
</tr>
<tr>
<td width="18%"><code>native_int</code><i><b>n</b></i><code>_t</code></td>
<td width="49%" align="center"><code>no</code></td>
@@ -286,13 +271,6 @@ conventions for common use cases:</p>
<td width="10%" align="center">unsigned</td>
<td width="15%">8,16,24,32,40,48,56,64</td>
</tr>
<tr>
<td width="18%"><code>native_float</code><i><b>n</b></i><code>_t</code></td>
<td width="49%" align="center"><code>no</code></td>
<td width="10%" align="center"><code>native</code></td>
<td width="10%" align="center">signed</td>
<td width="15%">32,64</td>
</tr>
<tr>
<td width="18%"><code>big_int</code><i><b>n</b></i><code>_at</code></td>
<td width="49%" align="center"><code>yes</code></td>
@@ -307,13 +285,6 @@ conventions for common use cases:</p>
<td width="10%" align="center">unsigned</td>
<td width="15%">8,16,32,64</td>
</tr>
<tr>
<td width="18%"><code>big_float</code><i><b>n</b></i><code>_at</code></td>
<td width="49%" align="center"><code>yes</code></td>
<td width="10%" align="center"><code>big</code></td>
<td width="10%" align="center">signed</td>
<td width="15%">32,64</td>
</tr>
<tr>
<td width="18%" dir="ltr"><code>little_int</code><i><b>n</b></i><code>_at</code></td>
<td width="49%" align="center" dir="ltr"><code>yes</code></td>
@@ -328,21 +299,7 @@ conventions for common use cases:</p>
<td width="10%" align="center" dir="ltr">unsigned</td>
<td width="15%" dir="ltr">8,16,32,64</td>
</tr>
<tr>
<td width="18%" dir="ltr"><code>little_float</code><i><b>n</b></i><code>_at</code></td>
<td width="49%" align="center" dir="ltr"><code>yes</code></td>
<td width="10%" align="center" dir="ltr"><code>little</code></td>
<td width="10%" align="center" dir="ltr">signed</td>
<td width="15%" dir="ltr">32,64</td>
</tr>
<tr>
<td width="18%"><code>native_float</code><i><b>n</b></i><code>_at</code></td>
<td width="49%" align="center"><code>yes</code></td>
<td width="10%" align="center"><code>native</code></td>
<td width="10%" align="center">signed</td>
<td width="15%">32,64</td>
</tr>
</table>
</table>
</blockquote>
<p>The unaligned types do not cause compilers to insert padding bytes in classes
and structs. This is an important characteristic that can be exploited to minimize wasted space in
@@ -452,10 +409,6 @@ usual operations on integers are supplied.</p>
typedef endian&lt;order::big, uint_least64_t, 48&gt; big_uint48_t;
typedef endian&lt;order::big, uint_least64_t, 56&gt; big_uint56_t;
typedef endian&lt;order::big, uint_least64_t, 64&gt; big_uint64_t;
// unaligned big endian floating point types
typedef endian&lt;order::big, float, 32&gt; big_float32_t;
typedef endian&lt;order::big, double, 64&gt; big_float64_t;
// unaligned little endian signed integer types
typedef endian&lt;order::little, int_least8_t, 8&gt; little_int8_t;
@@ -476,10 +429,6 @@ usual operations on integers are supplied.</p>
typedef endian&lt;order::little, uint_least64_t, 48&gt; little_uint48_t;
typedef endian&lt;order::little, uint_least64_t, 56&gt; little_uint56_t;
typedef endian&lt;order::little, uint_least64_t, 64&gt; little_uint64_t;
// unaligned little endian floating point types
typedef endian&lt;order::little, float, 32, align::no&gt; little_float32_t;
typedef endian&lt;order::little, double, 64, align::no&gt; little_float64_t;
// unaligned native endian signed integer types
typedef <b><i>implementation-defined</i></b>_int8_t native_int8_t;
@@ -513,10 +462,6 @@ usual operations on integers are supplied.</p>
typedef endian&lt;order::big, uint32_t, 32, align::yes&gt; big_uint32_at;
typedef endian&lt;order::big, uint64_t, 64, align::yes&gt; big_uint64_at;
// aligned big endian floating point types
typedef endian&lt;order::big, float, 32, align::yes&gt; big_float32_at;
typedef endian&lt;order::big, double, 64, align::yes&gt; big_float64_at;
// aligned little endian signed integer types
typedef endian&lt;order::little, int8_t, 8, align::yes&gt; little_int8_at;
typedef endian&lt;order::little, int16_t, 16, align::yes&gt; little_int16_at;
@@ -529,10 +474,6 @@ usual operations on integers are supplied.</p>
typedef endian&lt;order::little, uint32_t, 32, align::yes&gt; little_uint32_at;
typedef endian&lt;order::little, uint64_t, 64, align::yes&gt; little_uint64_at;
// aligned little endian floating point types
typedef endian&lt;order::little, float, 32, align::yes&gt; little_float32_at;
typedef endian&lt;order::little, double, 64, align::yes&gt; little_float64_at;
// aligned native endian typedefs are not provided because
// &lt;cstdint&gt; types are superior for that use case
@@ -689,11 +630,10 @@ Borgerding. Four original class templates combined into a single <code>endian_ar
class template by Beman Dawes, who put the library together, provided
documentation, added the typedefs, and also added the <code>unrolled_byte_loops</code>
sign partial specialization to correctly extend the sign when cover integer size
differs from endian representation size. Vicente Botet and other reviewers
suggested supporting floating point types.</p>
differs from endian representation size.</p>
<hr>
<p>Last revised:
<!--webbot bot="Timestamp" s-type="EDITED" s-format="%d %B, %Y" startspan -->23 February, 2015<!--webbot bot="Timestamp" endspan i-checksum="40534" --></p>
<!--webbot bot="Timestamp" s-type="EDITED" s-format="%d %B, %Y" startspan -->25 March, 2015<!--webbot bot="Timestamp" endspan i-checksum="28920" --></p>
<p>© Copyright Beman Dawes, 2006-2009, 2013</p>
<p>Distributed under the Boost Software License, Version 1.0. See
<a href="http://www.boost.org/LICENSE_1_0.txt">www.boost.org/ LICENSE_1_0.txt</a></p>