|
15391 | 15391 | template<class... B> struct disjunction;
|
15392 | 15392 | template<class B> struct negation;
|
15393 | 15393 |
|
| 15394 | + // \ref{meta.endian}, endian |
| 15395 | + enum class endian { |
| 15396 | + little = @\seebelow@, |
| 15397 | + big = @\seebelow@, |
| 15398 | + native = @\seebelow@ |
| 15399 | + }; |
| 15400 | + |
15394 | 15401 | // \ref{meta.unary.cat}, primary type categories
|
15395 | 15402 | template <class T> inline constexpr bool is_void_v
|
15396 | 15403 | = is_void<T>::value;
|
|
17009 | 17016 | is a \tcode{UnaryTypeTrait} with a base characteristic of \tcode{bool_constant<!bool(B::value)>}.
|
17010 | 17017 | \end{itemdescr}
|
17011 | 17018 |
|
| 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 | + |
17012 | 17055 | \rSec1[ratio]{Compile-time rational arithmetic}
|
17013 | 17056 |
|
17014 | 17057 | \rSec2[ratio.general]{In general}
|
|
0 commit comments