From Jason Turner

[bit.endian]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmpt_7gy0d2/{from.md → to.md} +26 -0
tmp/tmpt_7gy0d2/{from.md → to.md} RENAMED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ### Endian <a id="bit.endian">[[bit.endian]]</a>
2
+
3
+ Two common methods of byte ordering in multibyte scalar types are
4
+ big-endian and little-endian in the execution environment. Big-endian is
5
+ a format for storage of binary data in which the most significant byte
6
+ is placed first, with the rest in descending order. Little-endian is a
7
+ format for storage of binary data in which the least significant byte is
8
+ placed first, with the rest in ascending order. This subclause describes
9
+ the endianness of the scalar types of the execution environment.
10
+
11
+ ``` cpp
12
+ enum class endian {
13
+ little = see below,
14
+ big = see below,
15
+ native = see below
16
+ };
17
+ ```
18
+
19
+ If all scalar types have size 1 byte, then all of `endian::little`,
20
+ `endian::big`, and `endian::native` have the same value. Otherwise,
21
+ `endian::little` is not equal to `endian::big`. If all scalar types are
22
+ big-endian, `endian::native` is equal to `endian::big`. If all scalar
23
+ types are little-endian, `endian::native` is equal to `endian::little`.
24
+ Otherwise, `endian::native` is not equal to either `endian::big` or
25
+ `endian::little`.
26
+