|
15478 | 15478 | template<class... B> struct disjunction;
|
15479 | 15479 | template<class B> struct negation;
|
15480 | 15480 |
|
| 15481 | + // \ref{meta.endian}, endian |
| 15482 | + enum class endian { |
| 15483 | + little = @\seebelow@, |
| 15484 | + big = @\seebelow@, |
| 15485 | + native = @\seebelow@ |
| 15486 | + }; |
| 15487 | + |
15481 | 15488 | // \ref{meta.unary.cat}, primary type categories
|
15482 | 15489 | template <class T> inline constexpr bool is_void_v
|
15483 | 15490 | = is_void<T>::value;
|
|
17096 | 17103 | is a \tcode{UnaryTypeTrait} with a base characteristic of \tcode{bool_constant<!bool(B::value)>}.
|
17097 | 17104 | \end{itemdescr}
|
17098 | 17105 |
|
| 17106 | +\rSec2[meta.endian]{Endian} |
| 17107 | + |
| 17108 | +\pnum |
| 17109 | +Two common methods of byte ordering in multibyte scalar types are big-endian |
| 17110 | +and little-endian in the execution environment. Big-endian is a format for |
| 17111 | +storage of binary data in which the most significant byte is placed first, |
| 17112 | +with the rest in descending order. Little-endian is a format for storage of |
| 17113 | +binary data in which the least significant byte is placed first, with the rest |
| 17114 | +in ascending order. This subclause describes the endianness of the scalar types |
| 17115 | +of the execution environment. |
| 17116 | + |
| 17117 | +\indexlibrary{\idxcode{endian}}% |
| 17118 | +\indexlibrarymember{little}{endian}% |
| 17119 | +\indexlibrarymember{big}{endian}% |
| 17120 | +\indexlibrarymember{native}{endian}% |
| 17121 | +\begin{itemdecl} |
| 17122 | +enum class endian { |
| 17123 | + little = @\seebelow@, |
| 17124 | + big = @\seebelow@, |
| 17125 | + native = @\seebelow@ |
| 17126 | +}; |
| 17127 | +\end{itemdecl} |
| 17128 | + |
| 17129 | +\begin{itemdescr} |
| 17130 | +\pnum |
| 17131 | +If all scalar types have size \tcode{1}, then all of \tcode{endian::little}, |
| 17132 | +\tcode{endian::big}, and \tcode{endian::native} have the same value. |
| 17133 | +Otherwise \tcode{endian::little} shall not be equal to \tcode{endian::big}. |
| 17134 | +If all scalar types are big-endian, \tcode{endian::native} shall be |
| 17135 | +equal to \tcode{endian::big}. |
| 17136 | +If all scalar types are little-endian, \tcode{endian::native} shall be |
| 17137 | +equal to \tcode{endian::little}. |
| 17138 | +Otherwise \tcode{endian::native} shall have a value that is not equal |
| 17139 | +to either of \tcode{endian::big} or \tcode{endian::little}. |
| 17140 | +\end{itemdescr} |
| 17141 | + |
17099 | 17142 | \rSec1[ratio]{Compile-time rational arithmetic}
|
17100 | 17143 |
|
17101 | 17144 | \rSec2[ratio.general]{In general}
|
|
0 commit comments