Skip to content

Commit d5fbc91

Browse files
committed
Merge 2017-07 LWG Motion 33
2 parents eea1e70 + ff1242c commit d5fbc91

File tree

1 file changed

+43
-0
lines changed

1 file changed

+43
-0
lines changed

source/utilities.tex

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15391,6 +15391,13 @@
1539115391
template<class... B> struct disjunction;
1539215392
template<class B> struct negation;
1539315393

15394+
// \ref{meta.endian}, endian
15395+
enum class endian {
15396+
little = @\seebelow@,
15397+
big = @\seebelow@,
15398+
native = @\seebelow@
15399+
};
15400+
1539415401
// \ref{meta.unary.cat}, primary type categories
1539515402
template <class T> inline constexpr bool is_void_v
1539615403
= is_void<T>::value;
@@ -17009,6 +17016,42 @@
1700917016
is a \tcode{UnaryTypeTrait} with a base characteristic of \tcode{bool_constant<!bool(B::value)>}.
1701017017
\end{itemdescr}
1701117018

17019+
\rSec2[meta.endian]{Endian}
17020+
17021+
\pnum
17022+
Two common methods of byte ordering in multibyte scalar types are big-endian
17023+
and little-endian in the execution environment. Big-endian is a format for
17024+
storage of binary data in which the most significant byte is placed first,
17025+
with the rest in descending order. Little-endian is a format for storage of
17026+
binary data in which the least significant byte is placed first, with the rest
17027+
in ascending order. This subclause describes the endianness of the scalar types
17028+
of the execution environment.
17029+
17030+
\indexlibrary{\idxcode{endian}}%
17031+
\indexlibrarymember{little}{endian}%
17032+
\indexlibrarymember{big}{endian}%
17033+
\indexlibrarymember{native}{endian}%
17034+
\begin{itemdecl}
17035+
enum class endian {
17036+
little = @\seebelow@,
17037+
big = @\seebelow@,
17038+
native = @\seebelow@
17039+
};
17040+
\end{itemdecl}
17041+
17042+
\begin{itemdescr}
17043+
\pnum
17044+
If all scalar types have size \tcode{1}, then all of \tcode{endian::little},
17045+
\tcode{endian::big}, and \tcode{endian::native} have the same value.
17046+
Otherwise, \tcode{endian::little} is not equal to \tcode{endian::big}.
17047+
If all scalar types are big-endian, \tcode{endian::native} is
17048+
equal to \tcode{endian::big}.
17049+
If all scalar types are little-endian, \tcode{endian::native} is
17050+
equal to \tcode{endian::little}.
17051+
Otherwise, \tcode{endian::native} is not equal
17052+
to either \tcode{endian::big} or \tcode{endian::little}.
17053+
\end{itemdescr}
17054+
1701217055
\rSec1[ratio]{Compile-time rational arithmetic}
1701317056

1701417057
\rSec2[ratio.general]{In general}

0 commit comments

Comments
 (0)