Add FAQ entry for built-in integer names.

This commit is contained in:
Beman
2014-12-11 12:05:31 -05:00
parent 971ba888d6
commit e8530e4563

View File

@@ -98,7 +98,6 @@ namespace endian
native = <b><i>implementation-defined-as-big-or-little
</i></b>};
<span style="background-color: #FFFF00">TODO</span><span style="background-color: #FFFF00">: Add overloads for char, </span><span style="background-color: #FFFF00">wchar_t</span><span style="background-color: #FFFF00">, char16_t, char32_t</span>
int8_t <a href="#endian_reverse">endian_reverse</a>(int8_t x) noexcept;
int16_t <a href="#endian_reverse">endian_reverse</a>(int16_t x) noexcept;
int32_t <a href="#endian_reverse">endian_reverse</a>(int32_t x) noexcept;
@@ -360,6 +359,17 @@ provided.</p>
</blockquote>
<p><b>Why are 8, 16, 32, and 64-bit integers supported rather than the built-in
char, short, int, long, long long, etc?</b></p>
<blockquote>
<p>The primary use case, portable file or network data, needs these de facto
standard sizes. Using types that vary with the platform would greatly limit
portability for both programs and data.</p>
</blockquote>
<h2><a name="Acknowledgements">Acknowledgements</a></h2><p>Tomas Puverle was instrumental in identifying and articulating the need to
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>.
Pierre Talbot provided the <code>int8_t endian_reverse()</code> and templated