From f184fd934eb9c8b9afcea7de8e0c7e36e7451bf3 Mon Sep 17 00:00:00 2001
From: Beman
Why do both the buffer and arithmetic types exist?
+++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.
+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.
+
What is gained by using the buffer types rather than always just using the +arithmetic types?
+++Assurance than hidden conversions are not performed. This is of overriding +importance to users concerned about achieving the ultimate in terms of speed.
+"Always just using the arithmetic types" 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.
+
What are the limitations of floating point support?
@@ -480,7 +502,7 @@ reviewCompatibility with interim releases
-Prior to the official Boost release, class template
-+
Prior to the official Boost release, class template
standards committee for possible inclusion in a Technical Specification or the C++ standard itself.endian_arithmetic
has been used for a decade or more with the same functionality but under the nameendian
. Other names also changed in the official release. If the macroBOOST_ENDIAN_DEPRECATED_NAMES
@@ -531,12 +553,12 @@ in some future release.Specializations for
numeric_limits
. Roger Leigh +Specializations for
-numeric_limits
. Roger Leigh requested that allboost::endian
types providenumeric_limits
specializations. See GitHub issue 4.Character buffer support. Peter Dimov pointed out during the +
Character buffer support. Peter Dimov pointed out during the mini-review that getting and setting basic arithmetic types (or
<cstdint>
equivalents) from/to an offset into an array of unsigned char is a common need. See @@ -551,20 +573,17 @@ and subsequent replies.Acknowledgements
Comments and suggestions were received from Adder, Benaka Moorthi, 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 -Capeletto, Neil Mayhew, -Olaf van der -Spek, Paul Bristow, Peter Dimov, Pierre Talbot, Phil Endecott, - -Philip -Bennefall, Pyry Jahkola, +Capeletto, Neil Mayhew, Nevin Liber, +Olaf van der Spek, Paul Bristow, Peter Dimov, Pierre Talbot, Phil Endecott, +Philip Bennefall, Pyry Jahkola, Rene Rivera, Robert Stewart, Roger Leigh, Roland Schwarz, Scott McMurray, Sebastian Redl, Tim Blechmann, Tim Moore, tymofey, Tomas Puverle, Vincente Botet, Yuval Ronen and Vitaly Budovsk. Apologies if anyone has been missed.
Last revised: -27 January, 2015
+09 February, 2015© Copyright Beman Dawes, 2011, 2013
Distributed under the Boost Software License, Version 1.0. See www.boost.org/ LICENSE_1_0.txt