diff --git a/doc/arithmetic.html b/doc/arithmetic.html index b8d739e..1066d14 100644 --- a/doc/arithmetic.html +++ b/doc/arithmetic.html @@ -68,7 +68,7 @@
Header boost/endian/arithmetic.hpp -provides integer and floating point binary types with control over +provides integer binary types with control over byte order, value type, size, and alignment. Typedefs provide easy-to-use names for common configurations.
These types provide portable byte-holders for integer data, independent of @@ -201,7 +201,6 @@ will no longer be relying on unspecified behavior.
big_float
n_t
no
big
little_int
n_t
no
little_float
n_t
no
little
native_int
n_t
no
native_float
n_t
no
native
big_int
n_at
yes
big_float
n_at
yes
big
little_int
n_at
yes
little_float
n_at
yes
little
native_float
n_at
yes
native
The unaligned types do not cause compilers to insert padding bytes in classes and structs. This is an important characteristic that can be exploited to minimize wasted space in @@ -452,10 +409,6 @@ usual operations on integers are supplied.
typedef endian<order::big, uint_least64_t, 48> big_uint48_t; typedef endian<order::big, uint_least64_t, 56> big_uint56_t; typedef endian<order::big, uint_least64_t, 64> big_uint64_t; - - // unaligned big endian floating point types - typedef endian<order::big, float, 32> big_float32_t; - typedef endian<order::big, double, 64> big_float64_t; // unaligned little endian signed integer types typedef endian<order::little, int_least8_t, 8> little_int8_t; @@ -476,10 +429,6 @@ usual operations on integers are supplied. typedef endian<order::little, uint_least64_t, 48> little_uint48_t; typedef endian<order::little, uint_least64_t, 56> little_uint56_t; typedef endian<order::little, uint_least64_t, 64> little_uint64_t; - - // unaligned little endian floating point types - typedef endian<order::little, float, 32, align::no> little_float32_t; - typedef endian<order::little, double, 64, align::no> little_float64_t; // unaligned native endian signed integer types typedef implementation-defined_int8_t native_int8_t; @@ -513,10 +462,6 @@ usual operations on integers are supplied. typedef endian<order::big, uint32_t, 32, align::yes> big_uint32_at; typedef endian<order::big, uint64_t, 64, align::yes> big_uint64_at; - // aligned big endian floating point types - typedef endian<order::big, float, 32, align::yes> big_float32_at; - typedef endian<order::big, double, 64, align::yes> big_float64_at; - // aligned little endian signed integer types typedef endian<order::little, int8_t, 8, align::yes> little_int8_at; typedef endian<order::little, int16_t, 16, align::yes> little_int16_at; @@ -529,10 +474,6 @@ usual operations on integers are supplied. typedef endian<order::little, uint32_t, 32, align::yes> little_uint32_at; typedef endian<order::little, uint64_t, 64, align::yes> little_uint64_at; - // aligned little endian floating point types - typedef endian<order::little, float, 32, align::yes> little_float32_at; - typedef endian<order::little, double, 64, align::yes> little_float64_at; - // aligned native endian typedefs are not provided because // <cstdint> types are superior for that use case @@ -689,11 +630,10 @@ Borgerding. Four original class templates combined into a singleendian_ar
class template by Beman Dawes, who put the library together, provided
documentation, added the typedefs, and also added the unrolled_byte_loops
sign partial specialization to correctly extend the sign when cover integer size
-differs from endian representation size. Vicente Botet and other reviewers
-suggested supporting floating point types.
+differs from endian representation size.
Last revised:
-23 February, 2015
+25 March, 2015
© Copyright Beman Dawes, 2006-2009, 2013
Distributed under the Boost Software License, Version 1.0. See
www.boost.org/ LICENSE_1_0.txt
diff --git a/doc/buffers.html b/doc/buffers.html
index 173ab14..85aae22 100644
--- a/doc/buffers.html
+++ b/doc/buffers.html
@@ -69,7 +69,7 @@ a full
exploration of endianness, including definitions of big
endian and little endian.
Header boost/endian/buffers.hpp
-provides endian_buffer
, a portable endian integer and floating-point binary buffer
+provides endian_buffer
, a portable endian integer binary buffer
class template with control over
byte order, value type, size, and alignment independent of the platform's native
endianness. Typedefs provide easy-to-use names
@@ -183,7 +183,6 @@ will no longer be relying on unspecified behavior.
Big endian| little endian | native endian byte ordering.
Signed | unsigned
Unaligned | aligned
- Integer | floating point
1-8 byte (unaligned) | 1, 2, 4, 8 byte (aligned)
Choice of value type
@@ -226,13 +225,6 @@ conventions for common use cases:
unsigned
8,16,24,32,40,48,56,64
-
- big_float
n_buf_t
- no
- big
- signed
- 32,64
-
little_int
n_buf_t
no
@@ -247,13 +239,6 @@ conventions for common use cases:
unsigned
8,16,24,32,40,48,56,64
-
- little_float
n_buf_t
- no
- little
- signed
- 32,64
-
native_int
n_buf_t
no
@@ -268,13 +253,6 @@ conventions for common use cases:
unsigned
8,16,24,32,40,48,56,64
-
- native_float
n_buf_t
- no
- native
- signed
- 32,64
-
big_int
n_buf_at
yes
@@ -289,13 +267,6 @@ conventions for common use cases:
unsigned
8,16,32,64
-
- big_float
n_
buf_at
- yes
- big
- signed
- 32,64
-
little_int
n_
buf_at
yes
@@ -310,21 +281,7 @@ conventions for common use cases:
unsigned
8,16,32,64
-
- little_float
n_
buf_at
- yes
- little
- signed
- 32,64
-
-
- native_float
n_
buf_at
- yes
- native
- signed
- 32,64
-
-
+
The unaligned types do not cause compilers to insert padding bytes in classes
and structs. This is an important characteristic that can be exploited to minimize wasted space in
@@ -418,10 +375,6 @@ usual operations on integers are supplied.
typedef endian_buffer<order::big, uint_least64_t, 56> big_uint56_buf_t;
typedef endian_buffer<order::big, uint_least64_t, 64> big_uint64_buf_t;
- // unaligned big endian floating point buffers
- typedef endian_buffer<order::big, float, 32> big_float32_buf_t;
- typedef endian_buffer<order::big, double, 64> big_float64_buf_t;
-
// unaligned little endian signed integer buffers
typedef endian_buffer<order::little, int_least8_t, 8> little_int8_buf_t;
typedef endian_buffer<order::little, int_least16_t, 16> little_int16_buf_t;
@@ -442,10 +395,6 @@ usual operations on integers are supplied.
typedef endian_buffer<order::little, uint_least64_t, 56> little_uint56_buf_t;
typedef endian_buffer<order::little, uint_least64_t, 64> little_uint64_buf_t;
- // unaligned little endian floating point buffers
- typedef endian_buffer<order::little, float, 32> little_float32_buf_t;
- typedef endian_buffer<order::little, double, 64> little_float64_buf_t;
-
// unaligned native endian signed integer types
typedef implementation-defined_int8_buf_t native_int8_buf_t;
typedef implementation-defined_int16_buf_t native_int16_buf_t;
@@ -478,10 +427,6 @@ usual operations on integers are supplied.
typedef endian_buffer<order::big, uint32_t, 32, align::yes> big_uint32_buf_at;
typedef endian_buffer<order::big, uint64_t, 64, align::yes> big_uint64_buf_at;
- // aligned big endian floating point buffers
- typedef endian_buffer<order::big, float, 32, align::yes> big_float32_buf_at;
- typedef endian_buffer<order::big, double, 64, align::yes> big_float64_buf_at;
-
// aligned little endian signed integer buffers
typedef endian_buffer<order::little, int8_t, 8, align::yes> little_int8_buf_at;
typedef endian_buffer<order::little, int16_t, 16, align::yes> little_int16_buf_at;
@@ -493,10 +438,6 @@ usual operations on integers are supplied.
typedef endian_buffer<order::little, uint16_t, 16, align::yes> little_uint16_buf_at;
typedef endian_buffer<order::little, uint32_t, 32, align::yes> little_uint32_buf_at;
typedef endian_buffer<order::little, uint64_t, 64, align::yes> little_uint64_buf_at;
-
- // aligned little endian floating point buffers
- typedef endian_buffer<order::little, float, 32, align::yes> little_float32_buf_at;
- typedef endian_buffer<order::little, double, 64, align::yes> little_float64_buf_at;
// aligned native endian typedefs are not provided because
// <cstdint> types are superior for this use case
@@ -663,7 +604,7 @@ any Boost object libraries.
Last revised:
-23 February, 2015
+25 March, 2015
© Copyright Beman Dawes, 2006-2009, 2013
Distributed under the Boost Software License, Version 1.0. See
www.boost.org/ LICENSE_1_0.txt
diff --git a/doc/conversion.html b/doc/conversion.html
index 8ec3f0c..422300c 100644
--- a/doc/conversion.html
+++ b/doc/conversion.html
@@ -1,4 +1,4 @@
-
+
@@ -59,8 +59,8 @@
Header boost/endian/conversion.hpp
provides byte order reversal and conversion functions that convert objects of
-the built-in
-integer types, and also types float
and double,
+the built-in
+integer types
between native, big, or little endian byte
ordering. User defined types are also supported.
@@ -99,8 +99,6 @@ namespace endian
uint16_t endian_reverse(uint16_t x) noexcept;
uint32_t endian_reverse(uint32_t x) noexcept;
uint64_t endian_reverse(uint64_t x) noexcept;
- float endian_reverse(float x) noexcept;
- double endian_reverse(double x) noexcept;
template <class EndianReversible>
EndianReversible big_to_native(EndianReversible x) noexcept;
@@ -141,8 +139,7 @@ constant native
as
endian platforms.
Definitions
The standard integral types (C++std 3.9.1) except bool
,
-and the floating point types float
and double
are
-collectively called the endian types.
+are collectively called the endian types.
Requirements
Template argument requirements
The template definitions in the boost/endian/conversion.hpp
@@ -235,9 +232,7 @@ int64_t endian_reverse(int64_t x) noexcept;
uint8_t endian_reverse(uint8_t x) noexcept;
uint16_t endian_reverse(uint16_t x) noexcept;
uint32_t endian_reverse(uint32_t x) noexcept;
-uint64_t endian_reverse(uint64_t x) noexcept;
-float endian_reverse(float x) noexcept;
-double endian_reverse(double x) noexcept;
+uint64_t endian_reverse(uint64_t x) noexcept;
Returns: x
, with the order of its
constituent bytes reversed.
@@ -250,8 +245,7 @@ double endian_reverse(double x) noexcept;
EndianReversible big_to_native(EndianReversible x) noexcept;
- Returns: conditional_reverse<order::big,
- order::native>(x)
.
+ Returns: conditional_reverse<order::big, order::native>(x)
.
template <class EndianReversible>
EndianReversible native_to_big(EndianReversible x) noexcept;
@@ -271,10 +265,8 @@ EndianReversible native_to_little(EndianReversible x) noexcept;
template <order O1, order O2, class EndianReversible>
EndianReversible conditional_reverse(EndianReversible x) noexcept;
- Returns: x
if O1 == O2,
otherwise
- endian_reverse(x)
.
- Remarks: Whether x
or endian_reverse(x)
- is to be returned shall be determined at compile time.
+ Returns: x
if O1 == O2,
otherwise endian_reverse(x)
.
+ Remarks: Whether x
or endian_reverse(x)
is to be returned shall be determined at compile time.
template <class EndianReversible>
EndianReversible conditional_reverse(EndianReversible x,
@@ -294,15 +286,13 @@ void endian_reverse_inplace(EndianReversible& x) noexcept;
void big_to_native_inplace(EndianReversibleInplace& x) noexcept;
- Effects: conditional_reverse_inplace<order::big,
- order::native>(x)
.
+ Effects: conditional_reverse_inplace<order::big, order::native>(x)
.
template <class EndianReversibleInplace>
void native_to_big_inplace(EndianReversibleInplace& x) noexcept;
- Effects: conditional_reverse_inplace<order::native,
- order::big>(x)
.
+ Effects: conditional_reverse_inplace<order::native, order::big>(x)
.
template <class EndianReversibleInplace>
void little_to_native_inplace(EndianReversibleInplace& x) noexcept;
@@ -314,14 +304,12 @@ void little_to_native_inplace(EndianReversibleInplace& x) noexcept;
void native_to_little_inplace(EndianReversibleInplace& x) noexcept;
- Effects: conditional_reverse_inplace<order::native,
- order::little>(x)
.
+ Effects: conditional_reverse_inplace<order::native, order::little>(x)
.
template <order O1, order O2, class EndianReversibleInplace>
void conditional_reverse_inplace(EndianReversibleInplace& x) noexcept;
- Effects: None if O1 == O2,
otherwise
- endian_reverse_inplace(x)
.
+ Effects: None if O1 == O2,
otherwise endian_reverse_inplace(x)
.
Remarks: Which effect applies shall be determined at compile time.
template <class EndianReversibleInplace>
@@ -362,14 +350,21 @@ portability for both programs and data.
-Acknowledgements
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
-boost/endian/detail/intrinsic.hpp
.
+
Acknowledgements
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 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 boost/endian/detail/intrinsic.hpp
.
Pierre Talbot provided the int8_t endian_reverse()
and templated
endian_reverse_inplace()
implementations.
-Last revised:
-09 February, 2015
+Last revised: 25 March, 2015
© Copyright Beman Dawes, 2011, 2013
Distributed under the Boost Software License, Version 1.0. See www.boost.org/ LICENSE_1_0.txt
diff --git a/doc/index.html b/doc/index.html
index 45a74fa..167112b 100644
--- a/doc/index.html
+++ b/doc/index.html
@@ -67,10 +67,9 @@ formal review
Abstract
Boost.Endian provides facilities to manipulate the
-endianness of integers,
-floating point numbers, and user-defined types.
+endianness of integers and user-defined types.
- - Three approaches to endianness are supported. Each has a
+
- Three approaches to endianness are supported. Each has a
long history of successful use, and each approach has use cases where it is
preferred over the other approaches.
@@ -137,8 +136,7 @@ external data sizes is advantageous.
Boost.Endian provides three different approaches to dealing with
-endianness. All three approaches support integers, floating point types
-except long double
, and user-define types (UDTs).
+endianness. All three approaches support integers and user-define types (UDTs).
Each approach has a long history of successful use, and each approach has use
cases where it is preferred to the other approaches.
@@ -146,18 +144,16 @@ cases where it is preferred to the other approaches.
Endian conversion functions - The
-application uses the built-in integer and floating point types to hold values, and calls the
+application uses the built-in integer types to hold values, and calls the
provided conversion functions to convert byte ordering as needed. Both mutating
and non-mutating conversions are supplied, and each comes in unconditional and
conditional variants.
Endian buffer types - The application uses the provided endian
buffer types
-to hold values, and explicitly converts to and from the built-in integer and
-floating point types. Buffer sizes of 8, 16, 24, 32, 40, 48, 56, and 64 bits (i.e.
+to hold values, and explicitly converts to and from the built-in integer types. Buffer sizes of 8, 16, 24, 32, 40, 48, 56, and 64 bits (i.e.
1, 2, 3, 4, 5, 6, 7, and 8 bytes) are provided. Unaligned integer buffer types
-are provided for all sizes, unaligned floating point buffer types are provided
-for 32 and 64 bit sizes, and aligned buffer types are provided for 16, 32, and
+are provided for all sizes, and aligned buffer types are provided for 16, 32, and
64-bit sizes. The provided specific types are typedefs for a generic class
template that may be used directly for less common use cases.
@@ -166,10 +162,10 @@ application uses the provided endian arithmetic types, which supply the same
operations as the built-in C++ arithmetic types. All conversions are implicit.
Arithmetic sizes of 8, 16, 24, 32, 40, 48, 56, and 64 bits (i.e. 1, 2, 3, 4, 5,
6, 7, and 8 bytes) are provided. Unaligned integer types are provided for all
-sizes, unaligned floating point types are provided for 32 and 64 bit sizes, and aligned
+sizes and aligned
arithmetic types are provided for 16, 32, and 64-bit sizes. The provided
specific types are typedefs for a generic class template that may be used
-directly for less common use cases.
+directly in generic code of for less common use cases.
@@ -453,11 +449,15 @@ the same code being generated for either types.
-The only supported types are four-byte float
and eight-byte
-double
. Even after endianness has been accounted for, floating
-point values will not be portable between systems that use different floating
-point formats. Systems on which integer endianness differs from floating point
-endianness are not supported.
+The only supported types are four-byte float
and eight-byte
+double
. The only supported format is
+IEEE 754 (also
+know as ISO/IEC/IEEE 60559). Systems on which integer endianness differs from floating point
+endianness are not supported.
+
+Support for floating point types was removed from Boost 1.58.0 because there
+was not enough time to resolve reliability concerns. It is expected that
+floating point support will be available in Boost 1.59.0.
@@ -589,7 +589,7 @@ Blechmann, Tim Moore, tymofey, Tomas Puverle, Vincente Botet, Yuval Ronen and
Vitaly Budovsk. Apologies if anyone has been missed.
Last revised:
-23 February, 2015
+25 March, 2015
© Copyright Beman Dawes, 2011, 2013
Distributed under the Boost Software License, Version 1.0. See
www.boost.org/ LICENSE_1_0.txt
diff --git a/include/boost/endian/buffers.hpp b/include/boost/endian/buffers.hpp
index 572d3bf..b48b8de 100644
--- a/include/boost/endian/buffers.hpp
+++ b/include/boost/endian/buffers.hpp
@@ -377,102 +377,6 @@ namespace endian
protected:
char m_value[n_bits/8];
};
-
- // unaligned float big endian_buffer specialization
- template <>
- class endian_buffer< order::big, float, 32, align::no >
- {
- public:
- typedef float value_type;
-# ifndef BOOST_ENDIAN_NO_CTORS
- endian_buffer() BOOST_ENDIAN_DEFAULT_CONSTRUCT
- explicit endian_buffer(value_type val) BOOST_NOEXCEPT
- { detail::big_reverse_copy(val, m_value); }
-# endif
- endian_buffer & operator=(value_type val) BOOST_NOEXCEPT
- { detail::big_reverse_copy(val, m_value); return *this; }
- value_type value() const BOOST_NOEXCEPT
- {
- value_type tmp;
- detail::big_reverse_copy(m_value, tmp);
- return tmp;
- }
- const char* data() const BOOST_NOEXCEPT { return m_value; }
- protected:
- char m_value[sizeof(value_type)];
- };
-
- // unaligned double big endian_buffer specialization
- template <>
- class endian_buffer< order::big, double, 64, align::no >
- {
- public:
- typedef double value_type;
-# ifndef BOOST_ENDIAN_NO_CTORS
- endian_buffer() BOOST_ENDIAN_DEFAULT_CONSTRUCT
- explicit endian_buffer(value_type val) BOOST_NOEXCEPT
- { detail::big_reverse_copy(val, m_value); }
-# endif
- endian_buffer & operator=(value_type val) BOOST_NOEXCEPT
- { detail::big_reverse_copy(val, m_value); return *this; }
- value_type value() const BOOST_NOEXCEPT
- {
- value_type tmp;
- detail::big_reverse_copy(m_value, tmp);
- return tmp;
- }
- const char* data() const BOOST_NOEXCEPT { return m_value; }
- protected:
- char m_value[sizeof(value_type)];
- };
-
- // unaligned float little endian_buffer specialization
- template <>
- class endian_buffer< order::little, float, 32, align::no >
- {
- public:
- typedef float value_type;
-# ifndef BOOST_ENDIAN_NO_CTORS
- endian_buffer() BOOST_ENDIAN_DEFAULT_CONSTRUCT
- explicit endian_buffer(value_type val) BOOST_NOEXCEPT
- { detail::little_reverse_copy(val, m_value); }
-# endif
- endian_buffer & operator=(value_type val) BOOST_NOEXCEPT
- { detail::little_reverse_copy(val, m_value); return *this; }
- value_type value() const BOOST_NOEXCEPT
- {
- value_type tmp;
- detail::little_reverse_copy(m_value, tmp);
- return tmp;
- }
- const char* data() const BOOST_NOEXCEPT { return m_value; }
- protected:
- char m_value[sizeof(value_type)];
- };
-
- // unaligned double little endian_buffer specialization
- template <>
- class endian_buffer< order::little, double, 64, align::no >
- {
- public:
- typedef double value_type;
-# ifndef BOOST_ENDIAN_NO_CTORS
- endian_buffer() BOOST_ENDIAN_DEFAULT_CONSTRUCT
- explicit endian_buffer(value_type val) BOOST_NOEXCEPT
- { detail::little_reverse_copy(val, m_value); }
-# endif
- endian_buffer & operator=(value_type val) BOOST_NOEXCEPT
- { detail::little_reverse_copy(val, m_value); return *this; }
- value_type value() const BOOST_NOEXCEPT
- {
- value_type tmp;
- detail::little_reverse_copy(m_value, tmp);
- return tmp;
- }
- const char* data() const BOOST_NOEXCEPT { return m_value; }
- protected:
- char m_value[sizeof(value_type)];
- };
// unaligned little endian_buffer specialization
template