forked from boostorg/endian
Merge develop
This commit is contained in:
1 parent
a690bb27ef
commit
eb5d1dc602
3 files changed
+27
-23
No files matched your search
+13
-12
@@ -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"><boost/endian/conversion.hpp></a><br>
|
||||
<a href="../../../boost/endian/types.hpp"><boost/endian/types.hpp></a></td>
|
||||
<a href="../include/boost/endian/conversion.hpp"><boost/endian/conversion.hpp></a><br>
|
||||
<a href="../include/boost/endian/types.hpp"><boost/endian/types.hpp></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>
|
||||
|
||||
|
||||
Reference in new issue
Block a user