Skip to content

[lib] Excise Note A, Note B, etc. designations #7033

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 7 additions & 8 deletions source/meta.tex
Original file line number Diff line number Diff line change
Expand Up @@ -1934,8 +1934,8 @@

\tcode{template<class... T>} \tcode{struct common_type;}
&
Unless this trait is specialized (as specified in Note B, below),
the member \tcode{type} is defined or omitted as specified in Note A, below.
Unless this trait is specialized,
the member \tcode{type} is defined or omitted as specified below.
If it is omitted, there shall be no member \tcode{type}.
Each type in the template parameter pack \tcode{T} shall be
complete, \cv{}~\keyword{void}, or an array of unknown bound. \\ \rowsep
Expand All @@ -1947,14 +1947,14 @@
\keyword{struct}
\hspace*{2ex}\tcode{basic_common_reference;}
&
Unless this trait is specialized (as specified in Note D, below),
Unless this trait is specialized,
there shall be no member \tcode{type}. \\ \rowsep

\indexlibraryglobal{common_reference}%
\tcode{template<class... T>} \tcode{struct common_reference;}
&
The member \grammarterm{typedef-name} \tcode{type} is defined or omitted
as specified in Note C, below. Each type in the parameter pack \tcode{T} shall
as specified below. Each type in the parameter pack \tcode{T} shall
be complete or \cv{} \keyword{void}. \\ \rowsep

\indexlibraryglobal{underlying_type}%
Expand Down Expand Up @@ -2066,7 +2066,6 @@
\tcode{\placeholdernc{COMMON-REF}(A, B)} is ill-formed.

\pnum
Note A:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think these changes are definite improvements, I've wanted to be rid of these normative "notes" for a long time.

For the \tcode{common_type} trait applied to a template parameter pack \tcode{T} of types,
the member \tcode{type} shall be either defined or not present as follows:

Expand Down Expand Up @@ -2120,7 +2119,7 @@
\end{itemize}

\pnum
Note B: Notwithstanding the provisions of \ref{meta.type.synop}, and
Notwithstanding the provisions of \ref{meta.type.synop}, and
pursuant to \ref{namespace.std},
a program may specialize \tcode{common_type<T1, T2>}
for types \tcode{T1} and \tcode{T2} such that
Expand All @@ -2140,7 +2139,7 @@
No diagnostic is required for a violation of this Note's rules.

\pnum
Note C: For the \tcode{common_reference} trait applied to a parameter pack
For the \tcode{common_reference} trait applied to a parameter pack
\tcode{T} of types, the member \tcode{type} shall be either defined or not
present as follows:
\begin{itemize}
Expand Down Expand Up @@ -2186,7 +2185,7 @@
\end{itemize}

\pnum
Note D: Notwithstanding the provisions of \ref{meta.type.synop}, and
Notwithstanding the provisions of \ref{meta.type.synop}, and
pursuant to \ref{namespace.std}, a program may partially specialize
\tcode{basic_common_reference<T, U, TQual, UQual>}
for types \tcode{T} and \tcode{U} such that
Expand Down
12 changes: 6 additions & 6 deletions source/utilities.tex
Original file line number Diff line number Diff line change
Expand Up @@ -2840,10 +2840,10 @@
get(tuple<Types...>& t) noexcept;
template<size_t I, class... Types>
constexpr tuple_element_t<I, tuple<Types...>>&&
get(tuple<Types...>&& t) noexcept; // Note A
get(tuple<Types...>&& t) noexcept; // \#1
template<size_t I, class... Types>
constexpr const tuple_element_t<I, tuple<Types...>>&
get(const tuple<Types...>& t) noexcept; // Note B
get(const tuple<Types...>& t) noexcept; // \#2
template<size_t I, class... Types>
constexpr const tuple_element_t<I, tuple<Types...>>&& get(const tuple<Types...>&& t) noexcept;
\end{itemdecl}
Expand All @@ -2860,18 +2860,18 @@

\pnum
\begin{note}
[Note A]
If a type \tcode{T} in \tcode{Types} is some reference type \tcode{X\&},
For the overload marked \#1,
if a type \tcode{T} in \tcode{Types} is some reference type \tcode{X\&},
the return type is \tcode{X\&}, not \tcode{X\&\&}.
However, if the element type is a non-reference type \tcode{T},
the return type is \tcode{T\&\&}.
\end{note}

\pnum
\begin{note}
[Note B]
Constness is shallow.
If a type \tcode{T} in \tcode{Types} is some reference type \tcode{X\&},
For the overload marked \#2,
if a type \tcode{T} in \tcode{Types} is some reference type \tcode{X\&},
the return type is \tcode{X\&}, not \tcode{const X\&}.
However, if the element type is a non-reference type \tcode{T},
the return type is \tcode{const T\&}.
Expand Down
Loading