Skip to content
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

[utilities,containers] Harmonize presentation of tuple_element. #2868

Merged
merged 1 commit into from May 3, 2019

Conversation

jensmaurer
Copy link
Member

Fixes #2786.

@jensmaurer jensmaurer requested a review from jwakely May 3, 2019 20:46
@JohelEGP
Copy link
Contributor

JohelEGP commented May 3, 2019

Per

draft/source/utilities.tex

Lines 1169 to 1176 in c2e1df0

\rSec3[tuple.cnstr]{Construction}
\pnum
In the descriptions that follow, let $i$ be in the range
\range{0}{sizeof...(Types)} in order, $\tcode{T}_i$
be the $i^\text{th}$ type in \tcode{Types}, and
$\tcode{U}_i$ be the $i^\text{th}$ type in a template parameter pack named \tcode{UTypes}, where indexing
is zero-based.

the pseudo-code as actual-code TI in

draft/source/utilities.tex

Lines 1800 to 1817 in c2e1df0

\indexlibrary{\idxcode{tuple_element}}%
\begin{itemdecl}
template<size_t I, class... Types>
struct tuple_element<I, tuple<Types...>> {
using type = TI;
};
\end{itemdecl}
\begin{itemdescr}
\pnum
\requires \tcode{I < sizeof...(Types)}.
The program is ill-formed if \tcode{I} is out of bounds.
\pnum
\ctype \tcode{TI} is the
type of the $\tcode{I}^\text{th}$ element of \tcode{Types},
where indexing is zero-based.
\end{itemdescr}

could be replaced with $\tcode{T}_i$. Then the Type: element could be removed. A back-reference to [tuple.cnstr]p1 would be useful then.

@jensmaurer
Copy link
Member Author

jensmaurer commented May 3, 2019

We would need to write $\tcode{T}_\tcode{i}$ (note capital I).I'm not sure this is close enough to $\tcode{T}_i$ for users to make the connection to the template parameter without further explanations.

I'll apply the patch as-is; I think it's a net improvement. If the TI is still bothering someone, we can improve that in another iteration.

@jensmaurer jensmaurer merged commit 7ac32d9 into cplusplus:master May 3, 2019
@jensmaurer jensmaurer deleted the c2 branch May 3, 2019 22:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

fix presentation of tuple_element specializations
3 participants