Merge develop

This commit is contained in:
Beman
2013-05-29 09:43:25 -04:00
parent a690bb27ef
commit eb5d1dc602
3 changed files with 27 additions and 23 deletions
+13 -12
View File
@@ -35,6 +35,9 @@
<a href="types.html">Endian Types</a></b></td>
</tr>
</table>
<p></p>
<table border="1" cellpadding="5" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" align="right">
<tr>
<td width="100%" bgcolor="#D7EEFF" align="center">
@@ -56,27 +59,20 @@
</tr>
<tr>
<td width="100%" bgcolor="#E8F5FF">
<a href="../../../boost/endian/conversion.hpp">&lt;boost/endian/conversion.hpp&gt;</a><br>
<a href="../../../boost/endian/types.hpp">&lt;boost/endian/types.hpp&gt;</a></td>
<a href="../include/boost/endian/conversion.hpp">&lt;boost/endian/conversion.hpp&gt;</a><br>
<a href="../include/boost/endian/types.hpp">&lt;boost/endian/types.hpp&gt;</a></td>
</tr>
</table>
<h2><a name="Introduction">Introduction</a></h2>
<p>Header <a href="../../../boost/endian/conversion.hpp">boost/endian/conversion.hpp</a>
<p>Header <a href="../include/boost/endian/conversion.hpp">boost/endian/conversion.hpp</a>
provides byte order reversal and conversion functions that convert objects of
the multi-byte built-in
integer types, and also types <code>float</code> and <code>double,</code>
between native, big, or little endian byte
ordering. User defined types are also supported.</p>
<table border="1" cellpadding="5" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111">
<tr>
<td bgcolor="#FFFFCC">Caution: Only big endianness and little endianness is supported;
middle endianness is not supported.</td>
</tr>
</table>
<h2><a name="Reference">Reference</a></h2>
<p>Functions are implemented <code>inline</code> if appropriate.<code> noexcept</code> is
@@ -178,7 +174,7 @@ type (possibly <code>const</code>) <code>ReversibleValue</code>.</p>
<td valign="top">
<p><code>reverse_value(x)</code></td>
<td valign="top">
<p><a name="ReversibleValue"><code>ReversibleValue</code></a></td>
<p><code>ReversibleValue</code></td>
<td>
<p>The returned value is the value of <code>x</code> with the
order of its constituent bytes reversed.</td>
@@ -201,6 +197,11 @@ modifiable lvalue of type <code>Reversible</code>.</p>
reversed.</td>
</tr>
</table>
<p dir="ltr">See <a href="../example/udt_conversion_example.cpp">
udt_conversion_example.cpp</a> for an example of a UDT that can used in the
<code><a href="#big_endian">big_endian</a></code>, <code>
<a href="#little_endian">little_endian</a></code>, and <code>
<a href="#convert_generic">convert</a></code> function templates.</p>
<h3><a name="Functions">Functions</a></h3>
<pre><a name="reverse_value"></a>int16_t reverse_value(int16_t x) noexcept;
int32_t reverse_value(int32_t x) noexcept;
@@ -335,7 +336,7 @@ provided.</p>
support endian conversion as separate from endian integer types. Phil Endecott suggested the form of the value returning signatures. Vicente Botet and other reviewers suggested supporting floating point types and user defined types. General reverse template implementation approach using std::reverse suggested by Mathias Gaunard. Portable implementation approach for 16, 32, and 64-bit integers suggested by tymofey, with avoidance of undefined behavior as suggested by Giovanni Piero Deretta, and a further refinement suggested by Pyry Jahkola. Intrinsic builtins implementation approach for 16, 32, and 64-bit integers suggested by several reviewers, and by David Stone, who provided his Boost licensed macro implementation that became the starting point for <a href="../include/boost/endian/detail/intrinsic.hpp">boost/endian/detail/intrinsic.hpp</a>.</p>
<hr>
<p>Last revised:
<!--webbot bot="Timestamp" s-type="EDITED" s-format="%d %B, %Y" startspan -->28 May, 2013<!--webbot bot="Timestamp" endspan i-checksum="13992" --></p>
<!--webbot bot="Timestamp" s-type="EDITED" s-format="%d %B, %Y" startspan -->29 May, 2013<!--webbot bot="Timestamp" endspan i-checksum="13994" --></p>
<p>© Copyright Beman Dawes, 2011, 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>
+3 -2
View File
@@ -34,6 +34,7 @@
<a href="types.html">Endian Types</a></b></td>
</tr>
</table>
<p></p>
<table border="1" cellpadding="5" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" align="right">
<tr>
<td width="100%" bgcolor="#D7EEFF" align="center">
@@ -59,8 +60,8 @@
</tr>
<tr>
<td width="100%" bgcolor="#E8F5FF">
<a href="../../../boost/endian/conversion.hpp">&lt;boost/endian/conversion.hpp&gt;</a><br>
<a href="../../../boost/endian/types.hpp">&lt;boost/endian/types.hpp&gt;</a></td>
<a href="../include/boost/endian/conversion.hpp">&lt;boost/endian/conversion.hpp&gt;</a><br>
<a href="../include/boost/endian/types.hpp">&lt;boost/endian/types.hpp&gt;</a></td>
</tr>
</table>
+11 -9
View File
@@ -37,6 +37,8 @@
</tr>
</table>
<p></p>
<table border="1" cellpadding="5" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" align="right">
<tr>
<td width="100%" bgcolor="#D7EEFF" align="center">
@@ -48,8 +50,7 @@
<a href="#Example">Example</a><br>
<a href="#Limitations">Limitations</a><br>
<a href="#Feature-set">Feature set</a><br>
<a href="#Types">Typedefs</a><br>
&nbsp;&nbsp;&nbsp; <a href="#Comment-on-naming">Comment on naming</a><br>
<a href="#Types">Enums and typedefs</a><br>
<a href="#Class_template_endian">Class template <code>endian</code></a><br>
&nbsp;&nbsp;&nbsp;
<a href="#Synopsis">Synopsis</a><br>
@@ -69,13 +70,13 @@
</tr>
<tr>
<td width="100%" bgcolor="#E8F5FF">
<a href="../../../boost/endian/conversion.hpp">&lt;boost/endian/conversion.hpp&gt;</a><br>
<a href="../../../boost/endian/types.hpp">&lt;boost/endian/types.hpp&gt;</a></td>
<a href="../include/boost/endian/conversion.hpp">&lt;boost/endian/conversion.hpp&gt;</a><br>
<a href="../include/boost/endian/types.hpp">&lt;boost/endian/types.hpp&gt;</a></td>
</tr>
</table>
<h2><a name="Introduction">Introduction</a></h2>
<p>Header <a href="file:///D:/endian/boost/endian/types.hpp">&lt;boost/endian/types.hpp&gt;</a> provides
integer-like byte-holder binary types with explicit control over
<p>Header <a href="../include/boost/endian/types.hpp">boost/endian/types.hpp</a>
provides integer and floating point binary types with explicit 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
@@ -100,7 +101,8 @@ arithmetic operators are <code>+</code>, <code>+=</code>, <code>-</code>, <code>
<code>^</code>, <code>^=</code>, <code>&lt;&lt;</code>, <code>&lt;&lt;=</code>, <code>&gt;&gt;</code>,
<code>&gt;&gt;=</code>. Binary relational operators are <code>==</code>, <code>!=</code>,
<code>&lt;</code>, <code>&lt;=</code>, <code>&gt;</code>, <code>&gt;=</code>.</p>
<p>Automatic conversion is provided to the underlying integer value type.</p>
<p>Automatic implicit conversion to the underlying value type is provided. An
explicit conversion constructor from the underlying value type is provided. </p>
<h2><a name="Example">Example</a></h2>
<p>The <a href="../example/endian_example.cpp">endian_example.cpp</a> program writes a
binary file containing four byte big-endian and little-endian integers:</p>
@@ -169,7 +171,7 @@ int main(int, char* [])
}
</pre>
</blockquote>
<p>After compiling and executing <a href="endian_example.cpp">endian_example.cpp</a>,
<p>After compiling and executing <a href="../example/endian_example.cpp">endian_example.cpp</a>,
a hex dump of <code>test.dat</code> shows:</p>
<blockquote>
<pre>01020304 00000010 01000000 04030201</pre>
@@ -614,7 +616,7 @@ differs from endian representation size. Vicente Botet and other reviewers
suggested supporting floating point types.</p>
<hr>
<p>Last revised:
<!--webbot bot="Timestamp" s-type="EDITED" s-format="%d %B, %Y" startspan -->28 May, 2013<!--webbot bot="Timestamp" endspan i-checksum="13992" --></p>
<!--webbot bot="Timestamp" s-type="EDITED" s-format="%d %B, %Y" startspan -->29 May, 2013<!--webbot bot="Timestamp" endspan i-checksum="13994" --></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>