|
901 | 901 | Unless otherwise specified,
|
902 | 902 | the requirements on freestanding items for a freestanding implementation
|
903 | 903 | are the same as the corresponding requirements for a hosted implementation,
|
904 |
| -except that not all of the members of the namespaces are required to be present. |
| 904 | +except that not all of the members of those items are required to be present. |
| 905 | + |
| 906 | +\pnum |
| 907 | +Function declarations and function template declarations |
| 908 | +followed by a comment that include \textit{freestanding-deleted} are |
| 909 | +\defnadjx{freestanding deleted}{functions}{function}. |
| 910 | +On freestanding implementations, |
| 911 | +it is \impldef{whether a freestanding deleted function is a deleted function} |
| 912 | +whether each entity introduced by a freestanding deleted function |
| 913 | +is a deleted function\iref{dcl.fct.def.delete} or |
| 914 | +whether the requirements are the same as |
| 915 | +the corresponding requirements for a hosted implementation. |
905 | 916 | \begin{note}
|
906 |
| -This implies that freestanding item enumerations have the same enumerators on |
907 |
| -freestanding implementations and hosted implementations. |
908 |
| -Furthermore, class types have the same members and |
909 |
| -class templates have the same deduction guides |
910 |
| -on freestanding implementations and hosted implementations. |
| 917 | +Deleted definitions reduce the chance of overload resolution silently changing |
| 918 | +when migrating from a freestanding implementation to a hosted implementation. |
911 | 919 | \end{note}
|
| 920 | +\begin{example} |
| 921 | +\begin{codeblock} |
| 922 | +double abs(double j); // freestanding-deleted |
| 923 | +\end{codeblock} |
| 924 | +\end{example} |
912 | 925 |
|
913 | 926 | \pnum
|
914 | 927 | \indextext{declaration!freestanding item}%
|
915 |
| -A declaration in a header synopsis is a freestanding item if |
| 928 | +A declaration in a synopsis is a freestanding item if |
916 | 929 | \begin{itemize}
|
917 |
| -\item it is followed by a comment that includes \textit{freestanding}, or |
918 |
| -\item the header synopsis begins with a comment that includes \textit{all freestanding}. |
| 930 | +\item it is followed by a comment that includes \textit{freestanding}, |
| 931 | +\item it is followed by a comment that includes \textit{freestanding-deleted}, or |
| 932 | +\item the header synopsis begins with a comment |
| 933 | +that includes \textit{freestanding} and |
| 934 | +the declaration is not followed by a comment that includes \textit{hosted}. |
| 935 | +\begin{note} |
| 936 | +Declarations followed by \textit{hosted} in freestanding headers are |
| 937 | +not freestanding items. |
| 938 | +As a result, looking up the name of such functions can vary |
| 939 | +between hosted and freestanding implementations. |
| 940 | +\end{note} |
919 | 941 | \end{itemize}
|
| 942 | +\begin{example} |
| 943 | +\begin{codeblock} |
| 944 | +// all freestanding |
| 945 | +namespace std { |
| 946 | +\end{codeblock} |
| 947 | +\end{example} |
920 | 948 |
|
921 | 949 | \pnum
|
922 | 950 | \indextext{entity!freestanding item}%
|
| 951 | +\indextext{deduction guide!freestanding item}% |
923 | 952 | \indextext{\idxgram{typedef-name}!freestanding item}%
|
924 |
| -An entity or \grammarterm{typedef-name} is a freestanding item if it is: |
| 953 | +An entity, deduction guide, or \grammarterm{typedef-name} is |
| 954 | +a freestanding item if it is: |
925 | 955 | \begin{itemize}
|
926 | 956 | \item introduced by a declaration that is a freestanding item,
|
| 957 | +\item a member of a freestanding item other than a namespace, |
| 958 | +\item an enumerator of a freestanding item, |
| 959 | +\item a deduction guide of a freestanding item, |
927 | 960 | \item an enclosing namespace of a freestanding item,
|
928 | 961 | \item a friend of a freestanding item,
|
929 | 962 | \item denoted by a \grammarterm{typedef-name} that is a freestanding item, or
|
|
934 | 967 | \indextext{macro!freestanding item}%
|
935 | 968 | A macro is a freestanding item if it is defined in a header synopsis and
|
936 | 969 | \begin{itemize}
|
937 |
| -\item the definition is followed by a comment that includes \textit{freestanding}, or |
938 |
| -\item the header synopsis begins with a comment that includes \textit{all freestanding}. |
| 970 | +\item the definition is followed by a comment |
| 971 | +that includes \textit{freestanding}, or |
| 972 | +\item the header synopsis begins with a comment |
| 973 | +that includes \textit{freestanding} and |
| 974 | +the definition is not followed by a comment that includes \textit{hosted}. |
939 | 975 | \end{itemize}
|
940 |
| - |
941 |
| -\pnum |
942 | 976 | \begin{example}
|
943 | 977 | \begin{codeblock}
|
944 | 978 | #define NULL @\seebelow@ // freestanding
|
945 | 979 | \end{codeblock}
|
946 | 980 | \end{example}
|
947 | 981 |
|
948 |
| -\begin{example} |
949 |
| -\begin{codeblock} |
950 |
| -// all freestanding |
951 |
| -namespace std { |
952 |
| -\end{codeblock} |
953 |
| -\end{example} |
954 |
| - |
955 | 982 | \pnum
|
956 |
| -Function declarations and function template declarations |
957 |
| -followed by a comment that include \textit{freestanding-deleted} are |
958 |
| -\defnadjx{freestanding deleted}{functions}{function}. |
959 |
| -On freestanding implementations, |
960 |
| -it is \impldef{whether a freestanding deleted function is a freestanding item or a deleted function} |
961 |
| -whether each function definition introduced by a freestanding deleted function |
962 |
| -is a freestanding item or a deleted function\iref{dcl.fct.def.delete}. |
| 983 | +\begin{note} |
| 984 | +Freestanding annotations follow some additional exposition conventions |
| 985 | +that do not impose any additional normative requirements. |
| 986 | +Header synopses that begin with a comment containing "all freestanding" |
| 987 | +contain no hosted items and no freestanding deleted functions. |
| 988 | +Header synopses that begin with a comment containing "mostly freestanding" |
| 989 | +contain at least one hosted item or freestanding deleted function. |
| 990 | +Classes and class templates followed by a comment |
| 991 | +containing "partially freestanding" |
| 992 | +contain at least one hosted item or freestanding deleted function. |
| 993 | +\end{note} |
963 | 994 | \begin{example}
|
964 | 995 | \begin{codeblock}
|
965 |
| -double abs(double j); // freestanding-deleted |
| 996 | +template<class T, size_t N> struct array; // partially freestanding |
| 997 | +template<class T, size_t N> |
| 998 | +struct array { |
| 999 | + constexpr reference operator[](size_type n); |
| 1000 | + constexpr const_reference operator[](size_type n) const; |
| 1001 | + constexpr reference at(size_type n); // freestanding-deleted |
| 1002 | + constexpr const_reference at(size_type n) const; // freestanding-deleted |
| 1003 | +}; |
966 | 1004 | \end{codeblock}
|
967 | 1005 | \end{example}
|
968 | 1006 |
|
|
1485 | 1523 | \ref{ratio} & Compile-time rational arithmetic & \tcode{<ratio>} \\ \rowsep
|
1486 | 1524 | \ref{utility} & Utility components & \tcode{<utility>} \\ \rowsep
|
1487 | 1525 | \ref{tuple} & Tuples & \tcode{<tuple>} \\ \rowsep
|
| 1526 | +\ref{optional} & Optional objects & \tcode{<optional>} \\ \rowsep |
| 1527 | +\ref{variant} & Variants & \tcode{<variant>} \\ \rowsep |
1488 | 1528 | \ref{function.objects} & Function objects & \tcode{<functional>} \\ \rowsep
|
1489 | 1529 | \ref{charconv} & Primitive numeric conversions & \tcode{<charconv>} \\ \rowsep
|
1490 | 1530 | \ref{bit} & Bit manipulation & \tcode{<bit>} \\ \rowsep
|
| 1531 | +\ref{string.view} & String view classes & \tcode{<string_view>} \\ \rowsep |
1491 | 1532 | \ref{string.classes} & String classes & \tcode{<string>} \\ \rowsep
|
1492 | 1533 | \ref{c.strings} & Null-terminated sequence utilities & \tcode{<cstring>}, \tcode{<cwchar>} \\ \rowsep
|
| 1534 | +\ref{array} & Class template \tcode{array} & \tcode{<array>} \\ \rowsep |
1493 | 1535 | \ref{iterators} & Iterators library & \tcode{<iterator>} \\ \rowsep
|
1494 | 1536 | \ref{ranges} & Ranges library & \tcode{<ranges>} \\ \rowsep
|
1495 |
| -\ref{algorithms} & Algorithms library & \tcode{<numeric>} \\ \rowsep |
| 1537 | +\ref{algorithms} & Algorithms library & \tcode{<algorithm>}, \tcode{<numeric>} \\ \rowsep |
1496 | 1538 | \ref{c.math} & Mathematical functions for floating-point types & \tcode{<cmath>} \\ \rowsep
|
1497 | 1539 | \ref{atomics} & Atomics & \tcode{<atomic>} \\ \rowsep
|
1498 | 1540 | \end{libsumtab}
|
|
0 commit comments