mirror of
https://github.com/boostorg/endian.git
synced 2025-07-30 04:27:24 +02:00
Revert the default (*_t) types to unaligned, and used *_at to identify the aligned types. See mini-review thread for rationale.
This commit is contained in:
@ -1,4 +1,4 @@
|
|||||||
<html>
|
<html>
|
||||||
|
|
||||||
<head>
|
<head>
|
||||||
<meta http-equiv="Content-Language" content="en-us">
|
<meta http-equiv="Content-Language" content="en-us">
|
||||||
@ -123,10 +123,10 @@ namespace
|
|||||||
|
|
||||||
struct header
|
struct header
|
||||||
{
|
{
|
||||||
big_int32_t file_code;
|
big_int32_at file_code;
|
||||||
big_int32_t file_length;
|
big_int32_at file_length;
|
||||||
little_int32_t version;
|
little_int32_at version;
|
||||||
little_int32_t shape_type;
|
little_int32_at shape_type;
|
||||||
};
|
};
|
||||||
|
|
||||||
const char* filename = "test.dat";
|
const char* filename = "test.dat";
|
||||||
@ -219,7 +219,7 @@ enum class align {no, yes}; </pre>
|
|||||||
class endian_arithmetic;
|
class endian_arithmetic;
|
||||||
</pre>
|
</pre>
|
||||||
</blockquote>
|
</blockquote>
|
||||||
<p>Typedefs, such as <code>big_int32_ut</code>, provide convenient naming
|
<p>Typedefs, such as <code>big_int32_t</code>, provide convenient naming
|
||||||
conventions for common use cases:</p>
|
conventions for common use cases:</p>
|
||||||
<blockquote>
|
<blockquote>
|
||||||
<table border="1" cellpadding="5" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="49%">
|
<table border="1" cellpadding="5" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="49%">
|
||||||
@ -231,112 +231,112 @@ conventions for common use cases:</p>
|
|||||||
<td width="15%" align="center"><b><i>Sizes in bits (n)</i></b></td>
|
<td width="15%" align="center"><b><i>Sizes in bits (n)</i></b></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td width="18%"><code>big_int</code><b><i>n</i></b><code>_ut</code></td>
|
<td width="18%"><code>big_int</code><b><i>n</i></b><code>_t</code></td>
|
||||||
<td width="49%" align="center"><code>no</code></td>
|
<td width="49%" align="center"><code>no</code></td>
|
||||||
<td width="10%" align="center"><code>big</code></td>
|
<td width="10%" align="center"><code>big</code></td>
|
||||||
<td width="10%" align="center">signed</td>
|
<td width="10%" align="center">signed</td>
|
||||||
<td width="15%">8,16,24,32,40,48,56,64</td>
|
<td width="15%">8,16,24,32,40,48,56,64</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
|
||||||
<td width="18%"><code>big_uint</code><i><b>n</b></i><code>_ut</code></td>
|
|
||||||
<td width="49%" align="center"><code>no</code></td>
|
|
||||||
<td width="10%" align="center"><code>big</code></td>
|
|
||||||
<td width="10%" align="center">unsigned</td>
|
|
||||||
<td width="15%">8,16,24,32,40,48,56,64</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td width="18%"><code>big_float</code><i><b>n</b></i><code>_ut</code></td>
|
|
||||||
<td width="49%" align="center"><code>no</code></td>
|
|
||||||
<td width="10%" align="center"><code>big</code></td>
|
|
||||||
<td width="10%" align="center">signed</td>
|
|
||||||
<td width="15%">32,64</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td width="18%"><code>little_int</code><i><b>n</b></i><code>_ut</code></td>
|
|
||||||
<td width="49%" align="center"><code>no</code></td>
|
|
||||||
<td width="10%" align="center"><code>little</code></td>
|
|
||||||
<td width="10%" align="center">signed</td>
|
|
||||||
<td width="15%">8,16,24,32,40,48,56,64</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td width="18%"><code>little_uint</code><i><b>n</b></i><code>_ut</code></td>
|
|
||||||
<td width="49%" align="center"><code>no</code></td>
|
|
||||||
<td width="10%" align="center"><code>little</code></td>
|
|
||||||
<td width="10%" align="center">unsigned</td>
|
|
||||||
<td width="15%">8,16,24,32,40,48,56,64</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td width="18%"><code>little_float</code><i><b>n</b></i><code>_ut</code></td>
|
|
||||||
<td width="49%" align="center"><code>no</code></td>
|
|
||||||
<td width="10%" align="center"><code>little</code></td>
|
|
||||||
<td width="10%" align="center">signed</td>
|
|
||||||
<td width="15%">32,64</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td width="18%"><code>native_int</code><i><b>n</b></i><code>_ut</code></td>
|
|
||||||
<td width="49%" align="center"><code>no</code></td>
|
|
||||||
<td width="10%" align="center"><code>native</code></td>
|
|
||||||
<td width="10%" align="center">signed</td>
|
|
||||||
<td width="15%">8,16,24,32,40,48,56,64</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td width="18%"><code>native_uint</code><i><b>n</b></i><code>_ut</code></td>
|
|
||||||
<td width="49%" align="center"><code>no</code></td>
|
|
||||||
<td width="10%" align="center"><code>native</code></td>
|
|
||||||
<td width="10%" align="center">unsigned</td>
|
|
||||||
<td width="15%">8,16,24,32,40,48,56,64</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td width="18%"><code>native_float</code><i><b>n</b></i><code>_ut</code></td>
|
|
||||||
<td width="49%" align="center"><code>no</code></td>
|
|
||||||
<td width="10%" align="center"><code>native</code></td>
|
|
||||||
<td width="10%" align="center">signed</td>
|
|
||||||
<td width="15%">32,64</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td width="18%"><code>big_int</code><i><b>n</b></i><code>_t</code></td>
|
|
||||||
<td width="49%" align="center"><code>yes</code></td>
|
|
||||||
<td width="10%" align="center"><code>big</code></td>
|
|
||||||
<td width="10%" align="center">signed</td>
|
|
||||||
<td width="15%">8,16,32,64</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
<tr>
|
||||||
<td width="18%"><code>big_uint</code><i><b>n</b></i><code>_t</code></td>
|
<td width="18%"><code>big_uint</code><i><b>n</b></i><code>_t</code></td>
|
||||||
|
<td width="49%" align="center"><code>no</code></td>
|
||||||
|
<td width="10%" align="center"><code>big</code></td>
|
||||||
|
<td width="10%" align="center">unsigned</td>
|
||||||
|
<td width="15%">8,16,24,32,40,48,56,64</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td width="18%"><code>big_float</code><i><b>n</b></i><code>_t</code></td>
|
||||||
|
<td width="49%" align="center"><code>no</code></td>
|
||||||
|
<td width="10%" align="center"><code>big</code></td>
|
||||||
|
<td width="10%" align="center">signed</td>
|
||||||
|
<td width="15%">32,64</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td width="18%"><code>little_int</code><i><b>n</b></i><code>_t</code></td>
|
||||||
|
<td width="49%" align="center"><code>no</code></td>
|
||||||
|
<td width="10%" align="center"><code>little</code></td>
|
||||||
|
<td width="10%" align="center">signed</td>
|
||||||
|
<td width="15%">8,16,24,32,40,48,56,64</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td width="18%"><code>little_uint</code><i><b>n</b></i><code>_t</code></td>
|
||||||
|
<td width="49%" align="center"><code>no</code></td>
|
||||||
|
<td width="10%" align="center"><code>little</code></td>
|
||||||
|
<td width="10%" align="center">unsigned</td>
|
||||||
|
<td width="15%">8,16,24,32,40,48,56,64</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td width="18%"><code>little_float</code><i><b>n</b></i><code>_t</code></td>
|
||||||
|
<td width="49%" align="center"><code>no</code></td>
|
||||||
|
<td width="10%" align="center"><code>little</code></td>
|
||||||
|
<td width="10%" align="center">signed</td>
|
||||||
|
<td width="15%">32,64</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td width="18%"><code>native_int</code><i><b>n</b></i><code>_t</code></td>
|
||||||
|
<td width="49%" align="center"><code>no</code></td>
|
||||||
|
<td width="10%" align="center"><code>native</code></td>
|
||||||
|
<td width="10%" align="center">signed</td>
|
||||||
|
<td width="15%">8,16,24,32,40,48,56,64</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td width="18%"><code>native_uint</code><i><b>n</b></i><code>_t</code></td>
|
||||||
|
<td width="49%" align="center"><code>no</code></td>
|
||||||
|
<td width="10%" align="center"><code>native</code></td>
|
||||||
|
<td width="10%" align="center">unsigned</td>
|
||||||
|
<td width="15%">8,16,24,32,40,48,56,64</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td width="18%"><code>native_float</code><i><b>n</b></i><code>_t</code></td>
|
||||||
|
<td width="49%" align="center"><code>no</code></td>
|
||||||
|
<td width="10%" align="center"><code>native</code></td>
|
||||||
|
<td width="10%" align="center">signed</td>
|
||||||
|
<td width="15%">32,64</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td width="18%"><code>big_int</code><i><b>n</b></i><code>_at</code></td>
|
||||||
|
<td width="49%" align="center"><code>yes</code></td>
|
||||||
|
<td width="10%" align="center"><code>big</code></td>
|
||||||
|
<td width="10%" align="center">signed</td>
|
||||||
|
<td width="15%">8,16,32,64</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td width="18%"><code>big_uint</code><i><b>n</b></i><code>_at</code></td>
|
||||||
<td width="49%" align="center"><code>yes</code></td>
|
<td width="49%" align="center"><code>yes</code></td>
|
||||||
<td width="10%" align="center"><code>big</code></td>
|
<td width="10%" align="center"><code>big</code></td>
|
||||||
<td width="10%" align="center">unsigned</td>
|
<td width="10%" align="center">unsigned</td>
|
||||||
<td width="15%">8,16,32,64</td>
|
<td width="15%">8,16,32,64</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td width="18%"><code>big_float</code><i><b>n</b></i><code>_t</code></td>
|
<td width="18%"><code>big_float</code><i><b>n</b></i><code>_at</code></td>
|
||||||
<td width="49%" align="center"><code>yes</code></td>
|
<td width="49%" align="center"><code>yes</code></td>
|
||||||
<td width="10%" align="center"><code>big</code></td>
|
<td width="10%" align="center"><code>big</code></td>
|
||||||
<td width="10%" align="center">signed</td>
|
<td width="10%" align="center">signed</td>
|
||||||
<td width="15%">32,64</td>
|
<td width="15%">32,64</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td width="18%" dir="ltr"><code>little_int</code><i><b>n</b></i><code>_t</code></td>
|
<td width="18%" dir="ltr"><code>little_int</code><i><b>n</b></i><code>_at</code></td>
|
||||||
<td width="49%" align="center" dir="ltr"><code>yes</code></td>
|
<td width="49%" align="center" dir="ltr"><code>yes</code></td>
|
||||||
<td width="10%" align="center" dir="ltr"><code>little</code></td>
|
<td width="10%" align="center" dir="ltr"><code>little</code></td>
|
||||||
<td width="10%" align="center" dir="ltr">signed</td>
|
<td width="10%" align="center" dir="ltr">signed</td>
|
||||||
<td width="15%" dir="ltr">8,16,32,64</td>
|
<td width="15%" dir="ltr">8,16,32,64</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td width="18%" dir="ltr"><code>little_uint</code><i><b>n</b></i><code>_t</code></td>
|
<td width="18%" dir="ltr"><code>little_uint</code><i><b>n</b></i><code>_at</code></td>
|
||||||
<td width="49%" align="center" dir="ltr"><code>yes</code></td>
|
<td width="49%" align="center" dir="ltr"><code>yes</code></td>
|
||||||
<td width="10%" align="center" dir="ltr"><code>little</code></td>
|
<td width="10%" align="center" dir="ltr"><code>little</code></td>
|
||||||
<td width="10%" align="center" dir="ltr">unsigned</td>
|
<td width="10%" align="center" dir="ltr">unsigned</td>
|
||||||
<td width="15%" dir="ltr">8,16,32,64</td>
|
<td width="15%" dir="ltr">8,16,32,64</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td width="18%" dir="ltr"><code>little_float</code><i><b>n</b></i><code>_t</code></td>
|
<td width="18%" dir="ltr"><code>little_float</code><i><b>n</b></i><code>_at</code></td>
|
||||||
<td width="49%" align="center" dir="ltr"><code>yes</code></td>
|
<td width="49%" align="center" dir="ltr"><code>yes</code></td>
|
||||||
<td width="10%" align="center" dir="ltr"><code>little</code></td>
|
<td width="10%" align="center" dir="ltr"><code>little</code></td>
|
||||||
<td width="10%" align="center" dir="ltr">signed</td>
|
<td width="10%" align="center" dir="ltr">signed</td>
|
||||||
<td width="15%" dir="ltr">32,64</td>
|
<td width="15%" dir="ltr">32,64</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td width="18%"><code>native_float</code><i><b>n</b></i><code>_t</code></td>
|
<td width="18%"><code>native_float</code><i><b>n</b></i><code>_at</code></td>
|
||||||
<td width="49%" align="center"><code>yes</code></td>
|
<td width="49%" align="center"><code>yes</code></td>
|
||||||
<td width="10%" align="center"><code>native</code></td>
|
<td width="10%" align="center"><code>native</code></td>
|
||||||
<td width="10%" align="center">signed</td>
|
<td width="10%" align="center">signed</td>
|
||||||
@ -434,107 +434,107 @@ usual operations on integers are supplied.</p>
|
|||||||
// typedefs
|
// typedefs
|
||||||
|
|
||||||
// aligned big endian floating point types
|
// aligned big endian floating point types
|
||||||
typedef endian<order::big, float, 32, align::yes> big_float32_t;
|
typedef endian<order::big, float, 32, align::yes> big_float32_at;
|
||||||
typedef endian<order::big, double, 64, align::yes> big_float64_t;
|
typedef endian<order::big, double, 64, align::yes> big_float64_at;
|
||||||
|
|
||||||
// aligned little endian floating point types
|
// aligned little endian floating point types
|
||||||
typedef endian<order::little, float, 32, align::yes> little_float32_t;
|
typedef endian<order::little, float, 32, align::yes> little_float32_at;
|
||||||
typedef endian<order::little, double, 64, align::yes> little_float64_t;
|
typedef endian<order::little, double, 64, align::yes> little_float64_at;
|
||||||
|
|
||||||
// unaligned big endian floating point types
|
// unaligned big endian floating point types
|
||||||
typedef endian<order::big, float, 32, align::no> big_float32_ut;
|
typedef endian<order::big, float, 32, align::no> big_float32_t;
|
||||||
typedef endian<order::big, double, 64, align::no> big_float64_ut;
|
typedef endian<order::big, double, 64, align::no> big_float64_t;
|
||||||
|
|
||||||
// unaligned little endian floating point types
|
// unaligned little endian floating point types
|
||||||
typedef endian<order::little, float, 32, align::no> little_float32_ut;
|
typedef endian<order::little, float, 32, align::no> little_float32_t;
|
||||||
typedef endian<order::little, double, 64, align::no> little_float64_ut;
|
typedef endian<order::little, double, 64, align::no> little_float64_t;
|
||||||
|
|
||||||
// aligned big endian signed integer types
|
// aligned big endian signed integer types
|
||||||
typedef endian<order::big, int8_t, 8, align::yes> big_int8_t;
|
typedef endian<order::big, int8_t, 8, align::yes> big_int8_at;
|
||||||
typedef endian<order::big, int16_t, 16, align::yes> big_int16_t;
|
typedef endian<order::big, int16_t, 16, align::yes> big_int16_at;
|
||||||
typedef endian<order::big, int32_t, 32, align::yes> big_int32_t;
|
typedef endian<order::big, int32_t, 32, align::yes> big_int32_at;
|
||||||
typedef endian<order::big, int64_t, 64, align::yes> big_int64_t;
|
typedef endian<order::big, int64_t, 64, align::yes> big_int64_at;
|
||||||
|
|
||||||
// aligned big endian unsigned integer types
|
// aligned big endian unsigned integer types
|
||||||
typedef endian<order::big, uint8_t, 8, align::yes> big_uint8_t;
|
typedef endian<order::big, uint8_t, 8, align::yes> big_uint8_at;
|
||||||
typedef endian<order::big, uint16_t, 16, align::yes> big_uint16_t;
|
typedef endian<order::big, uint16_t, 16, align::yes> big_uint16_at;
|
||||||
typedef endian<order::big, uint32_t, 32, align::yes> big_uint32_t;
|
typedef endian<order::big, uint32_t, 32, align::yes> big_uint32_at;
|
||||||
typedef endian<order::big, uint64_t, 64, align::yes> big_uint64_t;
|
typedef endian<order::big, uint64_t, 64, align::yes> big_uint64_at;
|
||||||
|
|
||||||
// aligned little endian signed integer types
|
// aligned little endian signed integer types
|
||||||
typedef endian<order::little, int8_t, 8, align::yes> little_int8_t;
|
typedef endian<order::little, int8_t, 8, align::yes> little_int8_at;
|
||||||
typedef endian<order::little, int16_t, 16, align::yes> little_int16_t;
|
typedef endian<order::little, int16_t, 16, align::yes> little_int16_at;
|
||||||
typedef endian<order::little, int32_t, 32, align::yes> little_int32_t;
|
typedef endian<order::little, int32_t, 32, align::yes> little_int32_at;
|
||||||
typedef endian<order::little, int64_t, 64, align::yes> little_int64_t;
|
typedef endian<order::little, int64_t, 64, align::yes> little_int64_at;
|
||||||
|
|
||||||
// aligned little endian unsigned integer types
|
// aligned little endian unsigned integer types
|
||||||
typedef endian<order::little, uint8_t, 8, align::yes> little_uint8_t;
|
typedef endian<order::little, uint8_t, 8, align::yes> little_uint8_at;
|
||||||
typedef endian<order::little, uint16_t, 16, align::yes> little_uint16_t;
|
typedef endian<order::little, uint16_t, 16, align::yes> little_uint16_at;
|
||||||
typedef endian<order::little, uint32_t, 32, align::yes> little_uint32_t;
|
typedef endian<order::little, uint32_t, 32, align::yes> little_uint32_at;
|
||||||
typedef endian<order::little, uint64_t, 64, align::yes> little_uint64_t;
|
typedef endian<order::little, uint64_t, 64, align::yes> little_uint64_at;
|
||||||
|
|
||||||
// aligned native endian typedefs are not provided because
|
// aligned native endian typedefs are not provided because
|
||||||
// <cstdint> types are superior for that use case
|
// <cstdint> types are superior for that use case
|
||||||
|
|
||||||
// unaligned big endian signed integer types
|
// unaligned big endian signed integer types
|
||||||
typedef endian<order::big, int_least8_t, 8> big_int8_ut;
|
typedef endian<order::big, int_least8_t, 8> big_int8_t;
|
||||||
typedef endian<order::big, int_least16_t, 16> big_int16_ut;
|
typedef endian<order::big, int_least16_t, 16> big_int16_t;
|
||||||
typedef endian<order::big, int_least32_t, 24> big_int24_ut;
|
typedef endian<order::big, int_least32_t, 24> big_int24_t;
|
||||||
typedef endian<order::big, int_least32_t, 32> big_int32_ut;
|
typedef endian<order::big, int_least32_t, 32> big_int32_t;
|
||||||
typedef endian<order::big, int_least64_t, 40> big_int40_ut;
|
typedef endian<order::big, int_least64_t, 40> big_int40_t;
|
||||||
typedef endian<order::big, int_least64_t, 48> big_int48_ut;
|
typedef endian<order::big, int_least64_t, 48> big_int48_t;
|
||||||
typedef endian<order::big, int_least64_t, 56> big_int56_ut;
|
typedef endian<order::big, int_least64_t, 56> big_int56_t;
|
||||||
typedef endian<order::big, int_least64_t, 64> big_int64_ut;
|
typedef endian<order::big, int_least64_t, 64> big_int64_t;
|
||||||
|
|
||||||
// unaligned big endian unsigned integer types
|
// unaligned big endian unsigned integer types
|
||||||
typedef endian<order::big, uint_least8_t, 8> big_uint8_ut;
|
typedef endian<order::big, uint_least8_t, 8> big_uint8_t;
|
||||||
typedef endian<order::big, uint_least16_t, 16> big_uint16_ut;
|
typedef endian<order::big, uint_least16_t, 16> big_uint16_t;
|
||||||
typedef endian<order::big, uint_least32_t, 24> big_uint24_ut;
|
typedef endian<order::big, uint_least32_t, 24> big_uint24_t;
|
||||||
typedef endian<order::big, uint_least32_t, 32> big_uint32_ut;
|
typedef endian<order::big, uint_least32_t, 32> big_uint32_t;
|
||||||
typedef endian<order::big, uint_least64_t, 40> big_uint40_ut;
|
typedef endian<order::big, uint_least64_t, 40> big_uint40_t;
|
||||||
typedef endian<order::big, uint_least64_t, 48> big_uint48_ut;
|
typedef endian<order::big, uint_least64_t, 48> big_uint48_t;
|
||||||
typedef endian<order::big, uint_least64_t, 56> big_uint56_ut;
|
typedef endian<order::big, uint_least64_t, 56> big_uint56_t;
|
||||||
typedef endian<order::big, uint_least64_t, 64> big_uint64_ut;
|
typedef endian<order::big, uint_least64_t, 64> big_uint64_t;
|
||||||
|
|
||||||
// unaligned little endian signed integer types
|
// unaligned little endian signed integer types
|
||||||
typedef endian<order::little, int_least8_t, 8> little_int8_ut;
|
typedef endian<order::little, int_least8_t, 8> little_int8_t;
|
||||||
typedef endian<order::little, int_least16_t, 16> little_int16_ut;
|
typedef endian<order::little, int_least16_t, 16> little_int16_t;
|
||||||
typedef endian<order::little, int_least32_t, 24> little_int24_ut;
|
typedef endian<order::little, int_least32_t, 24> little_int24_t;
|
||||||
typedef endian<order::little, int_least32_t, 32> little_int32_ut;
|
typedef endian<order::little, int_least32_t, 32> little_int32_t;
|
||||||
typedef endian<order::little, int_least64_t, 40> little_int40_ut;
|
typedef endian<order::little, int_least64_t, 40> little_int40_t;
|
||||||
typedef endian<order::little, int_least64_t, 48> little_int48_ut;
|
typedef endian<order::little, int_least64_t, 48> little_int48_t;
|
||||||
typedef endian<order::little, int_least64_t, 56> little_int56_ut;
|
typedef endian<order::little, int_least64_t, 56> little_int56_t;
|
||||||
typedef endian<order::little, int_least64_t, 64> little_int64_ut;
|
typedef endian<order::little, int_least64_t, 64> little_int64_t;
|
||||||
|
|
||||||
// unaligned little endian unsigned integer types
|
// unaligned little endian unsigned integer types
|
||||||
typedef endian<order::little, uint_least8_t, 8> little_uint8_ut;
|
typedef endian<order::little, uint_least8_t, 8> little_uint8_t;
|
||||||
typedef endian<order::little, uint_least16_t, 16> little_uint16_ut;
|
typedef endian<order::little, uint_least16_t, 16> little_uint16_t;
|
||||||
typedef endian<order::little, uint_least32_t, 24> little_uint24_ut;
|
typedef endian<order::little, uint_least32_t, 24> little_uint24_t;
|
||||||
typedef endian<order::little, uint_least32_t, 32> little_uint32_ut;
|
typedef endian<order::little, uint_least32_t, 32> little_uint32_t;
|
||||||
typedef endian<order::little, uint_least64_t, 40> little_uint40_ut;
|
typedef endian<order::little, uint_least64_t, 40> little_uint40_t;
|
||||||
typedef endian<order::little, uint_least64_t, 48> little_uint48_ut;
|
typedef endian<order::little, uint_least64_t, 48> little_uint48_t;
|
||||||
typedef endian<order::little, uint_least64_t, 56> little_uint56_ut;
|
typedef endian<order::little, uint_least64_t, 56> little_uint56_t;
|
||||||
typedef endian<order::little, uint_least64_t, 64> little_uint64_ut;
|
typedef endian<order::little, uint_least64_t, 64> little_uint64_t;
|
||||||
|
|
||||||
// unaligned native endian signed integer types
|
// unaligned native endian signed integer types
|
||||||
typedef <b><i>implementation-defined</i></b>_int8_t native_int8_ut;
|
typedef <b><i>implementation-defined</i></b>_int8_t native_int8_t;
|
||||||
typedef <b><i>implementation-defined</i></b>_int16_t native_int16_ut;
|
typedef <b><i>implementation-defined</i></b>_int16_t native_int16_t;
|
||||||
typedef <b><i>implementation-defined</i></b>_int24_t native_int24_ut;
|
typedef <b><i>implementation-defined</i></b>_int24_t native_int24_t;
|
||||||
typedef <b><i>implementation-defined</i></b>_int32_t native_int32_ut;
|
typedef <b><i>implementation-defined</i></b>_int32_t native_int32_t;
|
||||||
typedef <b><i>implementation-defined</i></b>_int40_t native_int40_ut;
|
typedef <b><i>implementation-defined</i></b>_int40_t native_int40_t;
|
||||||
typedef <b><i>implementation-defined</i></b>_int48_t native_int48_ut;
|
typedef <b><i>implementation-defined</i></b>_int48_t native_int48_t;
|
||||||
typedef <b><i>implementation-defined</i></b>_int56_t native_int56_ut;
|
typedef <b><i>implementation-defined</i></b>_int56_t native_int56_t;
|
||||||
typedef <b><i>implementation-defined</i></b>_int64_t native_int64_ut;
|
typedef <b><i>implementation-defined</i></b>_int64_t native_int64_t;
|
||||||
|
|
||||||
// unaligned native endian unsigned integer types
|
// unaligned native endian unsigned integer types
|
||||||
typedef <b><i>implementation-defined</i></b>_uint8_t native_uint8_ut;
|
typedef <b><i>implementation-defined</i></b>_uint8_t native_uint8_t;
|
||||||
typedef <b><i>implementation-defined</i></b>_uint16_t native_uint16_ut;
|
typedef <b><i>implementation-defined</i></b>_uint16_t native_uint16_t;
|
||||||
typedef <b><i>implementation-defined</i></b>_uint24_t native_uint24_ut;
|
typedef <b><i>implementation-defined</i></b>_uint24_t native_uint24_t;
|
||||||
typedef <b><i>implementation-defined</i></b>_uint32_t native_uint32_ut;
|
typedef <b><i>implementation-defined</i></b>_uint32_t native_uint32_t;
|
||||||
typedef <b><i>implementation-defined</i></b>_uint40_t native_uint40_ut;
|
typedef <b><i>implementation-defined</i></b>_uint40_t native_uint40_t;
|
||||||
typedef <b><i>implementation-defined</i></b>_uint48_t native_uint48_ut;
|
typedef <b><i>implementation-defined</i></b>_uint48_t native_uint48_t;
|
||||||
typedef <b><i>implementation-defined</i></b>_uint56_t native_uint56_ut;
|
typedef <b><i>implementation-defined</i></b>_uint56_t native_uint56_t;
|
||||||
typedef <b><i>implementation-defined</i></b>_uint64_t native_uint64_ut;
|
typedef <b><i>implementation-defined</i></b>_uint64_t native_uint64_t;
|
||||||
|
|
||||||
} // namespace endian
|
} // namespace endian
|
||||||
} // namespace boost</pre>
|
} // namespace boost</pre>
|
||||||
|
168
doc/buffers.html
168
doc/buffers.html
@ -1,4 +1,4 @@
|
|||||||
<html>
|
<html>
|
||||||
|
|
||||||
<head>
|
<head>
|
||||||
<meta http-equiv="Content-Language" content="en-us">
|
<meta http-equiv="Content-Language" content="en-us">
|
||||||
@ -201,7 +201,7 @@ enum class align {no, yes}; </pre>
|
|||||||
class endian_buffer;
|
class endian_buffer;
|
||||||
</pre>
|
</pre>
|
||||||
</blockquote>
|
</blockquote>
|
||||||
<p>Typedefs, such as <code>big_int32_buf_ut</code>, provide convenient naming
|
<p>Typedefs, such as <code>big_int32_buf_t</code>, provide convenient naming
|
||||||
conventions for common use cases:</p>
|
conventions for common use cases:</p>
|
||||||
<blockquote>
|
<blockquote>
|
||||||
<table border="1" cellpadding="5" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="49%">
|
<table border="1" cellpadding="5" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="49%">
|
||||||
@ -213,70 +213,70 @@ conventions for common use cases:</p>
|
|||||||
<td width="15%" align="center"><b><i>Sizes in bits (n)</i></b></td>
|
<td width="15%" align="center"><b><i>Sizes in bits (n)</i></b></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td width="18%" dir="ltr"><code>big_int</code><b><i>n</i></b><code>_buf_ut</code></td>
|
<td width="18%" dir="ltr"><code>big_int</code><b><i>n</i></b><code>_buf_t</code></td>
|
||||||
<td width="49%" align="center" dir="ltr"><code>no</code></td>
|
<td width="49%" align="center" dir="ltr"><code>no</code></td>
|
||||||
<td width="10%" align="center" dir="ltr"><code>big</code></td>
|
<td width="10%" align="center" dir="ltr"><code>big</code></td>
|
||||||
<td width="10%" align="center" dir="ltr">signed</td>
|
<td width="10%" align="center" dir="ltr">signed</td>
|
||||||
<td width="15%" dir="ltr">8,16,24,32,40,48,56,64</td>
|
<td width="15%" dir="ltr">8,16,24,32,40,48,56,64</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td width="18%" dir="ltr"><code>big_uint</code><i><b>n</b></i><code>_buf_ut</code></td>
|
<td width="18%" dir="ltr"><code>big_uint</code><i><b>n</b></i><code>_buf_t</code></td>
|
||||||
<td width="49%" align="center" dir="ltr"><code>no</code></td>
|
<td width="49%" align="center" dir="ltr"><code>no</code></td>
|
||||||
<td width="10%" align="center" dir="ltr"><code>big</code></td>
|
<td width="10%" align="center" dir="ltr"><code>big</code></td>
|
||||||
<td width="10%" align="center" dir="ltr">unsigned</td>
|
<td width="10%" align="center" dir="ltr">unsigned</td>
|
||||||
<td width="15%" dir="ltr">8,16,24,32,40,48,56,64</td>
|
<td width="15%" dir="ltr">8,16,24,32,40,48,56,64</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td width="18%" dir="ltr"><code>big_float</code><i><b>n</b></i><code>_buf_ut</code></td>
|
<td width="18%" dir="ltr"><code>big_float</code><i><b>n</b></i><code>_buf_t</code></td>
|
||||||
<td width="49%" align="center" dir="ltr"><code>no</code></td>
|
<td width="49%" align="center" dir="ltr"><code>no</code></td>
|
||||||
<td width="10%" align="center" dir="ltr"><code>big</code></td>
|
<td width="10%" align="center" dir="ltr"><code>big</code></td>
|
||||||
<td width="10%" align="center" dir="ltr">signed</td>
|
<td width="10%" align="center" dir="ltr">signed</td>
|
||||||
<td width="15%" dir="ltr">32,64</td>
|
<td width="15%" dir="ltr">32,64</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td width="18%"><code>little_int</code><i><b>n</b></i><code>_buf_ut</code></td>
|
<td width="18%"><code>little_int</code><i><b>n</b></i><code>_buf_t</code></td>
|
||||||
<td width="49%" align="center"><code>no</code></td>
|
<td width="49%" align="center"><code>no</code></td>
|
||||||
<td width="10%" align="center"><code>little</code></td>
|
<td width="10%" align="center"><code>little</code></td>
|
||||||
<td width="10%" align="center">signed</td>
|
<td width="10%" align="center">signed</td>
|
||||||
<td width="15%">8,16,24,32,40,48,56,64</td>
|
<td width="15%">8,16,24,32,40,48,56,64</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td width="18%"><code>little_uint</code><i><b>n</b></i><code>_buf_ut</code></td>
|
<td width="18%"><code>little_uint</code><i><b>n</b></i><code>_buf_t</code></td>
|
||||||
<td width="49%" align="center"><code>no</code></td>
|
<td width="49%" align="center"><code>no</code></td>
|
||||||
<td width="10%" align="center"><code>little</code></td>
|
<td width="10%" align="center"><code>little</code></td>
|
||||||
<td width="10%" align="center">unsigned</td>
|
<td width="10%" align="center">unsigned</td>
|
||||||
<td width="15%">8,16,24,32,40,48,56,64</td>
|
<td width="15%">8,16,24,32,40,48,56,64</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td width="18%"><code>little_float</code><i><b>n</b></i><code>_buf_ut</code></td>
|
<td width="18%"><code>little_float</code><i><b>n</b></i><code>_buf_t</code></td>
|
||||||
<td width="49%" align="center"><code>no</code></td>
|
<td width="49%" align="center"><code>no</code></td>
|
||||||
<td width="10%" align="center"><code>little</code></td>
|
<td width="10%" align="center"><code>little</code></td>
|
||||||
<td width="10%" align="center">signed</td>
|
<td width="10%" align="center">signed</td>
|
||||||
<td width="15%">32,64</td>
|
<td width="15%">32,64</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td width="18%"><code>native_int</code><i><b>n</b></i><code>_buf_ut</code></td>
|
<td width="18%"><code>native_int</code><i><b>n</b></i><code>_buf_t</code></td>
|
||||||
<td width="49%" align="center"><code>no</code></td>
|
<td width="49%" align="center"><code>no</code></td>
|
||||||
<td width="10%" align="center"><code>native</code></td>
|
<td width="10%" align="center"><code>native</code></td>
|
||||||
<td width="10%" align="center">signed</td>
|
<td width="10%" align="center">signed</td>
|
||||||
<td width="15%">8,16,24,32,40,48,56,64</td>
|
<td width="15%">8,16,24,32,40,48,56,64</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td width="18%"><code>native_uint</code><i><b>n</b></i><code>_buf_ut</code></td>
|
<td width="18%"><code>native_uint</code><i><b>n</b></i><code>_buf_t</code></td>
|
||||||
<td width="49%" align="center"><code>no</code></td>
|
<td width="49%" align="center"><code>no</code></td>
|
||||||
<td width="10%" align="center"><code>native</code></td>
|
<td width="10%" align="center"><code>native</code></td>
|
||||||
<td width="10%" align="center">unsigned</td>
|
<td width="10%" align="center">unsigned</td>
|
||||||
<td width="15%">8,16,24,32,40,48,56,64</td>
|
<td width="15%">8,16,24,32,40,48,56,64</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td width="18%"><code>native_float</code><i><b>n</b></i><code>_buf_ut</code></td>
|
<td width="18%"><code>native_float</code><i><b>n</b></i><code>_buf_t</code></td>
|
||||||
<td width="49%" align="center"><code>no</code></td>
|
<td width="49%" align="center"><code>no</code></td>
|
||||||
<td width="10%" align="center"><code>native</code></td>
|
<td width="10%" align="center"><code>native</code></td>
|
||||||
<td width="10%" align="center">signed</td>
|
<td width="10%" align="center">signed</td>
|
||||||
<td width="15%">32,64</td>
|
<td width="15%">32,64</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td width="18%"><code>big_int</code><i><b>n</b></i><code>_buf_t</code></td>
|
<td width="18%"><code>big_int</code><i><b>n</b></i><code>_buf_at</code></td>
|
||||||
<td width="49%" align="center"><code>yes</code></td>
|
<td width="49%" align="center"><code>yes</code></td>
|
||||||
<td width="10%" align="center"><code>big</code></td>
|
<td width="10%" align="center"><code>big</code></td>
|
||||||
<td width="10%" align="center">signed</td>
|
<td width="10%" align="center">signed</td>
|
||||||
@ -399,107 +399,107 @@ usual operations on integers are supplied.</p>
|
|||||||
// typedefs
|
// typedefs
|
||||||
|
|
||||||
// aligned big endian floating point buffers
|
// aligned big endian floating point buffers
|
||||||
typedef endian_buffer<order::big, float, 32, align::yes> big_float32_buf_t;
|
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_t;
|
typedef endian_buffer<order::big, double, 64, align::yes> big_float64_buf_at;
|
||||||
|
|
||||||
// aligned little endian floating point buffers
|
// aligned little endian floating point buffers
|
||||||
typedef endian_buffer<order::little, float, 32, align::yes> little_float32_buf_t;
|
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_t;
|
typedef endian_buffer<order::little, double, 64, align::yes> little_float64_buf_at;
|
||||||
|
|
||||||
// unaligned big endian floating point buffers
|
// unaligned big endian floating point buffers
|
||||||
typedef endian_buffer<order::big, float, 32, align::no> big_float32_buf_ut;
|
typedef endian_buffer<order::big, float, 32, align::no> big_float32_buf_t;
|
||||||
typedef endian_buffer<order::big, double, 64, align::no> big_float64_buf_ut;
|
typedef endian_buffer<order::big, double, 64, align::no> big_float64_buf_t;
|
||||||
|
|
||||||
// unaligned little endian floating point buffers
|
// unaligned little endian floating point buffers
|
||||||
typedef endian_buffer<order::little, float, 32, align::no> little_float32_buf_ut;
|
typedef endian_buffer<order::little, float, 32, align::no> little_float32_buf_t;
|
||||||
typedef endian_buffer<order::little, double, 64, align::no> little_float64_buf_ut;
|
typedef endian_buffer<order::little, double, 64, align::no> little_float64_buf_t;
|
||||||
|
|
||||||
// aligned big endian signed integer buffers
|
// aligned big endian signed integer buffers
|
||||||
typedef endian_buffer<order::big, int8_t, 8, align::yes> big_int8_buf_t;
|
typedef endian_buffer<order::big, int8_t, 8, align::yes> big_int8_buf_at;
|
||||||
typedef endian_buffer<order::big, int16_t, 16, align::yes> big_int16_buf_t;
|
typedef endian_buffer<order::big, int16_t, 16, align::yes> big_int16_buf_at;
|
||||||
typedef endian_buffer<order::big, int32_t, 32, align::yes> big_int32_buf_t;
|
typedef endian_buffer<order::big, int32_t, 32, align::yes> big_int32_buf_at;
|
||||||
typedef endian_buffer<order::big, int64_t, 64, align::yes> big_int64_buf_t;
|
typedef endian_buffer<order::big, int64_t, 64, align::yes> big_int64_buf_at;
|
||||||
|
|
||||||
// aligned big endian unsigned integer buffers
|
// aligned big endian unsigned integer buffers
|
||||||
typedef endian_buffer<order::big, uint8_t, 8, align::yes> big_uint8_buf_t;
|
typedef endian_buffer<order::big, uint8_t, 8, align::yes> big_uint8_buf_at;
|
||||||
typedef endian_buffer<order::big, uint16_t, 16, align::yes> big_uint16_buf_t;
|
typedef endian_buffer<order::big, uint16_t, 16, align::yes> big_uint16_buf_at;
|
||||||
typedef endian_buffer<order::big, uint32_t, 32, align::yes> big_uint32_buf_t;
|
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_t;
|
typedef endian_buffer<order::big, uint64_t, 64, align::yes> big_uint64_buf_at;
|
||||||
|
|
||||||
// aligned little endian signed integer buffers
|
// aligned little endian signed integer buffers
|
||||||
typedef endian_buffer<order::little, int8_t, 8, align::yes> little_int8_buf_t;
|
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_t;
|
typedef endian_buffer<order::little, int16_t, 16, align::yes> little_int16_buf_at;
|
||||||
typedef endian_buffer<order::little, int32_t, 32, align::yes> little_int32_buf_t;
|
typedef endian_buffer<order::little, int32_t, 32, align::yes> little_int32_buf_at;
|
||||||
typedef endian_buffer<order::little, int64_t, 64, align::yes> little_int64_buf_t;
|
typedef endian_buffer<order::little, int64_t, 64, align::yes> little_int64_buf_at;
|
||||||
|
|
||||||
// aligned little endian unsigned integer buffers
|
// aligned little endian unsigned integer buffers
|
||||||
typedef endian_buffer<order::little, uint8_t, 8, align::yes> little_uint8_buf_t;
|
typedef endian_buffer<order::little, uint8_t, 8, align::yes> little_uint8_buf_at;
|
||||||
typedef endian_buffer<order::little, uint16_t, 16, align::yes> little_uint16_buf_t;
|
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_t;
|
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_t;
|
typedef endian_buffer<order::little, uint64_t, 64, align::yes> little_uint64_buf_at;
|
||||||
|
|
||||||
// aligned native endian typedefs are not provided because
|
// aligned native endian typedefs are not provided because
|
||||||
// <cstdint> types are superior for this use case
|
// <cstdint> types are superior for this use case
|
||||||
|
|
||||||
// unaligned big endian signed integer buffers
|
// unaligned big endian signed integer buffers
|
||||||
typedef endian_buffer<order::big, int_least8_t, 8> big_int8_buf_ut;
|
typedef endian_buffer<order::big, int_least8_t, 8> big_int8_buf_t;
|
||||||
typedef endian_buffer<order::big, int_least16_t, 16> big_int16_buf_ut;
|
typedef endian_buffer<order::big, int_least16_t, 16> big_int16_buf_t;
|
||||||
typedef endian_buffer<order::big, int_least32_t, 24> big_int24_buf_ut;
|
typedef endian_buffer<order::big, int_least32_t, 24> big_int24_buf_t;
|
||||||
typedef endian_buffer<order::big, int_least32_t, 32> big_int32_buf_ut;
|
typedef endian_buffer<order::big, int_least32_t, 32> big_int32_buf_t;
|
||||||
typedef endian_buffer<order::big, int_least64_t, 40> big_int40_buf_ut;
|
typedef endian_buffer<order::big, int_least64_t, 40> big_int40_buf_t;
|
||||||
typedef endian_buffer<order::big, int_least64_t, 48> big_int48_buf_ut;
|
typedef endian_buffer<order::big, int_least64_t, 48> big_int48_buf_t;
|
||||||
typedef endian_buffer<order::big, int_least64_t, 56> big_int56_buf_ut;
|
typedef endian_buffer<order::big, int_least64_t, 56> big_int56_buf_t;
|
||||||
typedef endian_buffer<order::big, int_least64_t, 64> big_int64_buf_ut;
|
typedef endian_buffer<order::big, int_least64_t, 64> big_int64_buf_t;
|
||||||
|
|
||||||
// unaligned big endian unsigned integer buffers
|
// unaligned big endian unsigned integer buffers
|
||||||
typedef endian_buffer<order::big, uint_least8_t, 8> big_uint8_buf_ut;
|
typedef endian_buffer<order::big, uint_least8_t, 8> big_uint8_buf_t;
|
||||||
typedef endian_buffer<order::big, uint_least16_t, 16> big_uint16_buf_ut;
|
typedef endian_buffer<order::big, uint_least16_t, 16> big_uint16_buf_t;
|
||||||
typedef endian_buffer<order::big, uint_least32_t, 24> big_uint24_buf_ut;
|
typedef endian_buffer<order::big, uint_least32_t, 24> big_uint24_buf_t;
|
||||||
typedef endian_buffer<order::big, uint_least32_t, 32> big_uint32_buf_ut;
|
typedef endian_buffer<order::big, uint_least32_t, 32> big_uint32_buf_t;
|
||||||
typedef endian_buffer<order::big, uint_least64_t, 40> big_uint40_buf_ut;
|
typedef endian_buffer<order::big, uint_least64_t, 40> big_uint40_buf_t;
|
||||||
typedef endian_buffer<order::big, uint_least64_t, 48> big_uint48_buf_ut;
|
typedef endian_buffer<order::big, uint_least64_t, 48> big_uint48_buf_t;
|
||||||
typedef endian_buffer<order::big, uint_least64_t, 56> big_uint56_buf_ut;
|
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_ut;
|
typedef endian_buffer<order::big, uint_least64_t, 64> big_uint64_buf_t;
|
||||||
|
|
||||||
// unaligned little endian signed integer buffers
|
// unaligned little endian signed integer buffers
|
||||||
typedef endian_buffer<order::little, int_least8_t, 8> little_int8_buf_ut;
|
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_ut;
|
typedef endian_buffer<order::little, int_least16_t, 16> little_int16_buf_t;
|
||||||
typedef endian_buffer<order::little, int_least32_t, 24> little_int24_buf_ut;
|
typedef endian_buffer<order::little, int_least32_t, 24> little_int24_buf_t;
|
||||||
typedef endian_buffer<order::little, int_least32_t, 32> little_int32_buf_ut;
|
typedef endian_buffer<order::little, int_least32_t, 32> little_int32_buf_t;
|
||||||
typedef endian_buffer<order::little, int_least64_t, 40> little_int40_buf_ut;
|
typedef endian_buffer<order::little, int_least64_t, 40> little_int40_buf_t;
|
||||||
typedef endian_buffer<order::little, int_least64_t, 48> little_int48_buf_ut;
|
typedef endian_buffer<order::little, int_least64_t, 48> little_int48_buf_t;
|
||||||
typedef endian_buffer<order::little, int_least64_t, 56> little_int56_buf_ut;
|
typedef endian_buffer<order::little, int_least64_t, 56> little_int56_buf_t;
|
||||||
typedef endian_buffer<order::little, int_least64_t, 64> little_int64_buf_ut;
|
typedef endian_buffer<order::little, int_least64_t, 64> little_int64_buf_t;
|
||||||
|
|
||||||
// unaligned little endian unsigned integer buffers
|
// unaligned little endian unsigned integer buffers
|
||||||
typedef endian_buffer<order::little, uint_least8_t, 8> little_uint8_buf_ut;
|
typedef endian_buffer<order::little, uint_least8_t, 8> little_uint8_buf_t;
|
||||||
typedef endian_buffer<order::little, uint_least16_t, 16> little_uint16_buf_ut;
|
typedef endian_buffer<order::little, uint_least16_t, 16> little_uint16_buf_t;
|
||||||
typedef endian_buffer<order::little, uint_least32_t, 24> little_uint24_buf_ut;
|
typedef endian_buffer<order::little, uint_least32_t, 24> little_uint24_buf_t;
|
||||||
typedef endian_buffer<order::little, uint_least32_t, 32> little_uint32_buf_ut;
|
typedef endian_buffer<order::little, uint_least32_t, 32> little_uint32_buf_t;
|
||||||
typedef endian_buffer<order::little, uint_least64_t, 40> little_uint40_buf_ut;
|
typedef endian_buffer<order::little, uint_least64_t, 40> little_uint40_buf_t;
|
||||||
typedef endian_buffer<order::little, uint_least64_t, 48> little_uint48_buf_ut;
|
typedef endian_buffer<order::little, uint_least64_t, 48> little_uint48_buf_t;
|
||||||
typedef endian_buffer<order::little, uint_least64_t, 56> little_uint56_buf_ut;
|
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_ut;
|
typedef endian_buffer<order::little, uint_least64_t, 64> little_uint64_buf_t;
|
||||||
|
|
||||||
// unaligned native endian signed integer types
|
// unaligned native endian signed integer types
|
||||||
typedef <b><i>implementation-defined</i></b>_int8_buf_ut native_int8_buf_ut;
|
typedef <b><i>implementation-defined</i></b>_int8_buf_t native_int8_buf_t;
|
||||||
typedef <b><i>implementation-defined</i></b>_int16_buf_ut native_int16_buf_ut;
|
typedef <b><i>implementation-defined</i></b>_int16_buf_t native_int16_buf_t;
|
||||||
typedef <b><i>implementation-defined</i></b>_int24_buf_ut native_int24_buf_ut;
|
typedef <b><i>implementation-defined</i></b>_int24_buf_t native_int24_buf_t;
|
||||||
typedef <b><i>implementation-defined</i></b>_int32_buf_ut native_int32_buf_ut;
|
typedef <b><i>implementation-defined</i></b>_int32_buf_t native_int32_buf_t;
|
||||||
typedef <b><i>implementation-defined</i></b>_int40_buf_ut native_int40_buf_ut;
|
typedef <b><i>implementation-defined</i></b>_int40_buf_t native_int40_buf_t;
|
||||||
typedef <b><i>implementation-defined</i></b>_int48_buf_ut native_int48_buf_ut;
|
typedef <b><i>implementation-defined</i></b>_int48_buf_t native_int48_buf_t;
|
||||||
typedef <b><i>implementation-defined</i></b>_int56_buf_ut native_int56_buf_ut;
|
typedef <b><i>implementation-defined</i></b>_int56_buf_t native_int56_buf_t;
|
||||||
typedef <b><i>implementation-defined</i></b>_int64_buf_ut native_int64_buf_ut;
|
typedef <b><i>implementation-defined</i></b>_int64_buf_t native_int64_buf_t;
|
||||||
|
|
||||||
// unaligned native endian unsigned integer types
|
// unaligned native endian unsigned integer types
|
||||||
typedef <b><i>implementation-defined</i></b>_uint8_buf_ut native_uint8_buf_ut;
|
typedef <b><i>implementation-defined</i></b>_uint8_buf_t native_uint8_buf_t;
|
||||||
typedef <b><i>implementation-defined</i></b>_uint16_buf_ut native_uint16_buf_ut;
|
typedef <b><i>implementation-defined</i></b>_uint16_buf_t native_uint16_buf_t;
|
||||||
typedef <b><i>implementation-defined</i></b>_uint24_buf_ut native_uint24_buf_ut;
|
typedef <b><i>implementation-defined</i></b>_uint24_buf_t native_uint24_buf_t;
|
||||||
typedef <b><i>implementation-defined</i></b>_uint32_buf_ut native_uint32_buf_ut;
|
typedef <b><i>implementation-defined</i></b>_uint32_buf_t native_uint32_buf_t;
|
||||||
typedef <b><i>implementation-defined</i></b>_uint40_buf_ut native_uint40_buf_ut;
|
typedef <b><i>implementation-defined</i></b>_uint40_buf_t native_uint40_buf_t;
|
||||||
typedef <b><i>implementation-defined</i></b>_uint48_buf_ut native_uint48_buf_ut;
|
typedef <b><i>implementation-defined</i></b>_uint48_buf_t native_uint48_buf_t;
|
||||||
typedef <b><i>implementation-defined</i></b>_uint56_buf_ut native_uint56_buf_ut;
|
typedef <b><i>implementation-defined</i></b>_uint56_buf_t native_uint56_buf_t;
|
||||||
typedef <b><i>implementation-defined</i></b>_uint64_buf_ut native_uint64_buf_ut;
|
typedef <b><i>implementation-defined</i></b>_uint64_buf_t native_uint64_buf_t;
|
||||||
|
|
||||||
} // namespace endian
|
} // namespace endian
|
||||||
} // namespace boost</pre>
|
} // namespace boost</pre>
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns="http://www.w3.org/TR/REC-html40">
|
<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns="http://www.w3.org/TR/REC-html40">
|
||||||
|
|
||||||
<head>
|
<head>
|
||||||
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
|
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
|
||||||
@ -219,7 +219,7 @@ intrinsics as a source of performance issues.</p>
|
|||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td valign="top">
|
<td valign="top">
|
||||||
<pre>big_int32_t x;
|
<pre>big_int32_at x;
|
||||||
|
|
||||||
... read into x from a file ...
|
... read into x from a file ...
|
||||||
|
|
||||||
@ -273,7 +273,7 @@ spent doing I/O will determine the speed of this application.</p>
|
|||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td valign="top">
|
<td valign="top">
|
||||||
<pre>big_int32_t x;
|
<pre>big_int32_at x;
|
||||||
|
|
||||||
... read into x from a file ...
|
... read into x from a file ...
|
||||||
|
|
||||||
@ -395,7 +395,7 @@ I/O formats?</b> </p>
|
|||||||
<blockquote>
|
<blockquote>
|
||||||
<p>Using the unaligned integer types with a size tailored to the application's
|
<p>Using the unaligned integer types with a size tailored to the application's
|
||||||
needs is a minor secondary use that saves internal or external memory space. For
|
needs is a minor secondary use that saves internal or external memory space. For
|
||||||
example, using <code>big_int40_buf_ut</code> or <code>big_int40_ut</code> in a
|
example, using <code>big_int40_buf_t</code> or <code>big_int40_t</code> in a
|
||||||
large array saves a lot of space compared to one of the 64-bit types.</p>
|
large array saves a lot of space compared to one of the 64-bit types.</p>
|
||||||
</blockquote>
|
</blockquote>
|
||||||
<p><b>Why bother with binary I/O? Why not just use C++ Standard Library stream
|
<p><b>Why bother with binary I/O? Why not just use C++ Standard Library stream
|
||||||
|
@ -27,10 +27,10 @@ namespace
|
|||||||
|
|
||||||
struct header
|
struct header
|
||||||
{
|
{
|
||||||
big_int32_buf_t file_code;
|
big_int32_buf_at file_code;
|
||||||
big_int32_buf_t file_length;
|
big_int32_buf_at file_length;
|
||||||
little_int32_buf_t version;
|
little_int32_buf_at version;
|
||||||
little_int32_buf_t shape_type;
|
little_int32_buf_at shape_type;
|
||||||
};
|
};
|
||||||
|
|
||||||
const char* filename = "test.dat";
|
const char* filename = "test.dat";
|
||||||
|
@ -80,140 +80,140 @@ namespace endian
|
|||||||
class endian_arithmetic;
|
class endian_arithmetic;
|
||||||
|
|
||||||
// big endian floating point aligned types
|
// big endian floating point aligned types
|
||||||
typedef endian_arithmetic<order::big, float, 32, align::yes> big_float32_t;
|
typedef endian_arithmetic<order::big, float, 32, align::yes> big_float32_at;
|
||||||
typedef endian_arithmetic<order::big, double, 64, align::yes> big_float64_t;
|
typedef endian_arithmetic<order::big, double, 64, align::yes> big_float64_at;
|
||||||
|
|
||||||
// little endian floating point aligned types
|
// little endian floating point aligned types
|
||||||
typedef endian_arithmetic<order::little, float, 32, align::yes> little_float32_t;
|
typedef endian_arithmetic<order::little, float, 32, align::yes> little_float32_at;
|
||||||
typedef endian_arithmetic<order::little, double, 64, align::yes> little_float64_t;
|
typedef endian_arithmetic<order::little, double, 64, align::yes> little_float64_at;
|
||||||
|
|
||||||
// big endian floating point unaligned types
|
// big endian floating point unaligned types
|
||||||
typedef endian_arithmetic<order::big, float, 32, align::no> big_float32_ut;
|
typedef endian_arithmetic<order::big, float, 32, align::no> big_float32_t;
|
||||||
typedef endian_arithmetic<order::big, double, 64, align::no> big_float64_ut;
|
typedef endian_arithmetic<order::big, double, 64, align::no> big_float64_t;
|
||||||
|
|
||||||
// little endian floating point unaligned types
|
// little endian floating point unaligned types
|
||||||
typedef endian_arithmetic<order::little, float, 32, align::no> little_float32_ut;
|
typedef endian_arithmetic<order::little, float, 32, align::no> little_float32_t;
|
||||||
typedef endian_arithmetic<order::little, double, 64, align::no> little_float64_ut;
|
typedef endian_arithmetic<order::little, double, 64, align::no> little_float64_t;
|
||||||
|
|
||||||
// big endian signed integer aligned types
|
// big endian signed integer aligned types
|
||||||
typedef endian_arithmetic<order::big, int8_t, 8, align::yes> big_int8_t;
|
typedef endian_arithmetic<order::big, int8_t, 8, align::yes> big_int8_at;
|
||||||
typedef endian_arithmetic<order::big, int16_t, 16, align::yes> big_int16_t;
|
typedef endian_arithmetic<order::big, int16_t, 16, align::yes> big_int16_at;
|
||||||
typedef endian_arithmetic<order::big, int32_t, 32, align::yes> big_int32_t;
|
typedef endian_arithmetic<order::big, int32_t, 32, align::yes> big_int32_at;
|
||||||
typedef endian_arithmetic<order::big, int64_t, 64, align::yes> big_int64_t;
|
typedef endian_arithmetic<order::big, int64_t, 64, align::yes> big_int64_at;
|
||||||
|
|
||||||
// big endian unsigned integer aligned types
|
// big endian unsigned integer aligned types
|
||||||
typedef endian_arithmetic<order::big, uint8_t, 8, align::yes> big_uint8_t;
|
typedef endian_arithmetic<order::big, uint8_t, 8, align::yes> big_uint8_at;
|
||||||
typedef endian_arithmetic<order::big, uint16_t, 16, align::yes> big_uint16_t;
|
typedef endian_arithmetic<order::big, uint16_t, 16, align::yes> big_uint16_at;
|
||||||
typedef endian_arithmetic<order::big, uint32_t, 32, align::yes> big_uint32_t;
|
typedef endian_arithmetic<order::big, uint32_t, 32, align::yes> big_uint32_at;
|
||||||
typedef endian_arithmetic<order::big, uint64_t, 64, align::yes> big_uint64_t;
|
typedef endian_arithmetic<order::big, uint64_t, 64, align::yes> big_uint64_at;
|
||||||
|
|
||||||
// little endian signed integer aligned types
|
// little endian signed integer aligned types
|
||||||
typedef endian_arithmetic<order::little, int8_t, 8, align::yes> little_int8_t;
|
typedef endian_arithmetic<order::little, int8_t, 8, align::yes> little_int8_at;
|
||||||
typedef endian_arithmetic<order::little, int16_t, 16, align::yes> little_int16_t;
|
typedef endian_arithmetic<order::little, int16_t, 16, align::yes> little_int16_at;
|
||||||
typedef endian_arithmetic<order::little, int32_t, 32, align::yes> little_int32_t;
|
typedef endian_arithmetic<order::little, int32_t, 32, align::yes> little_int32_at;
|
||||||
typedef endian_arithmetic<order::little, int64_t, 64, align::yes> little_int64_t;
|
typedef endian_arithmetic<order::little, int64_t, 64, align::yes> little_int64_at;
|
||||||
|
|
||||||
// little endian unsigned integer aligned types
|
// little endian unsigned integer aligned types
|
||||||
typedef endian_arithmetic<order::little, uint8_t, 8, align::yes> little_uint8_t;
|
typedef endian_arithmetic<order::little, uint8_t, 8, align::yes> little_uint8_at;
|
||||||
typedef endian_arithmetic<order::little, uint16_t, 16, align::yes> little_uint16_t;
|
typedef endian_arithmetic<order::little, uint16_t, 16, align::yes> little_uint16_at;
|
||||||
typedef endian_arithmetic<order::little, uint32_t, 32, align::yes> little_uint32_t;
|
typedef endian_arithmetic<order::little, uint32_t, 32, align::yes> little_uint32_at;
|
||||||
typedef endian_arithmetic<order::little, uint64_t, 64, align::yes> little_uint64_t;
|
typedef endian_arithmetic<order::little, uint64_t, 64, align::yes> little_uint64_at;
|
||||||
|
|
||||||
// aligned native endian typedefs are not provided because
|
// aligned native endian typedefs are not provided because
|
||||||
// <cstdint> types are superior for this use case
|
// <cstdint> types are superior for this use case
|
||||||
|
|
||||||
// big endian signed integer unaligned types
|
// big endian signed integer unaligned types
|
||||||
typedef endian_arithmetic<order::big, int_least8_t, 8> big_int8_ut;
|
typedef endian_arithmetic<order::big, int_least8_t, 8> big_int8_t;
|
||||||
typedef endian_arithmetic<order::big, int_least16_t, 16> big_int16_ut;
|
typedef endian_arithmetic<order::big, int_least16_t, 16> big_int16_t;
|
||||||
typedef endian_arithmetic<order::big, int_least32_t, 24> big_int24_ut;
|
typedef endian_arithmetic<order::big, int_least32_t, 24> big_int24_t;
|
||||||
typedef endian_arithmetic<order::big, int_least32_t, 32> big_int32_ut;
|
typedef endian_arithmetic<order::big, int_least32_t, 32> big_int32_t;
|
||||||
typedef endian_arithmetic<order::big, int_least64_t, 40> big_int40_ut;
|
typedef endian_arithmetic<order::big, int_least64_t, 40> big_int40_t;
|
||||||
typedef endian_arithmetic<order::big, int_least64_t, 48> big_int48_ut;
|
typedef endian_arithmetic<order::big, int_least64_t, 48> big_int48_t;
|
||||||
typedef endian_arithmetic<order::big, int_least64_t, 56> big_int56_ut;
|
typedef endian_arithmetic<order::big, int_least64_t, 56> big_int56_t;
|
||||||
typedef endian_arithmetic<order::big, int_least64_t, 64> big_int64_ut;
|
typedef endian_arithmetic<order::big, int_least64_t, 64> big_int64_t;
|
||||||
|
|
||||||
// big endian unsigned integer unaligned types
|
// big endian unsigned integer unaligned types
|
||||||
typedef endian_arithmetic<order::big, uint_least8_t, 8> big_uint8_ut;
|
typedef endian_arithmetic<order::big, uint_least8_t, 8> big_uint8_t;
|
||||||
typedef endian_arithmetic<order::big, uint_least16_t, 16> big_uint16_ut;
|
typedef endian_arithmetic<order::big, uint_least16_t, 16> big_uint16_t;
|
||||||
typedef endian_arithmetic<order::big, uint_least32_t, 24> big_uint24_ut;
|
typedef endian_arithmetic<order::big, uint_least32_t, 24> big_uint24_t;
|
||||||
typedef endian_arithmetic<order::big, uint_least32_t, 32> big_uint32_ut;
|
typedef endian_arithmetic<order::big, uint_least32_t, 32> big_uint32_t;
|
||||||
typedef endian_arithmetic<order::big, uint_least64_t, 40> big_uint40_ut;
|
typedef endian_arithmetic<order::big, uint_least64_t, 40> big_uint40_t;
|
||||||
typedef endian_arithmetic<order::big, uint_least64_t, 48> big_uint48_ut;
|
typedef endian_arithmetic<order::big, uint_least64_t, 48> big_uint48_t;
|
||||||
typedef endian_arithmetic<order::big, uint_least64_t, 56> big_uint56_ut;
|
typedef endian_arithmetic<order::big, uint_least64_t, 56> big_uint56_t;
|
||||||
typedef endian_arithmetic<order::big, uint_least64_t, 64> big_uint64_ut;
|
typedef endian_arithmetic<order::big, uint_least64_t, 64> big_uint64_t;
|
||||||
|
|
||||||
// little endian signed integer unaligned types
|
// little endian signed integer unaligned types
|
||||||
typedef endian_arithmetic<order::little, int_least8_t, 8> little_int8_ut;
|
typedef endian_arithmetic<order::little, int_least8_t, 8> little_int8_t;
|
||||||
typedef endian_arithmetic<order::little, int_least16_t, 16> little_int16_ut;
|
typedef endian_arithmetic<order::little, int_least16_t, 16> little_int16_t;
|
||||||
typedef endian_arithmetic<order::little, int_least32_t, 24> little_int24_ut;
|
typedef endian_arithmetic<order::little, int_least32_t, 24> little_int24_t;
|
||||||
typedef endian_arithmetic<order::little, int_least32_t, 32> little_int32_ut;
|
typedef endian_arithmetic<order::little, int_least32_t, 32> little_int32_t;
|
||||||
typedef endian_arithmetic<order::little, int_least64_t, 40> little_int40_ut;
|
typedef endian_arithmetic<order::little, int_least64_t, 40> little_int40_t;
|
||||||
typedef endian_arithmetic<order::little, int_least64_t, 48> little_int48_ut;
|
typedef endian_arithmetic<order::little, int_least64_t, 48> little_int48_t;
|
||||||
typedef endian_arithmetic<order::little, int_least64_t, 56> little_int56_ut;
|
typedef endian_arithmetic<order::little, int_least64_t, 56> little_int56_t;
|
||||||
typedef endian_arithmetic<order::little, int_least64_t, 64> little_int64_ut;
|
typedef endian_arithmetic<order::little, int_least64_t, 64> little_int64_t;
|
||||||
|
|
||||||
// little endian unsigned integer unaligned types
|
// little endian unsigned integer unaligned types
|
||||||
typedef endian_arithmetic<order::little, uint_least8_t, 8> little_uint8_ut;
|
typedef endian_arithmetic<order::little, uint_least8_t, 8> little_uint8_t;
|
||||||
typedef endian_arithmetic<order::little, uint_least16_t, 16> little_uint16_ut;
|
typedef endian_arithmetic<order::little, uint_least16_t, 16> little_uint16_t;
|
||||||
typedef endian_arithmetic<order::little, uint_least32_t, 24> little_uint24_ut;
|
typedef endian_arithmetic<order::little, uint_least32_t, 24> little_uint24_t;
|
||||||
typedef endian_arithmetic<order::little, uint_least32_t, 32> little_uint32_ut;
|
typedef endian_arithmetic<order::little, uint_least32_t, 32> little_uint32_t;
|
||||||
typedef endian_arithmetic<order::little, uint_least64_t, 40> little_uint40_ut;
|
typedef endian_arithmetic<order::little, uint_least64_t, 40> little_uint40_t;
|
||||||
typedef endian_arithmetic<order::little, uint_least64_t, 48> little_uint48_ut;
|
typedef endian_arithmetic<order::little, uint_least64_t, 48> little_uint48_t;
|
||||||
typedef endian_arithmetic<order::little, uint_least64_t, 56> little_uint56_ut;
|
typedef endian_arithmetic<order::little, uint_least64_t, 56> little_uint56_t;
|
||||||
typedef endian_arithmetic<order::little, uint_least64_t, 64> little_uint64_ut;
|
typedef endian_arithmetic<order::little, uint_least64_t, 64> little_uint64_t;
|
||||||
|
|
||||||
# ifdef BOOST_BIG_ENDIAN
|
# ifdef BOOST_BIG_ENDIAN
|
||||||
// native endian signed integer unaligned types
|
// native endian signed integer unaligned types
|
||||||
typedef big_int8_ut native_int8_ut;
|
typedef big_int8_t native_int8_t;
|
||||||
typedef big_int16_ut native_int16_ut;
|
typedef big_int16_t native_int16_t;
|
||||||
typedef big_int24_ut native_int24_ut;
|
typedef big_int24_t native_int24_t;
|
||||||
typedef big_int32_ut native_int32_ut;
|
typedef big_int32_t native_int32_t;
|
||||||
typedef big_int40_ut native_int40_ut;
|
typedef big_int40_t native_int40_t;
|
||||||
typedef big_int48_ut native_int48_ut;
|
typedef big_int48_t native_int48_t;
|
||||||
typedef big_int56_ut native_int56_ut;
|
typedef big_int56_t native_int56_t;
|
||||||
typedef big_int64_ut native_int64_ut;
|
typedef big_int64_t native_int64_t;
|
||||||
|
|
||||||
// native endian unsigned integer unaligned types
|
// native endian unsigned integer unaligned types
|
||||||
typedef big_uint8_ut native_uint8_ut;
|
typedef big_uint8_t native_uint8_t;
|
||||||
typedef big_uint16_ut native_uint16_ut;
|
typedef big_uint16_t native_uint16_t;
|
||||||
typedef big_uint24_ut native_uint24_ut;
|
typedef big_uint24_t native_uint24_t;
|
||||||
typedef big_uint32_ut native_uint32_ut;
|
typedef big_uint32_t native_uint32_t;
|
||||||
typedef big_uint40_ut native_uint40_ut;
|
typedef big_uint40_t native_uint40_t;
|
||||||
typedef big_uint48_ut native_uint48_ut;
|
typedef big_uint48_t native_uint48_t;
|
||||||
typedef big_uint56_ut native_uint56_ut;
|
typedef big_uint56_t native_uint56_t;
|
||||||
typedef big_uint64_ut native_uint64_ut;
|
typedef big_uint64_t native_uint64_t;
|
||||||
|
|
||||||
// native endian floating point types
|
// native endian floating point types
|
||||||
typedef big_float32_ut native_float32_ut;
|
|
||||||
typedef big_float64_ut native_float64_ut;
|
|
||||||
typedef big_float32_t native_float32_t;
|
typedef big_float32_t native_float32_t;
|
||||||
typedef big_float64_t native_float64_t;
|
typedef big_float64_t native_float64_t;
|
||||||
|
typedef big_float32_at native_float32_at;
|
||||||
|
typedef big_float64_at native_float64_at;
|
||||||
# else
|
# else
|
||||||
// native endian signed integer unaligned types
|
// native endian signed integer unaligned types
|
||||||
typedef little_int8_ut native_int8_ut;
|
typedef little_int8_t native_int8_t;
|
||||||
typedef little_int16_ut native_int16_ut;
|
typedef little_int16_t native_int16_t;
|
||||||
typedef little_int24_ut native_int24_ut;
|
typedef little_int24_t native_int24_t;
|
||||||
typedef little_int32_ut native_int32_ut;
|
typedef little_int32_t native_int32_t;
|
||||||
typedef little_int40_ut native_int40_ut;
|
typedef little_int40_t native_int40_t;
|
||||||
typedef little_int48_ut native_int48_ut;
|
typedef little_int48_t native_int48_t;
|
||||||
typedef little_int56_ut native_int56_ut;
|
typedef little_int56_t native_int56_t;
|
||||||
typedef little_int64_ut native_int64_ut;
|
typedef little_int64_t native_int64_t;
|
||||||
|
|
||||||
// native endian unsigned integer unaligned types
|
// native endian unsigned integer unaligned types
|
||||||
typedef little_uint8_ut native_uint8_ut;
|
typedef little_uint8_t native_uint8_t;
|
||||||
typedef little_uint16_ut native_uint16_ut;
|
typedef little_uint16_t native_uint16_t;
|
||||||
typedef little_uint24_ut native_uint24_ut;
|
typedef little_uint24_t native_uint24_t;
|
||||||
typedef little_uint32_ut native_uint32_ut;
|
typedef little_uint32_t native_uint32_t;
|
||||||
typedef little_uint40_ut native_uint40_ut;
|
typedef little_uint40_t native_uint40_t;
|
||||||
typedef little_uint48_ut native_uint48_ut;
|
typedef little_uint48_t native_uint48_t;
|
||||||
typedef little_uint56_ut native_uint56_ut;
|
typedef little_uint56_t native_uint56_t;
|
||||||
typedef little_uint64_ut native_uint64_ut;
|
typedef little_uint64_t native_uint64_t;
|
||||||
|
|
||||||
// native endian floating point types
|
// native endian floating point types
|
||||||
typedef little_float32_ut native_float32_ut;
|
|
||||||
typedef little_float64_ut native_float64_ut;
|
|
||||||
typedef little_float32_t native_float32_t;
|
typedef little_float32_t native_float32_t;
|
||||||
typedef little_float64_t native_float64_t;
|
typedef little_float64_t native_float64_t;
|
||||||
|
typedef little_float32_at native_float32_at;
|
||||||
|
typedef little_float64_at native_float64_at;
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
# ifdef BOOST_ENDIAN_DEPRECATED_NAMES
|
# ifdef BOOST_ENDIAN_DEPRECATED_NAMES
|
||||||
|
@ -77,140 +77,140 @@ namespace endian
|
|||||||
class endian_buffer;
|
class endian_buffer;
|
||||||
|
|
||||||
// aligned big endian floating point buffers
|
// aligned big endian floating point buffers
|
||||||
typedef endian_buffer<order::big, float, 32, align::yes> big_float32_buf_t;
|
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_t;
|
typedef endian_buffer<order::big, double, 64, align::yes> big_float64_buf_at;
|
||||||
|
|
||||||
// aligned little endian floating point buffers
|
// aligned little endian floating point buffers
|
||||||
typedef endian_buffer<order::little, float, 32, align::yes> little_float32_buf_t;
|
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_t;
|
typedef endian_buffer<order::little, double, 64, align::yes> little_float64_buf_at;
|
||||||
|
|
||||||
// unaligned big endian floating point buffers
|
// unaligned big endian floating point buffers
|
||||||
typedef endian_buffer<order::big, float, 32, align::no> big_float32_buf_ut;
|
typedef endian_buffer<order::big, float, 32, align::no> big_float32_buf_t;
|
||||||
typedef endian_buffer<order::big, double, 64, align::no> big_float64_buf_ut;
|
typedef endian_buffer<order::big, double, 64, align::no> big_float64_buf_t;
|
||||||
|
|
||||||
// unaligned little endian floating point buffers
|
// unaligned little endian floating point buffers
|
||||||
typedef endian_buffer<order::little, float, 32, align::no> little_float32_buf_ut;
|
typedef endian_buffer<order::little, float, 32, align::no> little_float32_buf_t;
|
||||||
typedef endian_buffer<order::little, double, 64, align::no> little_float64_buf_ut;
|
typedef endian_buffer<order::little, double, 64, align::no> little_float64_buf_t;
|
||||||
|
|
||||||
// aligned big endian signed integer buffers
|
// aligned big endian signed integer buffers
|
||||||
typedef endian_buffer<order::big, int8_t, 8, align::yes> big_int8_buf_t;
|
typedef endian_buffer<order::big, int8_t, 8, align::yes> big_int8_buf_at;
|
||||||
typedef endian_buffer<order::big, int16_t, 16, align::yes> big_int16_buf_t;
|
typedef endian_buffer<order::big, int16_t, 16, align::yes> big_int16_buf_at;
|
||||||
typedef endian_buffer<order::big, int32_t, 32, align::yes> big_int32_buf_t;
|
typedef endian_buffer<order::big, int32_t, 32, align::yes> big_int32_buf_at;
|
||||||
typedef endian_buffer<order::big, int64_t, 64, align::yes> big_int64_buf_t;
|
typedef endian_buffer<order::big, int64_t, 64, align::yes> big_int64_buf_at;
|
||||||
|
|
||||||
// aligned big endian unsigned integer buffers
|
// aligned big endian unsigned integer buffers
|
||||||
typedef endian_buffer<order::big, uint8_t, 8, align::yes> big_uint8_buf_t;
|
typedef endian_buffer<order::big, uint8_t, 8, align::yes> big_uint8_buf_at;
|
||||||
typedef endian_buffer<order::big, uint16_t, 16, align::yes> big_uint16_buf_t;
|
typedef endian_buffer<order::big, uint16_t, 16, align::yes> big_uint16_buf_at;
|
||||||
typedef endian_buffer<order::big, uint32_t, 32, align::yes> big_uint32_buf_t;
|
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_t;
|
typedef endian_buffer<order::big, uint64_t, 64, align::yes> big_uint64_buf_at;
|
||||||
|
|
||||||
// aligned little endian signed integer buffers
|
// aligned little endian signed integer buffers
|
||||||
typedef endian_buffer<order::little, int8_t, 8, align::yes> little_int8_buf_t;
|
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_t;
|
typedef endian_buffer<order::little, int16_t, 16, align::yes> little_int16_buf_at;
|
||||||
typedef endian_buffer<order::little, int32_t, 32, align::yes> little_int32_buf_t;
|
typedef endian_buffer<order::little, int32_t, 32, align::yes> little_int32_buf_at;
|
||||||
typedef endian_buffer<order::little, int64_t, 64, align::yes> little_int64_buf_t;
|
typedef endian_buffer<order::little, int64_t, 64, align::yes> little_int64_buf_at;
|
||||||
|
|
||||||
// aligned little endian unsigned integer buffers
|
// aligned little endian unsigned integer buffers
|
||||||
typedef endian_buffer<order::little, uint8_t, 8, align::yes> little_uint8_buf_t;
|
typedef endian_buffer<order::little, uint8_t, 8, align::yes> little_uint8_buf_at;
|
||||||
typedef endian_buffer<order::little, uint16_t, 16, align::yes> little_uint16_buf_t;
|
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_t;
|
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_t;
|
typedef endian_buffer<order::little, uint64_t, 64, align::yes> little_uint64_buf_at;
|
||||||
|
|
||||||
// aligned native endian typedefs are not provided because
|
// aligned native endian typedefs are not provided because
|
||||||
// <cstdint> types are superior for this use case
|
// <cstdint> types are superior for this use case
|
||||||
|
|
||||||
// unaligned big endian signed integer buffers
|
// unaligned big endian signed integer buffers
|
||||||
typedef endian_buffer<order::big, int_least8_t, 8> big_int8_buf_ut;
|
typedef endian_buffer<order::big, int_least8_t, 8> big_int8_buf_t;
|
||||||
typedef endian_buffer<order::big, int_least16_t, 16> big_int16_buf_ut;
|
typedef endian_buffer<order::big, int_least16_t, 16> big_int16_buf_t;
|
||||||
typedef endian_buffer<order::big, int_least32_t, 24> big_int24_buf_ut;
|
typedef endian_buffer<order::big, int_least32_t, 24> big_int24_buf_t;
|
||||||
typedef endian_buffer<order::big, int_least32_t, 32> big_int32_buf_ut;
|
typedef endian_buffer<order::big, int_least32_t, 32> big_int32_buf_t;
|
||||||
typedef endian_buffer<order::big, int_least64_t, 40> big_int40_buf_ut;
|
typedef endian_buffer<order::big, int_least64_t, 40> big_int40_buf_t;
|
||||||
typedef endian_buffer<order::big, int_least64_t, 48> big_int48_buf_ut;
|
typedef endian_buffer<order::big, int_least64_t, 48> big_int48_buf_t;
|
||||||
typedef endian_buffer<order::big, int_least64_t, 56> big_int56_buf_ut;
|
typedef endian_buffer<order::big, int_least64_t, 56> big_int56_buf_t;
|
||||||
typedef endian_buffer<order::big, int_least64_t, 64> big_int64_buf_ut;
|
typedef endian_buffer<order::big, int_least64_t, 64> big_int64_buf_t;
|
||||||
|
|
||||||
// unaligned big endian unsigned integer buffers
|
// unaligned big endian unsigned integer buffers
|
||||||
typedef endian_buffer<order::big, uint_least8_t, 8> big_uint8_buf_ut;
|
typedef endian_buffer<order::big, uint_least8_t, 8> big_uint8_buf_t;
|
||||||
typedef endian_buffer<order::big, uint_least16_t, 16> big_uint16_buf_ut;
|
typedef endian_buffer<order::big, uint_least16_t, 16> big_uint16_buf_t;
|
||||||
typedef endian_buffer<order::big, uint_least32_t, 24> big_uint24_buf_ut;
|
typedef endian_buffer<order::big, uint_least32_t, 24> big_uint24_buf_t;
|
||||||
typedef endian_buffer<order::big, uint_least32_t, 32> big_uint32_buf_ut;
|
typedef endian_buffer<order::big, uint_least32_t, 32> big_uint32_buf_t;
|
||||||
typedef endian_buffer<order::big, uint_least64_t, 40> big_uint40_buf_ut;
|
typedef endian_buffer<order::big, uint_least64_t, 40> big_uint40_buf_t;
|
||||||
typedef endian_buffer<order::big, uint_least64_t, 48> big_uint48_buf_ut;
|
typedef endian_buffer<order::big, uint_least64_t, 48> big_uint48_buf_t;
|
||||||
typedef endian_buffer<order::big, uint_least64_t, 56> big_uint56_buf_ut;
|
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_ut;
|
typedef endian_buffer<order::big, uint_least64_t, 64> big_uint64_buf_t;
|
||||||
|
|
||||||
// unaligned little endian signed integer buffers
|
// unaligned little endian signed integer buffers
|
||||||
typedef endian_buffer<order::little, int_least8_t, 8> little_int8_buf_ut;
|
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_ut;
|
typedef endian_buffer<order::little, int_least16_t, 16> little_int16_buf_t;
|
||||||
typedef endian_buffer<order::little, int_least32_t, 24> little_int24_buf_ut;
|
typedef endian_buffer<order::little, int_least32_t, 24> little_int24_buf_t;
|
||||||
typedef endian_buffer<order::little, int_least32_t, 32> little_int32_buf_ut;
|
typedef endian_buffer<order::little, int_least32_t, 32> little_int32_buf_t;
|
||||||
typedef endian_buffer<order::little, int_least64_t, 40> little_int40_buf_ut;
|
typedef endian_buffer<order::little, int_least64_t, 40> little_int40_buf_t;
|
||||||
typedef endian_buffer<order::little, int_least64_t, 48> little_int48_buf_ut;
|
typedef endian_buffer<order::little, int_least64_t, 48> little_int48_buf_t;
|
||||||
typedef endian_buffer<order::little, int_least64_t, 56> little_int56_buf_ut;
|
typedef endian_buffer<order::little, int_least64_t, 56> little_int56_buf_t;
|
||||||
typedef endian_buffer<order::little, int_least64_t, 64> little_int64_buf_ut;
|
typedef endian_buffer<order::little, int_least64_t, 64> little_int64_buf_t;
|
||||||
|
|
||||||
// unaligned little endian unsigned integer buffers
|
// unaligned little endian unsigned integer buffers
|
||||||
typedef endian_buffer<order::little, uint_least8_t, 8> little_uint8_buf_ut;
|
typedef endian_buffer<order::little, uint_least8_t, 8> little_uint8_buf_t;
|
||||||
typedef endian_buffer<order::little, uint_least16_t, 16> little_uint16_buf_ut;
|
typedef endian_buffer<order::little, uint_least16_t, 16> little_uint16_buf_t;
|
||||||
typedef endian_buffer<order::little, uint_least32_t, 24> little_uint24_buf_ut;
|
typedef endian_buffer<order::little, uint_least32_t, 24> little_uint24_buf_t;
|
||||||
typedef endian_buffer<order::little, uint_least32_t, 32> little_uint32_buf_ut;
|
typedef endian_buffer<order::little, uint_least32_t, 32> little_uint32_buf_t;
|
||||||
typedef endian_buffer<order::little, uint_least64_t, 40> little_uint40_buf_ut;
|
typedef endian_buffer<order::little, uint_least64_t, 40> little_uint40_buf_t;
|
||||||
typedef endian_buffer<order::little, uint_least64_t, 48> little_uint48_buf_ut;
|
typedef endian_buffer<order::little, uint_least64_t, 48> little_uint48_buf_t;
|
||||||
typedef endian_buffer<order::little, uint_least64_t, 56> little_uint56_buf_ut;
|
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_ut;
|
typedef endian_buffer<order::little, uint_least64_t, 64> little_uint64_buf_t;
|
||||||
|
|
||||||
# ifdef BOOST_BIG_ENDIAN
|
# ifdef BOOST_BIG_ENDIAN
|
||||||
// unaligned native endian signed integer buffers
|
// unaligned native endian signed integer buffers
|
||||||
typedef big_int8_buf_ut native_int8_buf_ut;
|
typedef big_int8_buf_t native_int8_buf_t;
|
||||||
typedef big_int16_buf_ut native_int16_buf_ut;
|
typedef big_int16_buf_t native_int16_buf_t;
|
||||||
typedef big_int24_buf_ut native_int24_buf_ut;
|
typedef big_int24_buf_t native_int24_buf_t;
|
||||||
typedef big_int32_buf_ut native_int32_buf_ut;
|
typedef big_int32_buf_t native_int32_buf_t;
|
||||||
typedef big_int40_buf_ut native_int40_buf_ut;
|
typedef big_int40_buf_t native_int40_buf_t;
|
||||||
typedef big_int48_buf_ut native_int48_buf_ut;
|
typedef big_int48_buf_t native_int48_buf_t;
|
||||||
typedef big_int56_buf_ut native_int56_buf_ut;
|
typedef big_int56_buf_t native_int56_buf_t;
|
||||||
typedef big_int64_buf_ut native_int64_buf_ut;
|
typedef big_int64_buf_t native_int64_buf_t;
|
||||||
|
|
||||||
// unaligned native endian unsigned integer buffers
|
// unaligned native endian unsigned integer buffers
|
||||||
typedef big_uint8_buf_ut native_uint8_buf_ut;
|
typedef big_uint8_buf_t native_uint8_buf_t;
|
||||||
typedef big_uint16_buf_ut native_uint16_buf_ut;
|
typedef big_uint16_buf_t native_uint16_buf_t;
|
||||||
typedef big_uint24_buf_ut native_uint24_buf_ut;
|
typedef big_uint24_buf_t native_uint24_buf_t;
|
||||||
typedef big_uint32_buf_ut native_uint32_buf_ut;
|
typedef big_uint32_buf_t native_uint32_buf_t;
|
||||||
typedef big_uint40_buf_ut native_uint40_buf_ut;
|
typedef big_uint40_buf_t native_uint40_buf_t;
|
||||||
typedef big_uint48_buf_ut native_uint48_buf_ut;
|
typedef big_uint48_buf_t native_uint48_buf_t;
|
||||||
typedef big_uint56_buf_ut native_uint56_buf_ut;
|
typedef big_uint56_buf_t native_uint56_buf_t;
|
||||||
typedef big_uint64_buf_ut native_uint64_buf_ut;
|
typedef big_uint64_buf_t native_uint64_buf_t;
|
||||||
|
|
||||||
// native endian floating point buffers
|
// native endian floating point buffers
|
||||||
typedef big_float32_buf_ut native_float32_buf_ut;
|
|
||||||
typedef big_float64_buf_ut native_float64_buf_ut;
|
|
||||||
typedef big_float32_buf_t native_float32_buf_t;
|
typedef big_float32_buf_t native_float32_buf_t;
|
||||||
typedef big_float64_buf_t native_float64_buf_t;
|
typedef big_float64_buf_t native_float64_buf_t;
|
||||||
|
typedef big_float32_buf_at native_float32_buf_at;
|
||||||
|
typedef big_float64_buf_at native_float64_buf_at;
|
||||||
# else
|
# else
|
||||||
// unaligned native endian signed integer buffers
|
// unaligned native endian signed integer buffers
|
||||||
typedef little_int8_buf_ut native_int8_buf_ut;
|
typedef little_int8_buf_t native_int8_buf_t;
|
||||||
typedef little_int16_buf_ut native_int16_buf_ut;
|
typedef little_int16_buf_t native_int16_buf_t;
|
||||||
typedef little_int24_buf_ut native_int24_buf_ut;
|
typedef little_int24_buf_t native_int24_buf_t;
|
||||||
typedef little_int32_buf_ut native_int32_buf_ut;
|
typedef little_int32_buf_t native_int32_buf_t;
|
||||||
typedef little_int40_buf_ut native_int40_buf_ut;
|
typedef little_int40_buf_t native_int40_buf_t;
|
||||||
typedef little_int48_buf_ut native_int48_buf_ut;
|
typedef little_int48_buf_t native_int48_buf_t;
|
||||||
typedef little_int56_buf_ut native_int56_buf_ut;
|
typedef little_int56_buf_t native_int56_buf_t;
|
||||||
typedef little_int64_buf_ut native_int64_buf_ut;
|
typedef little_int64_buf_t native_int64_buf_t;
|
||||||
|
|
||||||
// unaligned native endian unsigned integer buffers
|
// unaligned native endian unsigned integer buffers
|
||||||
typedef little_uint8_buf_ut native_uint8_buf_ut;
|
typedef little_uint8_buf_t native_uint8_buf_t;
|
||||||
typedef little_uint16_buf_ut native_uint16_buf_ut;
|
typedef little_uint16_buf_t native_uint16_buf_t;
|
||||||
typedef little_uint24_buf_ut native_uint24_buf_ut;
|
typedef little_uint24_buf_t native_uint24_buf_t;
|
||||||
typedef little_uint32_buf_ut native_uint32_buf_ut;
|
typedef little_uint32_buf_t native_uint32_buf_t;
|
||||||
typedef little_uint40_buf_ut native_uint40_buf_ut;
|
typedef little_uint40_buf_t native_uint40_buf_t;
|
||||||
typedef little_uint48_buf_ut native_uint48_buf_ut;
|
typedef little_uint48_buf_t native_uint48_buf_t;
|
||||||
typedef little_uint56_buf_ut native_uint56_buf_ut;
|
typedef little_uint56_buf_t native_uint56_buf_t;
|
||||||
typedef little_uint64_buf_ut native_uint64_buf_ut;
|
typedef little_uint64_buf_t native_uint64_buf_t;
|
||||||
|
|
||||||
// native endian floating point buffers
|
// native endian floating point buffers
|
||||||
typedef little_float32_buf_ut native_float32_buf_ut;
|
|
||||||
typedef little_float64_buf_ut native_float64_buf_ut;
|
|
||||||
typedef little_float32_buf_t native_float32_buf_t;
|
typedef little_float32_buf_t native_float32_buf_t;
|
||||||
typedef little_float64_buf_t native_float64_buf_t;
|
typedef little_float64_buf_t native_float64_buf_t;
|
||||||
|
typedef little_float32_buf_at native_float32_buf_at;
|
||||||
|
typedef little_float64_buf_at native_float64_buf_at;
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
// Stream inserter
|
// Stream inserter
|
||||||
|
@ -30,6 +30,13 @@ namespace
|
|||||||
void check_size()
|
void check_size()
|
||||||
{
|
{
|
||||||
|
|
||||||
|
BOOST_TEST_EQ(sizeof(big_float32_buf_at), 4u);
|
||||||
|
BOOST_TEST_EQ(sizeof(big_float64_buf_at), 8u);
|
||||||
|
BOOST_TEST_EQ(sizeof(little_float32_buf_at), 4u);
|
||||||
|
BOOST_TEST_EQ(sizeof(little_float64_buf_at), 8u);
|
||||||
|
BOOST_TEST_EQ(sizeof(native_float32_buf_at), 4u);
|
||||||
|
BOOST_TEST_EQ(sizeof(native_float64_buf_at), 8u);
|
||||||
|
|
||||||
BOOST_TEST_EQ(sizeof(big_float32_buf_t), 4u);
|
BOOST_TEST_EQ(sizeof(big_float32_buf_t), 4u);
|
||||||
BOOST_TEST_EQ(sizeof(big_float64_buf_t), 8u);
|
BOOST_TEST_EQ(sizeof(big_float64_buf_t), 8u);
|
||||||
BOOST_TEST_EQ(sizeof(little_float32_buf_t), 4u);
|
BOOST_TEST_EQ(sizeof(little_float32_buf_t), 4u);
|
||||||
@ -37,86 +44,79 @@ namespace
|
|||||||
BOOST_TEST_EQ(sizeof(native_float32_buf_t), 4u);
|
BOOST_TEST_EQ(sizeof(native_float32_buf_t), 4u);
|
||||||
BOOST_TEST_EQ(sizeof(native_float64_buf_t), 8u);
|
BOOST_TEST_EQ(sizeof(native_float64_buf_t), 8u);
|
||||||
|
|
||||||
BOOST_TEST_EQ(sizeof(big_float32_buf_ut), 4u);
|
|
||||||
BOOST_TEST_EQ(sizeof(big_float64_buf_ut), 8u);
|
|
||||||
BOOST_TEST_EQ(sizeof(little_float32_buf_ut), 4u);
|
|
||||||
BOOST_TEST_EQ(sizeof(little_float64_buf_ut), 8u);
|
|
||||||
BOOST_TEST_EQ(sizeof(native_float32_buf_ut), 4u);
|
|
||||||
BOOST_TEST_EQ(sizeof(native_float64_buf_ut), 8u);
|
|
||||||
|
|
||||||
BOOST_TEST_EQ(sizeof(big_int8_buf_ut), 1u);
|
|
||||||
BOOST_TEST_EQ(sizeof(big_int16_buf_ut), 2u);
|
|
||||||
BOOST_TEST_EQ(sizeof(big_int24_buf_ut), 3u);
|
|
||||||
BOOST_TEST_EQ(sizeof(big_int32_buf_ut), 4u);
|
|
||||||
BOOST_TEST_EQ(sizeof(big_int40_buf_ut), 5u);
|
|
||||||
BOOST_TEST_EQ(sizeof(big_int48_buf_ut), 6u);
|
|
||||||
BOOST_TEST_EQ(sizeof(big_int56_buf_ut), 7u);
|
|
||||||
BOOST_TEST_EQ(sizeof(big_int64_buf_ut), 8u);
|
|
||||||
|
|
||||||
BOOST_TEST_EQ(sizeof(big_uint8_buf_ut), 1u);
|
|
||||||
BOOST_TEST_EQ(sizeof(big_uint16_buf_ut), 2u);
|
|
||||||
BOOST_TEST_EQ(sizeof(big_uint24_buf_ut), 3u);
|
|
||||||
BOOST_TEST_EQ(sizeof(big_uint32_buf_ut), 4u);
|
|
||||||
BOOST_TEST_EQ(sizeof(big_uint40_buf_ut), 5u);
|
|
||||||
BOOST_TEST_EQ(sizeof(big_uint48_buf_ut), 6u);
|
|
||||||
BOOST_TEST_EQ(sizeof(big_uint56_buf_ut), 7u);
|
|
||||||
BOOST_TEST_EQ(sizeof(big_uint64_buf_ut), 8u);
|
|
||||||
|
|
||||||
BOOST_TEST_EQ(sizeof(little_int8_buf_ut), 1u);
|
|
||||||
BOOST_TEST_EQ(sizeof(little_int16_buf_ut), 2u);
|
|
||||||
BOOST_TEST_EQ(sizeof(little_int24_buf_ut), 3u);
|
|
||||||
BOOST_TEST_EQ(sizeof(little_int32_buf_ut), 4u);
|
|
||||||
BOOST_TEST_EQ(sizeof(little_int40_buf_ut), 5u);
|
|
||||||
BOOST_TEST_EQ(sizeof(little_int48_buf_ut), 6u);
|
|
||||||
BOOST_TEST_EQ(sizeof(little_int56_buf_ut), 7u);
|
|
||||||
BOOST_TEST_EQ(sizeof(little_int64_buf_ut), 8u);
|
|
||||||
|
|
||||||
BOOST_TEST_EQ(sizeof(little_uint8_buf_ut), 1u);
|
|
||||||
BOOST_TEST_EQ(sizeof(little_uint16_buf_ut), 2u);
|
|
||||||
BOOST_TEST_EQ(sizeof(little_uint24_buf_ut), 3u);
|
|
||||||
BOOST_TEST_EQ(sizeof(little_uint32_buf_ut), 4u);
|
|
||||||
BOOST_TEST_EQ(sizeof(little_uint40_buf_ut), 5u);
|
|
||||||
BOOST_TEST_EQ(sizeof(little_uint48_buf_ut), 6u);
|
|
||||||
BOOST_TEST_EQ(sizeof(little_uint56_buf_ut), 7u);
|
|
||||||
BOOST_TEST_EQ(sizeof(little_uint64_buf_ut), 8u);
|
|
||||||
|
|
||||||
BOOST_TEST_EQ(sizeof(native_int8_buf_ut), 1u);
|
|
||||||
BOOST_TEST_EQ(sizeof(native_int16_buf_ut), 2u);
|
|
||||||
BOOST_TEST_EQ(sizeof(native_int24_buf_ut), 3u);
|
|
||||||
BOOST_TEST_EQ(sizeof(native_int32_buf_ut), 4u);
|
|
||||||
BOOST_TEST_EQ(sizeof(native_int40_buf_ut), 5u);
|
|
||||||
BOOST_TEST_EQ(sizeof(native_int48_buf_ut), 6u);
|
|
||||||
BOOST_TEST_EQ(sizeof(native_int56_buf_ut), 7u);
|
|
||||||
BOOST_TEST_EQ(sizeof(native_int64_buf_ut), 8u);
|
|
||||||
|
|
||||||
BOOST_TEST_EQ(sizeof(native_uint8_buf_ut), 1u);
|
|
||||||
BOOST_TEST_EQ(sizeof(native_uint16_buf_ut), 2u);
|
|
||||||
BOOST_TEST_EQ(sizeof(native_uint24_buf_ut), 3u);
|
|
||||||
BOOST_TEST_EQ(sizeof(native_uint32_buf_ut), 4u);
|
|
||||||
BOOST_TEST_EQ(sizeof(native_uint40_buf_ut), 5u);
|
|
||||||
BOOST_TEST_EQ(sizeof(native_uint48_buf_ut), 6u);
|
|
||||||
BOOST_TEST_EQ(sizeof(native_uint56_buf_ut), 7u);
|
|
||||||
BOOST_TEST_EQ(sizeof(native_uint64_buf_ut), 8u);
|
|
||||||
|
|
||||||
BOOST_TEST_EQ(sizeof(big_int8_buf_t), 1u);
|
BOOST_TEST_EQ(sizeof(big_int8_buf_t), 1u);
|
||||||
BOOST_TEST_EQ(sizeof(big_int16_buf_t), 2u);
|
BOOST_TEST_EQ(sizeof(big_int16_buf_t), 2u);
|
||||||
|
BOOST_TEST_EQ(sizeof(big_int24_buf_t), 3u);
|
||||||
BOOST_TEST_EQ(sizeof(big_int32_buf_t), 4u);
|
BOOST_TEST_EQ(sizeof(big_int32_buf_t), 4u);
|
||||||
|
BOOST_TEST_EQ(sizeof(big_int40_buf_t), 5u);
|
||||||
|
BOOST_TEST_EQ(sizeof(big_int48_buf_t), 6u);
|
||||||
|
BOOST_TEST_EQ(sizeof(big_int56_buf_t), 7u);
|
||||||
BOOST_TEST_EQ(sizeof(big_int64_buf_t), 8u);
|
BOOST_TEST_EQ(sizeof(big_int64_buf_t), 8u);
|
||||||
|
|
||||||
BOOST_TEST_EQ(sizeof(big_uint8_buf_t), 1u);
|
BOOST_TEST_EQ(sizeof(big_uint8_buf_t), 1u);
|
||||||
BOOST_TEST_EQ(sizeof(big_uint16_buf_t), 2u);
|
BOOST_TEST_EQ(sizeof(big_uint16_buf_t), 2u);
|
||||||
|
BOOST_TEST_EQ(sizeof(big_uint24_buf_t), 3u);
|
||||||
BOOST_TEST_EQ(sizeof(big_uint32_buf_t), 4u);
|
BOOST_TEST_EQ(sizeof(big_uint32_buf_t), 4u);
|
||||||
|
BOOST_TEST_EQ(sizeof(big_uint40_buf_t), 5u);
|
||||||
|
BOOST_TEST_EQ(sizeof(big_uint48_buf_t), 6u);
|
||||||
|
BOOST_TEST_EQ(sizeof(big_uint56_buf_t), 7u);
|
||||||
BOOST_TEST_EQ(sizeof(big_uint64_buf_t), 8u);
|
BOOST_TEST_EQ(sizeof(big_uint64_buf_t), 8u);
|
||||||
|
|
||||||
BOOST_TEST_EQ(sizeof(little_int8_buf_t), 1u);
|
BOOST_TEST_EQ(sizeof(little_int8_buf_t), 1u);
|
||||||
BOOST_TEST_EQ(sizeof(little_int16_buf_t), 2u);
|
BOOST_TEST_EQ(sizeof(little_int16_buf_t), 2u);
|
||||||
|
BOOST_TEST_EQ(sizeof(little_int24_buf_t), 3u);
|
||||||
BOOST_TEST_EQ(sizeof(little_int32_buf_t), 4u);
|
BOOST_TEST_EQ(sizeof(little_int32_buf_t), 4u);
|
||||||
|
BOOST_TEST_EQ(sizeof(little_int40_buf_t), 5u);
|
||||||
|
BOOST_TEST_EQ(sizeof(little_int48_buf_t), 6u);
|
||||||
|
BOOST_TEST_EQ(sizeof(little_int56_buf_t), 7u);
|
||||||
BOOST_TEST_EQ(sizeof(little_int64_buf_t), 8u);
|
BOOST_TEST_EQ(sizeof(little_int64_buf_t), 8u);
|
||||||
|
|
||||||
BOOST_TEST_EQ(sizeof(little_uint8_buf_t), 1u);
|
BOOST_TEST_EQ(sizeof(little_uint8_buf_t), 1u);
|
||||||
BOOST_TEST_EQ(sizeof(little_uint16_buf_t), 2u);
|
BOOST_TEST_EQ(sizeof(little_uint16_buf_t), 2u);
|
||||||
|
BOOST_TEST_EQ(sizeof(little_uint24_buf_t), 3u);
|
||||||
BOOST_TEST_EQ(sizeof(little_uint32_buf_t), 4u);
|
BOOST_TEST_EQ(sizeof(little_uint32_buf_t), 4u);
|
||||||
|
BOOST_TEST_EQ(sizeof(little_uint40_buf_t), 5u);
|
||||||
|
BOOST_TEST_EQ(sizeof(little_uint48_buf_t), 6u);
|
||||||
|
BOOST_TEST_EQ(sizeof(little_uint56_buf_t), 7u);
|
||||||
BOOST_TEST_EQ(sizeof(little_uint64_buf_t), 8u);
|
BOOST_TEST_EQ(sizeof(little_uint64_buf_t), 8u);
|
||||||
|
|
||||||
|
BOOST_TEST_EQ(sizeof(native_int8_buf_t), 1u);
|
||||||
|
BOOST_TEST_EQ(sizeof(native_int16_buf_t), 2u);
|
||||||
|
BOOST_TEST_EQ(sizeof(native_int24_buf_t), 3u);
|
||||||
|
BOOST_TEST_EQ(sizeof(native_int32_buf_t), 4u);
|
||||||
|
BOOST_TEST_EQ(sizeof(native_int40_buf_t), 5u);
|
||||||
|
BOOST_TEST_EQ(sizeof(native_int48_buf_t), 6u);
|
||||||
|
BOOST_TEST_EQ(sizeof(native_int56_buf_t), 7u);
|
||||||
|
BOOST_TEST_EQ(sizeof(native_int64_buf_t), 8u);
|
||||||
|
|
||||||
|
BOOST_TEST_EQ(sizeof(native_uint8_buf_t), 1u);
|
||||||
|
BOOST_TEST_EQ(sizeof(native_uint16_buf_t), 2u);
|
||||||
|
BOOST_TEST_EQ(sizeof(native_uint24_buf_t), 3u);
|
||||||
|
BOOST_TEST_EQ(sizeof(native_uint32_buf_t), 4u);
|
||||||
|
BOOST_TEST_EQ(sizeof(native_uint40_buf_t), 5u);
|
||||||
|
BOOST_TEST_EQ(sizeof(native_uint48_buf_t), 6u);
|
||||||
|
BOOST_TEST_EQ(sizeof(native_uint56_buf_t), 7u);
|
||||||
|
BOOST_TEST_EQ(sizeof(native_uint64_buf_t), 8u);
|
||||||
|
|
||||||
|
BOOST_TEST_EQ(sizeof(big_int8_buf_at), 1u);
|
||||||
|
BOOST_TEST_EQ(sizeof(big_int16_buf_at), 2u);
|
||||||
|
BOOST_TEST_EQ(sizeof(big_int32_buf_at), 4u);
|
||||||
|
BOOST_TEST_EQ(sizeof(big_int64_buf_at), 8u);
|
||||||
|
|
||||||
|
BOOST_TEST_EQ(sizeof(big_uint8_buf_at), 1u);
|
||||||
|
BOOST_TEST_EQ(sizeof(big_uint16_buf_at), 2u);
|
||||||
|
BOOST_TEST_EQ(sizeof(big_uint32_buf_at), 4u);
|
||||||
|
BOOST_TEST_EQ(sizeof(big_uint64_buf_at), 8u);
|
||||||
|
|
||||||
|
BOOST_TEST_EQ(sizeof(little_int8_buf_at), 1u);
|
||||||
|
BOOST_TEST_EQ(sizeof(little_int16_buf_at), 2u);
|
||||||
|
BOOST_TEST_EQ(sizeof(little_int32_buf_at), 4u);
|
||||||
|
BOOST_TEST_EQ(sizeof(little_int64_buf_at), 8u);
|
||||||
|
|
||||||
|
BOOST_TEST_EQ(sizeof(little_uint8_buf_at), 1u);
|
||||||
|
BOOST_TEST_EQ(sizeof(little_uint16_buf_at), 2u);
|
||||||
|
BOOST_TEST_EQ(sizeof(little_uint32_buf_at), 4u);
|
||||||
|
BOOST_TEST_EQ(sizeof(little_uint64_buf_at), 8u);
|
||||||
} // check_size
|
} // check_size
|
||||||
|
|
||||||
// test_inserter_and_extractor -----------------------------------------------------//
|
// test_inserter_and_extractor -----------------------------------------------------//
|
||||||
@ -125,8 +125,8 @@ namespace
|
|||||||
{
|
{
|
||||||
std::cout << "test inserter and extractor..." << std::endl;
|
std::cout << "test inserter and extractor..." << std::endl;
|
||||||
|
|
||||||
big_uint64_buf_ut bu64(0x010203040506070ULL);
|
big_uint64_buf_t bu64(0x010203040506070ULL);
|
||||||
little_uint64_buf_ut lu64(0x010203040506070ULL);
|
little_uint64_buf_t lu64(0x010203040506070ULL);
|
||||||
|
|
||||||
uint64_t x;
|
uint64_t x;
|
||||||
|
|
||||||
@ -143,13 +143,13 @@ namespace
|
|||||||
|
|
||||||
ss.clear();
|
ss.clear();
|
||||||
ss << 0x010203040506070ULL;
|
ss << 0x010203040506070ULL;
|
||||||
big_uint64_buf_ut bu64z(0);
|
big_uint64_buf_t bu64z(0);
|
||||||
ss >> bu64z;
|
ss >> bu64z;
|
||||||
BOOST_TEST_EQ(bu64z.value(), bu64.value());
|
BOOST_TEST_EQ(bu64z.value(), bu64.value());
|
||||||
|
|
||||||
ss.clear();
|
ss.clear();
|
||||||
ss << 0x010203040506070ULL;
|
ss << 0x010203040506070ULL;
|
||||||
little_uint64_buf_ut lu64z(0);
|
little_uint64_buf_t lu64z(0);
|
||||||
ss >> lu64z;
|
ss >> lu64z;
|
||||||
BOOST_TEST_EQ(lu64z.value(), lu64.value());
|
BOOST_TEST_EQ(lu64z.value(), lu64.value());
|
||||||
|
|
||||||
@ -166,7 +166,7 @@ int cpp_main(int, char *[])
|
|||||||
cout << "byte swap intrinsics: " BOOST_ENDIAN_INTRINSIC_MSG << endl;
|
cout << "byte swap intrinsics: " BOOST_ENDIAN_INTRINSIC_MSG << endl;
|
||||||
|
|
||||||
cout << " construct big endian aligned" << endl;
|
cout << " construct big endian aligned" << endl;
|
||||||
big_int32_buf_t x(1122334455);
|
big_int32_buf_at x(1122334455);
|
||||||
|
|
||||||
cout << " assign to buffer from built-in integer" << endl;
|
cout << " assign to buffer from built-in integer" << endl;
|
||||||
x = 1234567890;
|
x = 1234567890;
|
||||||
@ -176,7 +176,7 @@ int cpp_main(int, char *[])
|
|||||||
BOOST_TEST(b1);
|
BOOST_TEST(b1);
|
||||||
|
|
||||||
cout << " construct little endian unaligned" << endl;
|
cout << " construct little endian unaligned" << endl;
|
||||||
little_int32_buf_ut x2(1122334455);
|
little_int32_buf_t x2(1122334455);
|
||||||
|
|
||||||
cout << " assign to buffer from built-in integer" << endl;
|
cout << " assign to buffer from built-in integer" << endl;
|
||||||
x2 = 1234567890;
|
x2 = 1234567890;
|
||||||
|
@ -21,59 +21,59 @@ using namespace boost::endian;
|
|||||||
|
|
||||||
union U
|
union U
|
||||||
{
|
{
|
||||||
big_int8_ut big_8;
|
big_int8_t big_8;
|
||||||
big_int16_ut big_16;
|
big_int16_t big_16;
|
||||||
big_int24_ut big_24;
|
big_int24_t big_24;
|
||||||
big_int32_ut big_32;
|
big_int32_t big_32;
|
||||||
big_int40_ut big_40;
|
big_int40_t big_40;
|
||||||
big_int48_ut big_48;
|
big_int48_t big_48;
|
||||||
big_int56_ut big_56;
|
big_int56_t big_56;
|
||||||
big_int64_ut big_64;
|
big_int64_t big_64;
|
||||||
|
|
||||||
big_uint8_ut big_u8;
|
big_uint8_t big_u8;
|
||||||
big_uint16_ut big_u16;
|
big_uint16_t big_u16;
|
||||||
big_uint24_ut big_u24;
|
big_uint24_t big_u24;
|
||||||
big_uint32_ut big_u32;
|
big_uint32_t big_u32;
|
||||||
big_uint40_ut big_u40;
|
big_uint40_t big_u40;
|
||||||
big_uint48_ut big_u48;
|
big_uint48_t big_u48;
|
||||||
big_uint56_ut big_u56;
|
big_uint56_t big_u56;
|
||||||
big_uint64_ut big_u64;
|
big_uint64_t big_u64;
|
||||||
|
|
||||||
little_int8_ut little_8;
|
little_int8_t little_8;
|
||||||
little_int16_ut little_16;
|
little_int16_t little_16;
|
||||||
little_int24_ut little_24;
|
little_int24_t little_24;
|
||||||
little_int32_ut little_32;
|
little_int32_t little_32;
|
||||||
little_int40_ut little_40;
|
little_int40_t little_40;
|
||||||
little_int48_ut little_48;
|
little_int48_t little_48;
|
||||||
little_int56_ut little_56;
|
little_int56_t little_56;
|
||||||
little_int64_ut little_64;
|
little_int64_t little_64;
|
||||||
|
|
||||||
little_uint8_ut little_u8;
|
little_uint8_t little_u8;
|
||||||
little_uint16_ut little_u16;
|
little_uint16_t little_u16;
|
||||||
little_uint24_ut little_u24;
|
little_uint24_t little_u24;
|
||||||
little_uint32_ut little_u32;
|
little_uint32_t little_u32;
|
||||||
little_uint40_ut little_u40;
|
little_uint40_t little_u40;
|
||||||
little_uint48_ut little_u48;
|
little_uint48_t little_u48;
|
||||||
little_uint56_ut little_u56;
|
little_uint56_t little_u56;
|
||||||
little_uint64_ut little_u64;
|
little_uint64_t little_u64;
|
||||||
|
|
||||||
native_int8_ut native_8;
|
native_int8_t native_8;
|
||||||
native_int16_ut native_16;
|
native_int16_t native_16;
|
||||||
native_int24_ut native_24;
|
native_int24_t native_24;
|
||||||
native_int32_ut native_32;
|
native_int32_t native_32;
|
||||||
native_int40_ut native_40;
|
native_int40_t native_40;
|
||||||
native_int48_ut native_48;
|
native_int48_t native_48;
|
||||||
native_int56_ut native_56;
|
native_int56_t native_56;
|
||||||
native_int64_ut native_64;
|
native_int64_t native_64;
|
||||||
|
|
||||||
native_uint8_ut native_u8;
|
native_uint8_t native_u8;
|
||||||
native_uint16_ut native_u16;
|
native_uint16_t native_u16;
|
||||||
native_uint24_ut native_u24;
|
native_uint24_t native_u24;
|
||||||
native_uint32_ut native_u32;
|
native_uint32_t native_u32;
|
||||||
native_uint40_ut native_u40;
|
native_uint40_t native_u40;
|
||||||
native_uint48_ut native_u48;
|
native_uint48_t native_u48;
|
||||||
native_uint56_ut native_u56;
|
native_uint56_t native_u56;
|
||||||
native_uint64_ut native_u64;
|
native_uint64_t native_u64;
|
||||||
};
|
};
|
||||||
|
|
||||||
U foo;
|
U foo;
|
||||||
|
@ -194,67 +194,67 @@ void op_test_aux()
|
|||||||
Test<T1, unsigned long>::test();
|
Test<T1, unsigned long>::test();
|
||||||
Test<T1, long long>::test();
|
Test<T1, long long>::test();
|
||||||
Test<T1, unsigned long long>::test();
|
Test<T1, unsigned long long>::test();
|
||||||
|
Test<T1, be::big_int16_at>::test();
|
||||||
|
Test<T1, be::big_int32_at>::test();
|
||||||
|
Test<T1, be::big_int64_at>::test();
|
||||||
|
Test<T1, be::big_uint16_at>::test();
|
||||||
|
Test<T1, be::big_uint32_at>::test();
|
||||||
|
Test<T1, be::big_uint64_at>::test();
|
||||||
|
Test<T1, be::little_int16_at>::test();
|
||||||
|
Test<T1, be::little_int32_at>::test();
|
||||||
|
Test<T1, be::little_int64_at>::test();
|
||||||
|
Test<T1, be::little_uint16_at>::test();
|
||||||
|
Test<T1, be::little_uint32_at>::test();
|
||||||
|
Test<T1, be::little_uint64_at>::test();
|
||||||
|
Test<T1, be::big_int8_t>::test();
|
||||||
Test<T1, be::big_int16_t>::test();
|
Test<T1, be::big_int16_t>::test();
|
||||||
|
Test<T1, be::big_int24_t>::test();
|
||||||
Test<T1, be::big_int32_t>::test();
|
Test<T1, be::big_int32_t>::test();
|
||||||
|
Test<T1, be::big_int40_t>::test();
|
||||||
|
Test<T1, be::big_int48_t>::test();
|
||||||
|
Test<T1, be::big_int56_t>::test();
|
||||||
Test<T1, be::big_int64_t>::test();
|
Test<T1, be::big_int64_t>::test();
|
||||||
|
Test<T1, be::big_uint8_t>::test();
|
||||||
Test<T1, be::big_uint16_t>::test();
|
Test<T1, be::big_uint16_t>::test();
|
||||||
|
Test<T1, be::big_uint24_t>::test();
|
||||||
Test<T1, be::big_uint32_t>::test();
|
Test<T1, be::big_uint32_t>::test();
|
||||||
|
Test<T1, be::big_uint40_t>::test();
|
||||||
Test<T1, be::big_uint64_t>::test();
|
Test<T1, be::big_uint64_t>::test();
|
||||||
Test<T1, be::little_int16_t>::test();
|
Test<T1, be::little_int16_t>::test();
|
||||||
|
Test<T1, be::little_int24_t>::test();
|
||||||
Test<T1, be::little_int32_t>::test();
|
Test<T1, be::little_int32_t>::test();
|
||||||
Test<T1, be::little_int64_t>::test();
|
Test<T1, be::little_int64_t>::test();
|
||||||
Test<T1, be::little_uint16_t>::test();
|
Test<T1, be::little_uint16_t>::test();
|
||||||
Test<T1, be::little_uint32_t>::test();
|
Test<T1, be::little_uint32_t>::test();
|
||||||
|
Test<T1, be::little_uint56_t>::test();
|
||||||
Test<T1, be::little_uint64_t>::test();
|
Test<T1, be::little_uint64_t>::test();
|
||||||
Test<T1, be::big_int8_ut>::test();
|
Test<T1, be::native_int16_t>::test();
|
||||||
Test<T1, be::big_int16_ut>::test();
|
Test<T1, be::native_int24_t>::test();
|
||||||
Test<T1, be::big_int24_ut>::test();
|
Test<T1, be::native_int32_t>::test();
|
||||||
Test<T1, be::big_int32_ut>::test();
|
Test<T1, be::native_int64_t>::test();
|
||||||
Test<T1, be::big_int40_ut>::test();
|
|
||||||
Test<T1, be::big_int48_ut>::test();
|
|
||||||
Test<T1, be::big_int56_ut>::test();
|
|
||||||
Test<T1, be::big_int64_ut>::test();
|
|
||||||
Test<T1, be::big_uint8_ut>::test();
|
|
||||||
Test<T1, be::big_uint16_ut>::test();
|
|
||||||
Test<T1, be::big_uint24_ut>::test();
|
|
||||||
Test<T1, be::big_uint32_ut>::test();
|
|
||||||
Test<T1, be::big_uint40_ut>::test();
|
|
||||||
Test<T1, be::big_uint64_ut>::test();
|
|
||||||
Test<T1, be::little_int16_ut>::test();
|
|
||||||
Test<T1, be::little_int24_ut>::test();
|
|
||||||
Test<T1, be::little_int32_ut>::test();
|
|
||||||
Test<T1, be::little_int64_ut>::test();
|
|
||||||
Test<T1, be::little_uint16_ut>::test();
|
|
||||||
Test<T1, be::little_uint32_ut>::test();
|
|
||||||
Test<T1, be::little_uint56_ut>::test();
|
|
||||||
Test<T1, be::little_uint64_ut>::test();
|
|
||||||
Test<T1, be::native_int16_ut>::test();
|
|
||||||
Test<T1, be::native_int24_ut>::test();
|
|
||||||
Test<T1, be::native_int32_ut>::test();
|
|
||||||
Test<T1, be::native_int64_ut>::test();
|
|
||||||
#ifdef BOOST_LONG_ENDIAN_TEST
|
#ifdef BOOST_LONG_ENDIAN_TEST
|
||||||
Test<T1, be::native_uint16_ut>::test();
|
Test<T1, be::native_uint16_t>::test();
|
||||||
Test<T1, be::native_uint24_ut>::test();
|
Test<T1, be::native_uint24_t>::test();
|
||||||
Test<T1, be::native_uint32_ut>::test();
|
Test<T1, be::native_uint32_t>::test();
|
||||||
Test<T1, be::native_uint48_ut>::test();
|
Test<T1, be::native_uint48_t>::test();
|
||||||
Test<T1, be::native_uint64_ut>::test();
|
Test<T1, be::native_uint64_t>::test();
|
||||||
Test<T1, be::big_uint48_ut>::test();
|
Test<T1, be::big_uint48_t>::test();
|
||||||
Test<T1, be::big_uint56_ut>::test();
|
Test<T1, be::big_uint56_t>::test();
|
||||||
Test<T1, be::little_int8_ut>::test();
|
Test<T1, be::little_int8_t>::test();
|
||||||
Test<T1, be::little_int56_ut>::test();
|
Test<T1, be::little_int56_t>::test();
|
||||||
Test<T1, be::little_int40_ut>::test();
|
Test<T1, be::little_int40_t>::test();
|
||||||
Test<T1, be::little_int48_ut>::test();
|
Test<T1, be::little_int48_t>::test();
|
||||||
Test<T1, be::little_uint8_ut>::test();
|
Test<T1, be::little_uint8_t>::test();
|
||||||
Test<T1, be::little_uint24_ut>::test();
|
Test<T1, be::little_uint24_t>::test();
|
||||||
Test<T1, be::little_uint40_ut>::test();
|
Test<T1, be::little_uint40_t>::test();
|
||||||
Test<T1, be::little_uint48_ut>::test();
|
Test<T1, be::little_uint48_t>::test();
|
||||||
Test<T1, be::native_int8_ut>::test();
|
Test<T1, be::native_int8_t>::test();
|
||||||
Test<T1, be::native_int40_ut>::test();
|
Test<T1, be::native_int40_t>::test();
|
||||||
Test<T1, be::native_int48_ut>::test();
|
Test<T1, be::native_int48_t>::test();
|
||||||
Test<T1, be::native_int56_ut>::test();
|
Test<T1, be::native_int56_t>::test();
|
||||||
Test<T1, be::native_uint8_ut>::test();
|
Test<T1, be::native_uint8_t>::test();
|
||||||
Test<T1, be::native_uint40_ut>::test();
|
Test<T1, be::native_uint40_t>::test();
|
||||||
Test<T1, be::native_uint56_ut>::test();
|
Test<T1, be::native_uint56_t>::test();
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -272,61 +272,61 @@ void op_test()
|
|||||||
op_test_aux<Test, unsigned long>();
|
op_test_aux<Test, unsigned long>();
|
||||||
op_test_aux<Test, long long>();
|
op_test_aux<Test, long long>();
|
||||||
op_test_aux<Test, unsigned long long>();
|
op_test_aux<Test, unsigned long long>();
|
||||||
op_test_aux<Test, be::big_int16_t>();
|
op_test_aux<Test, be::big_int16_at>();
|
||||||
op_test_aux<Test, be::big_int32_t>();
|
op_test_aux<Test, be::big_int32_at>();
|
||||||
op_test_aux<Test, be::big_int64_t>();
|
op_test_aux<Test, be::big_int64_at>();
|
||||||
op_test_aux<Test, be::little_int16_t>();
|
op_test_aux<Test, be::little_int16_at>();
|
||||||
op_test_aux<Test, be::little_int32_t>();
|
op_test_aux<Test, be::little_int32_at>();
|
||||||
op_test_aux<Test, be::little_int64_t>();
|
op_test_aux<Test, be::little_int64_at>();
|
||||||
#ifdef BOOST_LONG_ENDIAN_TEST
|
#ifdef BOOST_LONG_ENDIAN_TEST
|
||||||
op_test_aux<Test, be::big_int8_ut>();
|
op_test_aux<Test, be::big_int8_t>();
|
||||||
op_test_aux<Test, be::big_int16_ut>();
|
op_test_aux<Test, be::big_int16_t>();
|
||||||
op_test_aux<Test, be::big_int24_ut>();
|
op_test_aux<Test, be::big_int24_t>();
|
||||||
op_test_aux<Test, be::big_int32_ut>();
|
op_test_aux<Test, be::big_int32_t>();
|
||||||
op_test_aux<Test, be::big_int40_ut>();
|
op_test_aux<Test, be::big_int40_t>();
|
||||||
op_test_aux<Test, be::big_int48_ut>();
|
op_test_aux<Test, be::big_int48_t>();
|
||||||
op_test_aux<Test, be::big_int56_ut>();
|
op_test_aux<Test, be::big_int56_t>();
|
||||||
op_test_aux<Test, be::big_int64_ut>();
|
op_test_aux<Test, be::big_int64_t>();
|
||||||
op_test_aux<Test, be::big_uint8_ut>();
|
op_test_aux<Test, be::big_uint8_t>();
|
||||||
op_test_aux<Test, be::big_uint16_ut>();
|
op_test_aux<Test, be::big_uint16_t>();
|
||||||
op_test_aux<Test, be::big_uint24_ut>();
|
op_test_aux<Test, be::big_uint24_t>();
|
||||||
op_test_aux<Test, be::big_uint32_ut>();
|
op_test_aux<Test, be::big_uint32_t>();
|
||||||
op_test_aux<Test, be::big_uint40_ut>();
|
op_test_aux<Test, be::big_uint40_t>();
|
||||||
op_test_aux<Test, be::big_uint48_ut>();
|
op_test_aux<Test, be::big_uint48_t>();
|
||||||
op_test_aux<Test, be::big_uint56_ut>();
|
op_test_aux<Test, be::big_uint56_t>();
|
||||||
op_test_aux<Test, be::big_uint64_ut>();
|
op_test_aux<Test, be::big_uint64_t>();
|
||||||
op_test_aux<Test, be::little_int8_ut>();
|
op_test_aux<Test, be::little_int8_t>();
|
||||||
op_test_aux<Test, be::little_int16_ut>();
|
op_test_aux<Test, be::little_int16_t>();
|
||||||
op_test_aux<Test, be::little_int24_ut>();
|
op_test_aux<Test, be::little_int24_t>();
|
||||||
op_test_aux<Test, be::little_int32_ut>();
|
op_test_aux<Test, be::little_int32_t>();
|
||||||
op_test_aux<Test, be::little_int40_ut>();
|
op_test_aux<Test, be::little_int40_t>();
|
||||||
op_test_aux<Test, be::little_int48_ut>();
|
op_test_aux<Test, be::little_int48_t>();
|
||||||
op_test_aux<Test, be::little_int56_ut>();
|
op_test_aux<Test, be::little_int56_t>();
|
||||||
op_test_aux<Test, be::little_int64_ut>();
|
op_test_aux<Test, be::little_int64_t>();
|
||||||
op_test_aux<Test, be::little_uint8_ut>();
|
op_test_aux<Test, be::little_uint8_t>();
|
||||||
op_test_aux<Test, be::little_uint16_ut>();
|
op_test_aux<Test, be::little_uint16_t>();
|
||||||
op_test_aux<Test, be::little_uint24_ut>();
|
op_test_aux<Test, be::little_uint24_t>();
|
||||||
op_test_aux<Test, be::little_uint32_ut>();
|
op_test_aux<Test, be::little_uint32_t>();
|
||||||
op_test_aux<Test, be::little_uint40_ut>();
|
op_test_aux<Test, be::little_uint40_t>();
|
||||||
op_test_aux<Test, be::little_uint48_ut>();
|
op_test_aux<Test, be::little_uint48_t>();
|
||||||
op_test_aux<Test, be::little_uint56_ut>();
|
op_test_aux<Test, be::little_uint56_t>();
|
||||||
op_test_aux<Test, be::little_uint64_ut>();
|
op_test_aux<Test, be::little_uint64_t>();
|
||||||
op_test_aux<Test, be::native_int8_ut>();
|
op_test_aux<Test, be::native_int8_t>();
|
||||||
op_test_aux<Test, be::native_int16_ut>();
|
op_test_aux<Test, be::native_int16_t>();
|
||||||
op_test_aux<Test, be::native_int24_ut>();
|
op_test_aux<Test, be::native_int24_t>();
|
||||||
op_test_aux<Test, be::native_int32_ut>();
|
op_test_aux<Test, be::native_int32_t>();
|
||||||
op_test_aux<Test, be::native_int40_ut>();
|
op_test_aux<Test, be::native_int40_t>();
|
||||||
op_test_aux<Test, be::native_int48_ut>();
|
op_test_aux<Test, be::native_int48_t>();
|
||||||
op_test_aux<Test, be::native_int56_ut>();
|
op_test_aux<Test, be::native_int56_t>();
|
||||||
op_test_aux<Test, be::native_int64_ut>();
|
op_test_aux<Test, be::native_int64_t>();
|
||||||
op_test_aux<Test, be::native_uint8_ut>();
|
op_test_aux<Test, be::native_uint8_t>();
|
||||||
op_test_aux<Test, be::native_uint16_ut>();
|
op_test_aux<Test, be::native_uint16_t>();
|
||||||
op_test_aux<Test, be::native_uint24_ut>();
|
op_test_aux<Test, be::native_uint24_t>();
|
||||||
op_test_aux<Test, be::native_uint32_ut>();
|
op_test_aux<Test, be::native_uint32_t>();
|
||||||
op_test_aux<Test, be::native_uint40_ut>();
|
op_test_aux<Test, be::native_uint40_t>();
|
||||||
op_test_aux<Test, be::native_uint48_ut>();
|
op_test_aux<Test, be::native_uint48_t>();
|
||||||
op_test_aux<Test, be::native_uint56_ut>();
|
op_test_aux<Test, be::native_uint56_t>();
|
||||||
op_test_aux<Test, be::native_uint64_ut>();
|
op_test_aux<Test, be::native_uint64_t>();
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -336,8 +336,8 @@ void test_inserter_and_extractor()
|
|||||||
{
|
{
|
||||||
std::cout << "test inserter and extractor..." << std::endl;
|
std::cout << "test inserter and extractor..." << std::endl;
|
||||||
|
|
||||||
be::big_uint64_ut bu64(0x010203040506070ULL);
|
be::big_uint64_t bu64(0x010203040506070ULL);
|
||||||
be::little_uint64_ut lu64(0x010203040506070ULL);
|
be::little_uint64_t lu64(0x010203040506070ULL);
|
||||||
|
|
||||||
uint64_t x;
|
uint64_t x;
|
||||||
|
|
||||||
@ -354,13 +354,13 @@ void test_inserter_and_extractor()
|
|||||||
|
|
||||||
ss.clear();
|
ss.clear();
|
||||||
ss << 0x010203040506070ULL;
|
ss << 0x010203040506070ULL;
|
||||||
be::big_uint64_ut bu64z(0);
|
be::big_uint64_t bu64z(0);
|
||||||
ss >> bu64z;
|
ss >> bu64z;
|
||||||
BOOST_TEST_EQ(bu64z, bu64);
|
BOOST_TEST_EQ(bu64z, bu64);
|
||||||
|
|
||||||
ss.clear();
|
ss.clear();
|
||||||
ss << 0x010203040506070ULL;
|
ss << 0x010203040506070ULL;
|
||||||
be::little_uint64_ut lu64z(0);
|
be::little_uint64_t lu64z(0);
|
||||||
ss >> lu64z;
|
ss >> lu64z;
|
||||||
BOOST_TEST_EQ(lu64z, lu64);
|
BOOST_TEST_EQ(lu64z, lu64);
|
||||||
|
|
||||||
@ -368,7 +368,7 @@ void test_inserter_and_extractor()
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void f_big_int32_ut(be::big_int32_ut) {}
|
void f_big_int32_ut(be::big_int32_t) {}
|
||||||
|
|
||||||
// main ------------------------------------------------------------------------------//
|
// main ------------------------------------------------------------------------------//
|
||||||
|
|
||||||
@ -378,10 +378,10 @@ int cpp_main(int, char * [])
|
|||||||
|
|
||||||
// make sure some simple things work
|
// make sure some simple things work
|
||||||
|
|
||||||
be::big_int32_ut o1(1);
|
be::big_int32_t o1(1);
|
||||||
be::big_int32_ut o2(2L);
|
be::big_int32_t o2(2L);
|
||||||
be::big_int32_ut o3(3LL);
|
be::big_int32_t o3(3LL);
|
||||||
be::big_int64_ut o4(1);
|
be::big_int64_t o4(1);
|
||||||
|
|
||||||
// use cases; if BOOST_ENDIAN_LOG is defined, will output to clog info on
|
// use cases; if BOOST_ENDIAN_LOG is defined, will output to clog info on
|
||||||
// what overloads and conversions are actually being performed.
|
// what overloads and conversions are actually being performed.
|
||||||
@ -389,13 +389,13 @@ int cpp_main(int, char * [])
|
|||||||
be::endian_log = true;
|
be::endian_log = true;
|
||||||
|
|
||||||
std::clog << "set up test values\n";
|
std::clog << "set up test values\n";
|
||||||
be::big_int32_ut big(12345);
|
be::big_int32_t big(12345);
|
||||||
be::little_uint16_ut little_u(10);
|
be::little_uint16_t little_u(10);
|
||||||
be::big_int64_ut result;
|
be::big_int64_t result;
|
||||||
|
|
||||||
// this is the use case that is so irritating that it caused the endian
|
// this is the use case that is so irritating that it caused the endian
|
||||||
// constructors to be made non-explicit
|
// constructors to be made non-explicit
|
||||||
std::clog << "\nf(1234) where f(big_int32_ut)\n";
|
std::clog << "\nf(1234) where f(big_int32_t)\n";
|
||||||
f_big_int32_ut(1234);
|
f_big_int32_ut(1234);
|
||||||
|
|
||||||
std::clog << "\nresult = big\n";
|
std::clog << "\nresult = big\n";
|
||||||
@ -456,8 +456,8 @@ int cpp_main(int, char * [])
|
|||||||
// test from Roland Schwarz that detected ambiguities; these ambiguities
|
// test from Roland Schwarz that detected ambiguities; these ambiguities
|
||||||
// were eliminated by BOOST_ENDIAN_MINIMAL_COVER_OPERATORS
|
// were eliminated by BOOST_ENDIAN_MINIMAL_COVER_OPERATORS
|
||||||
unsigned u;
|
unsigned u;
|
||||||
be::little_uint32_ut u1;
|
be::little_uint32_t u1;
|
||||||
be::little_uint32_ut u2;
|
be::little_uint32_t u2;
|
||||||
|
|
||||||
u = 9;
|
u = 9;
|
||||||
u1 = 1;
|
u1 = 1;
|
||||||
@ -467,7 +467,7 @@ int cpp_main(int, char * [])
|
|||||||
|
|
||||||
// variations to detect ambiguities
|
// variations to detect ambiguities
|
||||||
|
|
||||||
be::little_uint32_ut u3 = u1 + 5;
|
be::little_uint32_t u3 = u1 + 5;
|
||||||
u3 = u1 + 5u;
|
u3 = u1 + 5u;
|
||||||
|
|
||||||
if (u1 == 5)
|
if (u1 == 5)
|
||||||
@ -482,7 +482,7 @@ int cpp_main(int, char * [])
|
|||||||
u2 = u1 + 5u;
|
u2 = u1 + 5u;
|
||||||
|
|
||||||
// one more wrinkle
|
// one more wrinkle
|
||||||
be::little_uint16_ut u4(3);
|
be::little_uint16_t u4(3);
|
||||||
u4 = 3;
|
u4 = 3;
|
||||||
std::clog << "\nu2 = u1 + u4\n";
|
std::clog << "\nu2 = u1 + u4\n";
|
||||||
u2 = u1 + u4;
|
u2 = u1 + u4;
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -162,84 +162,84 @@ namespace
|
|||||||
void test_big_align_int16()
|
void test_big_align_int16()
|
||||||
{
|
{
|
||||||
cout << "<tr><td>16-bit aligned big endian</td>";
|
cout << "<tr><td>16-bit aligned big endian</td>";
|
||||||
time<int16_t, big_int16_t>();
|
time<int16_t, big_int16_at>();
|
||||||
cout << "</tr>\n";
|
cout << "</tr>\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
void test_little_align_int16()
|
void test_little_align_int16()
|
||||||
{
|
{
|
||||||
cout << "<tr><td>16-bit aligned little endian</td>";
|
cout << "<tr><td>16-bit aligned little endian</td>";
|
||||||
time<int16_t, little_int16_t>();
|
time<int16_t, little_int16_at>();
|
||||||
cout << "</tr>\n";
|
cout << "</tr>\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
void test_big_int16()
|
void test_big_int16()
|
||||||
{
|
{
|
||||||
cout << "<tr><td>16-bit unaligned big endian</td>";
|
cout << "<tr><td>16-bit unaligned big endian</td>";
|
||||||
time<int16_t, big_int16_ut>();
|
time<int16_t, big_int16_t>();
|
||||||
cout << "</tr>\n";
|
cout << "</tr>\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
void test_little_int16()
|
void test_little_int16()
|
||||||
{
|
{
|
||||||
cout << "<tr><td>16-bit unaligned little endian</td>";
|
cout << "<tr><td>16-bit unaligned little endian</td>";
|
||||||
time<int16_t, little_int16_ut>();
|
time<int16_t, little_int16_t>();
|
||||||
cout << "</tr>\n";
|
cout << "</tr>\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
void test_big_align_int32()
|
void test_big_align_int32()
|
||||||
{
|
{
|
||||||
cout << "<tr><td>32-bit aligned big endian</td>";
|
cout << "<tr><td>32-bit aligned big endian</td>";
|
||||||
time<int32_t, big_int32_t>();
|
time<int32_t, big_int32_at>();
|
||||||
cout << "</tr>\n";
|
cout << "</tr>\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
void test_little_align_int32()
|
void test_little_align_int32()
|
||||||
{
|
{
|
||||||
cout << "<tr><td>32-bit aligned little endian</td>";
|
cout << "<tr><td>32-bit aligned little endian</td>";
|
||||||
time<int32_t, little_int32_t>();
|
time<int32_t, little_int32_at>();
|
||||||
cout << "</tr>\n";
|
cout << "</tr>\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
void test_big_int32()
|
void test_big_int32()
|
||||||
{
|
{
|
||||||
cout << "<tr><td>32-bit unaligned big endian</td>";
|
cout << "<tr><td>32-bit unaligned big endian</td>";
|
||||||
time<int32_t, big_int32_ut>();
|
time<int32_t, big_int32_t>();
|
||||||
cout << "</tr>\n";
|
cout << "</tr>\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
void test_little_int32()
|
void test_little_int32()
|
||||||
{
|
{
|
||||||
cout << "<tr><td>32-bit unaligned little endian</td>";
|
cout << "<tr><td>32-bit unaligned little endian</td>";
|
||||||
time<int32_t, little_int32_ut>();
|
time<int32_t, little_int32_t>();
|
||||||
cout << "</tr>\n";
|
cout << "</tr>\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
void test_big_align_int64()
|
void test_big_align_int64()
|
||||||
{
|
{
|
||||||
cout << "<tr><td>64-bit aligned big endian</td>";
|
cout << "<tr><td>64-bit aligned big endian</td>";
|
||||||
time<int64_t, big_int64_t>();
|
time<int64_t, big_int64_at>();
|
||||||
cout << "</tr>\n";
|
cout << "</tr>\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
void test_little_align_int64()
|
void test_little_align_int64()
|
||||||
{
|
{
|
||||||
cout << "<tr><td>64-bit aligned little endian</td>";
|
cout << "<tr><td>64-bit aligned little endian</td>";
|
||||||
time<int64_t, little_int64_t>();
|
time<int64_t, little_int64_at>();
|
||||||
cout << "</tr>\n";
|
cout << "</tr>\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
void test_big_int64()
|
void test_big_int64()
|
||||||
{
|
{
|
||||||
cout << "<tr><td>64-bit unaligned big endian</td>";
|
cout << "<tr><td>64-bit unaligned big endian</td>";
|
||||||
time<int64_t, big_int64_ut>();
|
time<int64_t, big_int64_t>();
|
||||||
cout << "</tr>\n";
|
cout << "</tr>\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
void test_little_int64()
|
void test_little_int64()
|
||||||
{
|
{
|
||||||
cout << "<tr><td>64-bit unaligned little endian</td>";
|
cout << "<tr><td>64-bit unaligned little endian</td>";
|
||||||
time<int64_t, little_int64_ut>();
|
time<int64_t, little_int64_t>();
|
||||||
cout << "</tr>\n";
|
cout << "</tr>\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user