|
21 | 21 | \ref{numeric.requirements} & Requirements & \\ \rowsep
|
22 | 22 | \ref{cfenv} & Floating-point environment & \tcode{<cfenv>} \\ \rowsep
|
23 | 23 | \ref{complex.numbers} & Complex numbers & \tcode{<complex>} \\ \rowsep
|
| 24 | +\ref{bit} & Bit manipulation & \tcode{<bit>} \\ \rowsep |
24 | 25 | \ref{rand} & Random number generation & \tcode{<random>} \\ \rowsep
|
25 | 26 | \ref{numarray} & Numeric arrays & \tcode{<valarray>} \\ \rowsep
|
26 | 27 | \ref{numeric.ops} & Generalized numeric operations & \tcode{<numeric>} \\ \rowsep
|
|
1360 | 1361 | \tcode{complex<float>\{0.0f, static_cast<float>(d)\}}.
|
1361 | 1362 | \end{itemdescr}
|
1362 | 1363 |
|
| 1364 | + |
| 1365 | +\rSec1[bit]{Bit manipulation} |
| 1366 | + |
| 1367 | +\rSec2[bit.general]{General} |
| 1368 | + |
| 1369 | +\pnum |
| 1370 | +The header \tcode{<bit>} provides components to access, |
| 1371 | +manipulate and process both individual bits and bit sequences. |
| 1372 | + |
| 1373 | +\rSec2[bit.syn]{Header \tcode{<bit>} synopsis} |
| 1374 | +\indexhdr{bit}% |
| 1375 | +\begin{codeblock} |
| 1376 | +namespace std { |
| 1377 | + // \ref{bit.cast}, \tcode{bit_cast} |
| 1378 | + template<typename To, typename From> |
| 1379 | + constexpr To bit_cast(const From& from) noexcept; |
| 1380 | +} |
| 1381 | +\end{codeblock} |
| 1382 | + |
| 1383 | +\rSec2[bit.cast]{Function template \tcode{bit_cast}} |
| 1384 | + |
| 1385 | +\indexlibrary{\idxcode{bit_cast}}% |
| 1386 | +\begin{itemdecl} |
| 1387 | +template<typename To, typename From> |
| 1388 | + constexpr To bit_cast(const From& from) noexcept; |
| 1389 | +\end{itemdecl} |
| 1390 | + |
| 1391 | +\begin{itemdescr} |
| 1392 | +\pnum |
| 1393 | +\returns |
| 1394 | +An object of type \tcode{To}. |
| 1395 | +Each bit of the value representation of the result |
| 1396 | +is equal to the corresponding bit in the object representation |
| 1397 | +of \tcode{from}. Padding bits of the \tcode{To} object are unspecified. |
| 1398 | +If there is no value of type \tcode{To} corresponding to the |
| 1399 | +value representation produced, the behavior is undefined. |
| 1400 | +If there are multiple such values, which value is produced is unspecified. |
| 1401 | + |
| 1402 | +\pnum |
| 1403 | +\remarks |
| 1404 | +This function shall not participate in overload resolution unless: |
| 1405 | +\begin{itemize} |
| 1406 | +\item \tcode{sizeof(To) == sizeof(From)} is \tcode{true}; |
| 1407 | +\item \tcode{is_trivially_copyable_v<To>} is \tcode{true}; and |
| 1408 | +\item \tcode{is_trivially_copyable_v<From>} is \tcode{true}. |
| 1409 | +\end{itemize} |
| 1410 | +This function shall be \tcode{constexpr} if and only if |
| 1411 | +\tcode{To}, \tcode{From}, and the types of all subobjects |
| 1412 | +of \tcode{To} and \tcode{From} are types \tcode{T} such that: |
| 1413 | +\begin{itemize} |
| 1414 | +\item \tcode{is_union_v<T>} is \tcode{false}; |
| 1415 | +\item \tcode{is_pointer_v<T>} is \tcode{false}; |
| 1416 | +\item \tcode{is_member_pointer_v<T>} is \tcode{false}; |
| 1417 | +\item \tcode{is_volatile_v<T>} is \tcode{false}; and |
| 1418 | +\item \tcode{T} has no non-static data members of reference type. |
| 1419 | +\end{itemize} |
| 1420 | +\end{itemdescr} |
| 1421 | + |
1363 | 1422 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
1364 | 1423 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
1365 | 1424 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
1373 | 1432 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
1374 | 1433 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
1375 | 1434 |
|
1376 |
| - |
1377 | 1435 | \rSec1[rand]{Random number generation}
|
1378 | 1436 |
|
1379 | 1437 | \indextext{random number generation|(}%
|
|
0 commit comments