Skip to content

Commit 992feb2

Browse files
authored
Merge 2018-06 LWG Motion 13
Fixes #2131
2 parents 9df522c + e8f73e5 commit 992feb2

File tree

2 files changed

+64
-5
lines changed

2 files changed

+64
-5
lines changed

source/lib-intro.tex

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1026,6 +1026,7 @@
10261026
\tcode{<any>} \\
10271027
\tcode{<array>} \\
10281028
\tcode{<atomic>} \\
1029+
\tcode{<bit>} \\
10291030
\tcode{<bitset>} \\
10301031
\tcode{<charconv>} \\
10311032
\tcode{<chrono>} \\
@@ -1038,8 +1039,8 @@
10381039
\tcode{<exception>} \\
10391040
\tcode{<execution>} \\
10401041
\tcode{<filesystem>} \\
1041-
\tcode{<forward_list>} \\
10421042
\columnbreak
1043+
\tcode{<forward_list>} \\
10431044
\tcode{<fstream>} \\
10441045
\tcode{<functional>} \\
10451046
\tcode{<future>} \\
@@ -1056,8 +1057,8 @@
10561057
\tcode{<map>} \\
10571058
\tcode{<memory>} \\
10581059
\tcode{<memory_resource>} \\
1059-
\tcode{<mutex>} \\
10601060
\columnbreak
1061+
\tcode{<mutex>} \\
10611062
\tcode{<new>} \\
10621063
\tcode{<numeric>} \\
10631064
\tcode{<optional>} \\
@@ -1074,8 +1075,8 @@
10741075
\tcode{<stack>} \\
10751076
\tcode{<stdexcept>} \\
10761077
\tcode{<streambuf>} \\
1077-
\tcode{<string>} \\
10781078
\columnbreak
1079+
\tcode{<string>} \\
10791080
\tcode{<string_view>} \\
10801081
\tcode{<strstream>} \\
10811082
\tcode{<syncstream>} \\
@@ -1094,7 +1095,6 @@
10941095
\tcode{<version>} \\
10951096
\end{multicolfloattable}
10961097

1097-
10981098
\pnum
10991099
The facilities of the C standard library are provided in the
11001100
\indextext{library!C standard}%
@@ -1310,6 +1310,7 @@
13101310
\ref{support.initlist} & Initializer lists & \tcode{<initializer_list>} \\ \rowsep
13111311
\ref{support.runtime} & Other runtime support & \tcode{<cstdarg>} \\ \rowsep
13121312
\ref{meta} & Type traits & \tcode{<type_traits>} \\ \rowsep
1313+
\ref{bit} & Bit manipulation & \tcode{<bit>} \\ \rowsep
13131314
\ref{atomics} & Atomics & \tcode{<atomic>} \\ \rowsep
13141315
\ref{depr.cstdalign.syn}, \ref{depr.cstdbool.syn} & Deprecated headers & \tcode{<cstdalign>} \tcode{<cstdbool>} \\
13151316
\end{libsumtab}

source/numerics.tex

Lines changed: 59 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
\ref{numeric.requirements} & Requirements & \\ \rowsep
2222
\ref{cfenv} & Floating-point environment & \tcode{<cfenv>} \\ \rowsep
2323
\ref{complex.numbers} & Complex numbers & \tcode{<complex>} \\ \rowsep
24+
\ref{bit} & Bit manipulation & \tcode{<bit>} \\ \rowsep
2425
\ref{rand} & Random number generation & \tcode{<random>} \\ \rowsep
2526
\ref{numarray} & Numeric arrays & \tcode{<valarray>} \\ \rowsep
2627
\ref{numeric.ops} & Generalized numeric operations & \tcode{<numeric>} \\ \rowsep
@@ -1360,6 +1361,64 @@
13601361
\tcode{complex<float>\{0.0f, static_cast<float>(d)\}}.
13611362
\end{itemdescr}
13621363

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+
13631422
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
13641423
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
13651424
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -1373,7 +1432,6 @@
13731432
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
13741433
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
13751434

1376-
13771435
\rSec1[rand]{Random number generation}
13781436

13791437
\indextext{random number generation|(}%

0 commit comments

Comments
 (0)