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
[variant.variant],[variant.ctor] - clarifying the meaning of Ti #4789
Conversation
We preface some of the sections with "In the descriptions that follow, let i be in the range [0, sizeof...(Types)), and Ti be the ith type in Types.", but we do not do this for all the sections that use Ti. Similarly, there is another place where we use TI, but do not elaborate on what it means.
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 commit needs to be prefixed with [variant.variant], according to https://github.com/cplusplus/draft/wiki/Commit-message-format#editorial-commits.
The variant(in_place_index)
overload also uses T
I
without defining it.
source/utilities.tex
Outdated
@@ -4109,12 +4109,12 @@ | |||
A program that instantiates the definition of \tcode{variant} with | |||
no template arguments is ill-formed. | |||
|
|||
\rSec3[variant.ctor]{Constructors} | |||
|
|||
\pnum | |||
In the descriptions that follow, let $i$ be in the range \range{0}{sizeof...(Types)}, |
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.
In the descriptions that follow, let $i$ be in the range \range{0}{sizeof...(Types)}, | |
In the descriptions that of \ref{variant}, let $i$ be in the range \range{0}{sizeof...(Types)}, |
[variant.variant] is not enough. [variant.relops] and [variant.specalg], which come after it, says "for all i" without defining i. This suggestion would have it defined.
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.
perhaps
"In the descriptions that of \ref{variant}, let
?
Also, if we make this change, do we need the other suggested change ? This should cover that section too.
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.
perhaps
"In the descriptionsthatof \ref{variant}, let$i$ be in the range \range{0}{sizeof...(Types)},"
?
Definitely!
Also, if we make this change, do we need the other suggested change ? This should cover that section too.
Which change are you talking about? I mentioned everything else because I don't think this would cover it.
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 other change in this pull request in [variant.helper] that elaborates on TI in variant_alternative. I believe your suggestion clarifies what TI means there too. On the other hand, "The Ith element of Types, where indexing is zero-based." reads much better than "The type TI". What do you think ?
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.
I think this is defining i and T
i specifically, and thus don't cover what I
and T
I
might mean.
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.
review comments applied
Co-authored-by: Johel Ernesto Guerrero Peña <johelegp@gmail.com>
@@ -4880,7 +4880,7 @@ | |||
|
|||
\pnum | |||
\ctype | |||
The type $\tcode{T}_I$. | |||
The $\tcode{I}^\text{th}$ element of \tcode{Types}, where indexing is zero-based. |
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.
Why is this better than the original, given that you now have a widely usable definition of T_i available? Maybe the original should also use code font for I
.
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.
Probably due to what I said in #4789 (comment), but I was wrong there. [variant] also uses Tj and TI (without code font I
), so I suggest this:
The $\tcode{I}^\text{th}$ element of \tcode{Types}, where indexing is zero-based. | |
$\tcode{T}_I$. |
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's basically the status quo, isn't it?
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.
You're right.
I'm a bit lost what's being improved by this change. Please feel free to reopen with new information (and see the discussion above). |
So the first paragraph of [variant.ctor] is moved to the last paragraph of [variant.variant.general], and is modified to apply to [variant]. |
We preface some of the sections with "In the descriptions that follow, let i be in the range [0, sizeof...(Types)), and Ti be the ith type in Types.", but we do not do this for all the sections that use Ti. Similarly, there is another place where we use TI, but do not elaborate on what it means.