diff --git a/doc/arithmetic.html b/doc/arithmetic.html index 8480d22..b8d739e 100644 --- a/doc/arithmetic.html +++ b/doc/arithmetic.html @@ -123,10 +123,10 @@ namespace struct header { - big_int32_at file_code; - big_int32_at file_length; - little_int32_at version; - little_int32_at shape_type; + big_int32_t file_code; + big_int32_t file_length; + little_int32_t version; + little_int32_t shape_type; }; const char* filename = "test.dat"; @@ -433,49 +433,6 @@ usual operations on integers are supplied.
// typedefs - // 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 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; - - // unaligned big endian floating point types - typedef endian<order::big, float, 32, align::no> big_float32_t; - typedef endian<order::big, double, 64, align::no> big_float64_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; - - // aligned big endian signed integer types - typedef endian<order::big, int8_t, 8, align::yes> big_int8_at; - typedef endian<order::big, int16_t, 16, align::yes> big_int16_at; - typedef endian<order::big, int32_t, 32, align::yes> big_int32_at; - typedef endian<order::big, int64_t, 64, align::yes> big_int64_at; - - // aligned big endian unsigned integer types - typedef endian<order::big, uint8_t, 8, align::yes> big_uint8_at; - typedef endian<order::big, uint16_t, 16, align::yes> big_uint16_at; - 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 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; - typedef endian<order::little, int32_t, 32, align::yes> little_int32_at; - typedef endian<order::little, int64_t, 64, align::yes> little_int64_at; - - // aligned little endian unsigned integer types - typedef endian<order::little, uint8_t, 8, align::yes> little_uint8_at; - typedef endian<order::little, uint16_t, 16, align::yes> little_uint16_at; - 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 native endian typedefs are not provided because - // <cstdint> types are superior for that use case - // unaligned big endian signed integer types typedef endian<order::big, int_least8_t, 8> big_int8_t; typedef endian<order::big, int_least16_t, 16> big_int16_t; @@ -496,6 +453,10 @@ usual operations on integers are supplied. 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; typedef endian<order::little, int_least16_t, 16> little_int16_t; @@ -516,7 +477,11 @@ usual operations on integers are supplied. typedef endian<order::little, uint_least64_t, 56> little_uint56_t; typedef endian<order::little, uint_least64_t, 64> little_uint64_t; - // unaligned native endian signed integer types + // 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; typedef implementation-defined_int16_t native_int16_t; typedef implementation-defined_int24_t native_int24_t; @@ -526,7 +491,7 @@ usual operations on integers are supplied. typedef implementation-defined_int56_t native_int56_t; typedef implementation-defined_int64_t native_int64_t; - // unaligned native endian unsigned integer types + // unaligned native endian unsigned integer types typedef implementation-defined_uint8_t native_uint8_t; typedef implementation-defined_uint16_t native_uint16_t; typedef implementation-defined_uint24_t native_uint24_t; @@ -535,7 +500,42 @@ usual operations on integers are supplied. typedef implementation-defined_uint48_t native_uint48_t; typedef implementation-defined_uint56_t native_uint56_t; typedef implementation-defined_uint64_t native_uint64_t; + + // aligned big endian signed integer types + typedef endian<order::big, int8_t, 8, align::yes> big_int8_at; + typedef endian<order::big, int16_t, 16, align::yes> big_int16_at; + typedef endian<order::big, int32_t, 32, align::yes> big_int32_at; + typedef endian<order::big, int64_t, 64, align::yes> big_int64_at; + // aligned big endian unsigned integer types + typedef endian<order::big, uint8_t, 8, align::yes> big_uint8_at; + typedef endian<order::big, uint16_t, 16, align::yes> big_uint16_at; + 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; + typedef endian<order::little, int32_t, 32, align::yes> little_int32_at; + typedef endian<order::little, int64_t, 64, align::yes> little_int64_at; + + // aligned little endian unsigned integer types + typedef endian<order::little, uint8_t, 8, align::yes> little_uint8_at; + typedef endian<order::little, uint16_t, 16, align::yes> little_uint16_at; + 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 + } // namespace endian } // namespace boostThe implementation-defined
text above is either
@@ -619,8 +619,7 @@ programming.
Why bother with the aligned endian types? Aligned integer operations may be faster (as much as 10 to 20 times faster) if the endianness and alignment of the type matches the endianness and alignment requirements of the machine. The code, -however, is -likely to be somewhat less portable than with the unaligned types.
+however, will be somewhat less portable than with the unaligned types.Why provide the arithmetic operations? Providing a full set of operations reduces program clutter and makes code both easier to write and to read. Consider incrementing a variable in a record. It is very convenient to write:
@@ -694,7 +693,7 @@ differs from endian representation size. Vicente Botet and other reviewers suggested supporting floating point types.Last revised: -17 February, 2015
+23 February, 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 d234d03..173ab14 100644 --- a/doc/buffers.html +++ b/doc/buffers.html @@ -283,42 +283,42 @@ conventions for common use cases:big_uint
n_
buf_
t
big_uint
n_
buf_at
yes
big
big_float
n_
buf_
t
big_float
n_
buf_at
yes
big
little_int
n_
buf_
t
little_int
n_
buf_at
yes
little
little_uint
n_
buf_
t
little_uint
n_
buf_at
yes
little
little_float
n_
buf_
t
little_float
n_
buf_at
yes
little
native_float
n_
buf_
t
native_float
n_
buf_at
yes
native
The implementation-defined
text in typedefs above is either
@@ -663,7 +663,7 @@ any Boost object libraries.
Last revised: -17 February, 2015
+23 February, 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/index.html b/doc/index.html index ef60547..45a74fa 100644 --- a/doc/index.html +++ b/doc/index.html @@ -489,12 +489,8 @@ review_t
suffix, for
- consistency with the standard library integer type aliases and because use of
- aligned types is much more common than unaligned types._ut
suffix. This
- is short, yet stands out enough to alert the reader than unusual types are
- involved._t
suffix, but
+ the aligned-type alias names now have an _at
suffix..endian_reverse()
overloads for int8_t
and
uint8_t
have been added for improved generality. (Pierre Talbot)endian_reverse_inplace()
have been replaced with a single
@@ -593,7 +589,7 @@ Blechmann, Tim Moore, tymofey, Tomas Puverle, Vincente Botet, Yuval Ronen and
Vitaly Budovsk. Apologies if anyone has been missed.
Last revised:
-17 February, 2015
+23 February, 2015
© Copyright Beman Dawes, 2011, 2013
Distributed under the Boost Software License, Version 1.0. See
www.boost.org/ LICENSE_1_0.txt