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

[variant.variant],[variant.ctor] - clarifying the meaning of Ti #4789

Closed
wants to merge 3 commits into from

Conversation

NinaRanns
Copy link
Contributor

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.

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.
Copy link
Contributor

@JohelEGP JohelEGP left a 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 TI without defining it.

source/utilities.tex Outdated Show resolved Hide resolved
@@ -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)},
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
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.

Copy link
Contributor Author

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 $i$ be in the range \range{0}{sizeof...(Types)},"
?
Also, if we make this change, do we need the other suggested change ? This should cover that section too.

Copy link
Contributor

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 $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.

Copy link
Contributor Author

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 ?

Copy link
Contributor

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 Ti specifically, and thus don't cover what I and TI might mean.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

review comments applied

@NinaRanns NinaRanns changed the title variant - clarifying the meaning of Ti [variant.variant],[variant.ctor] - clarifying the meaning of Ti Aug 3, 2021
NinaRanns and others added 2 commits August 3, 2021 21:08
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.
Copy link
Contributor

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.

Copy link
Contributor

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:

Suggested change
The $\tcode{I}^\text{th}$ element of \tcode{Types}, where indexing is zero-based.
$\tcode{T}_I$.

Copy link
Contributor

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?

Copy link
Contributor

Choose a reason for hiding this comment

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

You're right.

@tkoeppe
Copy link
Contributor

tkoeppe commented Aug 22, 2022

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).

@tkoeppe tkoeppe closed this Aug 22, 2022
@JohelEGP
Copy link
Contributor

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.

So the first paragraph of [variant.ctor] is moved to the last paragraph of [variant.variant.general], and is modified to apply to [variant].

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.

None yet

3 participants