-
Notifications
You must be signed in to change notification settings - Fork 769
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
[tuple.creation] Simplify the introductory notation, and then use notation that matches the introduction. #1251
Conversation
If you like this general direction, I could rephrase |
@jwakely: I'd appreciate your feedback. |
Seems like an improvement to me. |
@tkoeppe: We have merge conflicts here. |
Yes, I think this is an improvement. I'm not keen on putting "where indexing is zero-based" in parentheses though, I preferred the original form. |
@jwakely: Yes, I agree, I'll unparenthesize that. |
@jwakely: Done. |
@@ -2047,7 +2040,7 @@ | |||
\indexlibrary{\idxcode{tuple_cat}} | |||
\begin{itemdecl} | |||
template <class... Tuples> | |||
constexpr tuple<@\placeholder{CTypes}@...> tuple_cat(Tuples&&... tpls); | |||
constexpr tuple<CTypes...> tuple_cat(Tuples&&... tpls); | |||
\end{itemdecl} | |||
|
|||
\begin{itemdescr} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The following description uses italic teletype T
_i for elements of Tuples
, which seems inconsistent with the changes made above.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@zygoloid: I hadn't revised tuple_cat
at all, and that was still the original formatting. I've now added a complete review of this description to the PR.
parameter in the function parameter pack \tcode{tpls}, where all indexing is | ||
zero-based. | ||
|
||
\pnum | ||
\requires For all $i$, $\tcode{U}_i$ shall be the type | ||
$\cv_i$ \tcode{tuple<$Args_i...$>}, where $\cv_i$ is the (possibly empty) $i^{th}$ | ||
cv-qualifier-seq and $Args_i$ is the parameter pack representing the element | ||
types in $\tcode{U}_i$. Let ${A_{ik}}$ be the ${k_i}^{th}$ type in $Args_i$. For all |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please note that "k_i^th type" doesn't make sense - it should be "k^th type".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While I agree, I'm also happier leaving that alone for now as you have done. I think using k_i
is merely confusing rather than wrong.
@@ -2047,39 +2040,44 @@ | |||
\indexlibrary{\idxcode{tuple_cat}} | |||
\begin{itemdecl} | |||
template <class... Tuples> | |||
constexpr tuple<@\placeholder{CTypes}@...> tuple_cat(Tuples&&... tpls); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CTypes
is still italicized in the synopsis. (Likewise for make_tuple
.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ahh, yes; I change the synopsis to match all the changes in this section.
source/utilities.tex
Outdated
\tcode{is_constructible_v<$A_{ik}$, $cv_i$ $A_{ik}$\&> == true}, otherwise | ||
\tcode{is_constructible_v<$A_{ik}$, $cv_i A_{ik}$\&\&> == true}. | ||
$\cv_i$ \tcode{tuple<$\tcode{Args}_i$...>}, where $\cv_i$ is the (possibly empty) $i^\text{th}$ | ||
cv-qualifier-seq and $\tcode{Args}_i$ is the parameter pack representing the element |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
\grammarterm for cv-qualifier-seq
, please.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
... but that doesn't make sense, since there is no such grammar element here. Perhaps it means that $\cv_i$ are the cv-qualifiers of $\tcode{T}_i$
, but I'm not really sure. Let's make the formatting fix to italicize the grammar term cv-qualifier-seq here and file an LWG issue asking for this description to be revisited.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, that's already applied then.
source/utilities.tex
Outdated
$\tcode{A}_{ik}$ the following requirements shall be satisfied: | ||
\begin{itemize} | ||
\item If $\tcode{T}_i$ is deduced as an lvalue reference type, then | ||
\tcode{is_constructible_v<$A_{ik}$, $cv_i\;A_{ik}$\&> == true}, otherwise |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing tcode for A here and on the line below.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
…ation that matches the introduction.
Here is a slight simplification of [tuple.creation]. I bugged me that the introduction was defining things that were only tangentially useful. I changed it to introduce the concept of indexing into a pack only once, and I used the "variable-pack" notation (e.g.
TTypes
,VTypes
) in all the functions in this subclause.I will work on
tuple_cat
separately.Before:
After: