copy from develop

This commit is contained in:
Beman
2015-02-11 09:09:44 -05:00
parent 41e9bfa887
commit 2663fc447c
3 changed files with 44 additions and 23 deletions

View File

@@ -66,8 +66,9 @@ ordering. User defined types are also supported.</p>
<h2><a name="Reference">Reference</a></h2> <h2><a name="Reference">Reference</a></h2>
<p>Functions are implemented <code>inline</code> if appropriate.<code> noexcept</code> is <p>Functions are implemented <code>inline</code> if appropriate.<code> </code>
elided for compilers that do not support it. For C++03 compilers, <code> noexcept</code> is
elided .
Boost scoped enum emulation is used so that the library still works for compilers that do not support scoped enums.</p> Boost scoped enum emulation is used so that the library still works for compilers that do not support scoped enums.</p>
<p>&nbsp;</p> <p>&nbsp;</p>
@@ -76,7 +77,8 @@ Boost scoped enum emulation is used so that the library still works for compiler
Header <code>&lt;boost/endian/conversion.hpp&gt;</code> Header <code>&lt;boost/endian/conversion.hpp&gt;</code>
<a name="Synopsis">Synopsis</a></h3> <a name="Synopsis">Synopsis</a></h3>
<pre>#define BOOST_ENDIAN_INTRINSIC_MSG &quot;<b><font face="Arial"><i>message describing presence or absence of intrinsics</i></font></b>&quot; <pre>#define BOOST_ENDIAN_INTRINSIC_MSG \
&quot;<b><font face="Arial"><i>message describing presence or absence of intrinsics</i></font></b>&quot;
namespace boost namespace boost
{ {
@@ -166,7 +168,7 @@ modifiable lvalue of type <code>T</code>.</p>
<td> <code>T</code> is an endian type or a class type.<p>If <code>T</code> is <td> <code>T</code> is an endian type or a class type.<p>If <code>T</code> is
an endian type, returns the value of <code>x</code> with the order of bytes an endian type, returns the value of <code>x</code> with the order of bytes
reversed.</p> reversed.</p>
<p>If <code>T</code> is an class type, the function:</p> <p>If <code>T</code> is a class type, the function:</p>
<ul> <ul>
<li>Returns the value of <code>x</code> <li>Returns the value of <code>x</code>
with the order of bytes reversed for all data members of types or arrays of with the order of bytes reversed for all data members of types or arrays of
@@ -191,7 +193,7 @@ can be found by argument dependent lookup (ADL). </li>
<td valign="top"><code>endian_reverse_inplace(mlx)</code></td> <td valign="top"><code>endian_reverse_inplace(mlx)</code></td>
<td> <code>T</code> is an endian type or a class type.<p>If <code>T</code> is <td> <code>T</code> is an endian type or a class type.<p>If <code>T</code> is
an endian type, reverses the order of bytes in <code>mlx</code>.</p> an endian type, reverses the order of bytes in <code>mlx</code>.</p>
<p>If <code>T</code> is an class type, the function:</p> <p>If <code>T</code> is a class type, the function:</p>
<ul> <ul>
<li>Reverses the order of bytes of all data members of <code>mlx</code> <li>Reverses the order of bytes of all data members of <code>mlx</code>
that have types or arrays of that have types or arrays of
@@ -208,7 +210,7 @@ can be found by argument dependent lookup (ADL).&nbsp; </li>
that calls <code>endian_reverse</code>, only <code>endian_reverse</code> that calls <code>endian_reverse</code>, only <code>endian_reverse</code>
is required for a user-defined type to meet the <code>EndianReversibleInplace</code> is required for a user-defined type to meet the <code>EndianReversibleInplace</code>
requirements. Although User-defined types are not required to supply an <code>endian_reverse_inplace</code> requirements. Although User-defined types are not required to supply an <code>endian_reverse_inplace</code>
function, doing so may improved efficiency. <i>&nbsp;&mdash;end note</i>]</p> function, doing so may improve efficiency. <i>&nbsp;&mdash;end note</i>]</p>
<h4> <a name="Customization-points">Customization points</a> for user-defined types (<a name="UDT">UDT</a>s)</h4> <h4> <a name="Customization-points">Customization points</a> for user-defined types (<a name="UDT">UDT</a>s)</h4>
@@ -239,7 +241,7 @@ double endian_reverse(double x) noexcept;</pre>
<blockquote> <blockquote>
<p dir="ltr"><i>Returns:</i> <i><code>x</code></i>, with the order of its <p dir="ltr"><i>Returns:</i> <i><code>x</code></i>, with the order of its
constituent bytes reversed.</p> constituent bytes reversed.</p>
<p><i>Remarks:</i> Meet the <code>EndianReversible</code> requirements.</p> <p><i>Remarks:</i> The type of <i><code>x</code></i> meets the <code>EndianReversible</code> requirements.</p>
<p>[<i>Note:</i> The Boost.Endian library does not provide overloads for the C++ standard library <p>[<i>Note:</i> The Boost.Endian library does not provide overloads for the C++ standard library
supplied types. <i>&mdash;end note</i>]</p> supplied types. <i>&mdash;end note</i>]</p>
</blockquote> </blockquote>
@@ -367,7 +369,7 @@ Pierre Talbot provided the <code>int8_t endian_reverse()</code> and templated
<code>endian_reverse_inplace()</code> implementations.</p> <code>endian_reverse_inplace()</code> implementations.</p>
<hr> <hr>
<p>Last revised: <p>Last revised:
<!--webbot bot="Timestamp" s-type="EDITED" s-format="%d %B, %Y" startspan -->19 January, 2015<!--webbot bot="Timestamp" endspan i-checksum="38903" --></p> <!--webbot bot="Timestamp" s-type="EDITED" s-format="%d %B, %Y" startspan -->09 February, 2015<!--webbot bot="Timestamp" endspan i-checksum="40544" --></p>
<p>© Copyright Beman Dawes, 2011, 2013</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> <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>

View File

@@ -417,6 +417,28 @@ and the other middle endian approaches are interesting historical curiosities
but have no relevance to today&#39;s C++ developers.</p> but have no relevance to today&#39;s C++ developers.</p>
</blockquote> </blockquote>
<p><b>Why do both the buffer and arithmetic types exist?</b></p>
<blockquote>
<p>Conversions in the buffer types are explicit. Conversions in the arithmetic
types are implicit. This fundamental difference is a deliberate design feature
that would be lost if the inheritance hierarchy were collapsed.</p>
<p>The original design provided only arithmetic types. Buffer types were
requested during formal review by those wishing total control over when
conversion occurs. They also felt that buffer types would be less likely to be
misused by maintenance programmers not familiar with the implications of
performing a lot of arithmetic operations on the endian arithmetic types.</p>
</blockquote>
<p><b>What is gained by using the buffer types rather than always just using the
arithmetic types?</b></p>
<blockquote>
<p>Assurance than hidden conversions are not performed. This is of overriding
importance to users concerned about achieving the ultimate in terms of speed. </p>
<p>&quot;Always just using the arithmetic types&quot; is fine for other users. When the
ultimate in speed needs to be ensured, the arithmetic types can be used in the
same design patterns or idioms that would be used for buffer types, resulting in
the same code being generated for either types.</p>
</blockquote>
<p><b>What are the limitations of floating point support?</b></p> <p><b>What are the limitations of floating point support?</b></p>
<blockquote> <blockquote>
@@ -480,7 +502,7 @@ review</a></h3>
<h2><a name="Compatibility">Compatibility</a> with interim releases</h2> <h2><a name="Compatibility">Compatibility</a> with interim releases</h2>
<p dir="ltr">Prior to the official Boost release, class template <code> <p>Prior to the official Boost release, class template <code>
endian_arithmetic</code> has been used for a decade or more with the same endian_arithmetic</code> has been used for a decade or more with the same
functionality but under the name <code>endian</code>. Other names also changed functionality but under the name <code>endian</code>. Other names also changed
in the official release. If the macro <code>BOOST_ENDIAN_DEPRECATED_NAMES</code> in the official release. If the macro <code>BOOST_ENDIAN_DEPRECATED_NAMES</code>
@@ -531,12 +553,12 @@ in some future release.</p>
standards committee for possible inclusion in a Technical Specification or the standards committee for possible inclusion in a Technical Specification or the
C++ standard itself.</p> C++ standard itself.</p>
<p dir="ltr"><b>Specializations for <code>numeric_limits</code>.</b> Roger Leigh <p><b>Specializations for <code>numeric_limits</code>.</b> Roger Leigh
requested that all <code>boost::endian</code> types provide <code>numeric_limits</code> requested that all <code>boost::endian</code> types provide <code>numeric_limits</code>
specializations. See <a href="https://github.com/boostorg/endian/issues/4"> specializations. See <a href="https://github.com/boostorg/endian/issues/4">
GitHub issue 4</a>.</p> GitHub issue 4</a>.</p>
<p dir="ltr"><b>Character buffer support.</b> Peter Dimov pointed out during the <p><b>Character buffer support.</b> Peter Dimov pointed out during the
mini-review that getting and setting basic arithmetic types (or <code>&lt;cstdint&gt;</code> mini-review that getting and setting basic arithmetic types (or <code>&lt;cstdint&gt;</code>
equivalents) from/to an offset into an array of unsigned char is a common need. equivalents) from/to an offset into an array of unsigned char is a common need.
See <a href="http://lists.boost.org/Archives/boost/2015/01/219574.php"> See <a href="http://lists.boost.org/Archives/boost/2015/01/219574.php">
@@ -551,20 +573,17 @@ and subsequent replies.</p>
<h2><a name="Acknowledgements">Acknowledgements</a></h2> <h2><a name="Acknowledgements">Acknowledgements</a></h2>
<p>Comments and suggestions were received from Adder, Benaka Moorthi, <p>Comments and suggestions were received from Adder, Benaka Moorthi,
Christopher Kohlhoff, Cliff Green, Daniel James, Gennaro Proto, Giovanni Piero Christopher Kohlhoff, Cliff Green, Daniel James, Gennaro Proto, Giovanni Piero
Deretta, Gordon Woodhull, dizzy, Hartmut Kaiser, Jeff Flinn, Jeremy Maitin-Shepard, John Filo, John Deretta, Gordon Woodhull, dizzy, Hartmut Kaiser, Jason Newton, Jeff Flinn, Jeremy Maitin-Shepard, John Filo, John
Maddock, Kim Barrett, Marsh Ray, Martin Bonner, Mathias Gaunard, Matias Maddock, Kim Barrett, Marsh Ray, Martin Bonner, Mathias Gaunard, Matias
Capeletto, Neil Mayhew, <span class="gI"> Capeletto, Neil Mayhew, Nevin Liber,
<span email="ml@vdspek.org" name="Olaf van der Spek" class="gD">Olaf van der Olaf van der Spek, Paul Bristow, Peter Dimov, Pierre Talbot, Phil Endecott,
Spek, </span></span>Paul Bristow, Peter Dimov, Pierre Talbot, Phil Endecott, Philip Bennefall, Pyry Jahkola,
<span class="gI">
<span email="philip@blastbay.com" name="Philip Bennefall" class="gD">Philip
Bennefall,</span></span> Pyry Jahkola,
Rene Rivera, Robert Stewart, Roger Leigh, Roland Schwarz, Scott McMurray, Sebastian Redl, Tim Rene Rivera, Robert Stewart, Roger Leigh, Roland Schwarz, Scott McMurray, Sebastian Redl, Tim
Blechmann, Tim Moore, tymofey, Tomas Puverle, Vincente Botet, Yuval Ronen and Blechmann, Tim Moore, tymofey, Tomas Puverle, Vincente Botet, Yuval Ronen and
Vitaly Budovsk. Apologies if anyone has been missed.</p> Vitaly Budovsk. Apologies if anyone has been missed.</p>
<hr> <hr>
<p>Last revised: <p>Last revised:
<!--webbot bot="Timestamp" s-type="EDITED" s-format="%d %B, %Y" startspan -->27 January, 2015<!--webbot bot="Timestamp" endspan i-checksum="38900" --></p> <!--webbot bot="Timestamp" s-type="EDITED" s-format="%d %B, %Y" startspan -->09 February, 2015<!--webbot bot="Timestamp" endspan i-checksum="40544" --></p>
<p>© Copyright Beman Dawes, 2011, 2013</p> <p>© Copyright Beman Dawes, 2011, 2013</p>
<p>Distributed under the Boost Software License, Version 1.0. See <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> <a href="http://www.boost.org/LICENSE_1_0.txt">www.boost.org/ LICENSE_1_0.txt</a></p>

View File

@@ -1,16 +1,16 @@
body body
{ {
font-family: sans-serif; font-family: arial, sans-serif;
max-width: 6.5in; max-width: 6.5in;
margin: 0px auto; margin: 0px auto;
font-size: 85%; font-size: 85%;
} }
ins {background-color: #CCFFCC;} ins {background-color: #CCFFCC;}
del {background-color: #FFCACA;} del {background-color: #FFCACA;}
pre {background-color: #D7EEFF; font-size: 100%;} pre {background-color: #D7EEFF; font-size: 95%; font-family: courier, serif;}
code {font-size: 110%;} code {font-size: 110%; font-family: courier, serif;}
table{font-size: 100%;} table {font-size: 100%;}
/* /*
<20> Copyright Beman Dawes, 2014 <20> Copyright Beman Dawes, 2014