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
[span.iterators] Specify aliases, like [string.view.iterators] does #4062
Conversation
source/containers.tex
Outdated
@@ -11236,7 +11236,10 @@ | |||
requirements\iref{random.access.iterators}, | |||
and | |||
meets the requirements for | |||
constexpr iterators\iref{iterator.requirements.general}. | |||
constexpr iterators\iref{iterator.requirements.general}, | |||
whose \tcode{value_type} is the template parameter \tcode{ElementType}. |
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.
This should be remove_cv_t<ElementType>
; value types are not cv-qualified.
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.
Thank you.
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.
Feel free to resolve these comments, @JohelEGP. I can't since I'm a happily powerless contributor here =)
source/containers.tex
Outdated
whose \tcode{value_type} is \tcode{remove_cv_t<ElementType>} and | ||
whose \tcode{reference_type} is \tcode{ElementType&}. |
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.
Since span
has nested types value_type
and reference
, why not simply use those? (i.e., whose value type is \tcode{value_type} and whose reference type is \tcode{reference}
)
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.
Excellent!
I was trying to specify what seems underspecified, which I noticed when looking at Now I'm left wondering if the |
The commit description seems broken. "specify aliases" feels misleading. And please squash all commits and force-push. |
a4070e1
to
9cee6f4
Compare
source/containers.tex
Outdated
whose \tcode{value_type} is \tcode{value_type} and | ||
whose \tcode{reference} type is \tcode{reference}. |
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.
It's not clear what entities \tcode{value_type}
and \tcode{reference}
refer to here. Presumably we mean member type aliases of iterator_traits<iterator>
, so we could say such that \tcode{iterator_traits<iterator>::value_type} is \tcode{value_type}
(and similarly for reference
) but I think it would be clearer to simply use prose "value type" and "reference type" which name those properties of iterators:
whose \tcode{value_type} is \tcode{value_type} and | |
whose \tcode{reference} type is \tcode{reference}. | |
whose value type is \tcode{value_type} and | |
whose reference type is \tcode{reference}. |
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.
Looks good, but deviates from [string.view.iterators], which uses value_type
. If the editors prefer this, I'd also like to extend the PR to [string.view.iterators] so that it also reads "value 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.
Yes, I think that would be an improvement. Having \tcode{value_type}
mean different things two words apart is not good.
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 follow Casey's suggestion.
source/containers.tex
Outdated
whose \tcode{value_type} is \tcode{value_type} and | ||
whose \tcode{reference} type is \tcode{reference}. |
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.
Yes, I think that would be an improvement. Having \tcode{value_type}
mean different things two words apart is not good.
…tring.view.iterators]
9cee6f4
to
d4832b9
Compare
Decided against my suggested change to [string.view.iterators]. |
@CaseyCarter , are you ok with this end result? |
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.
LGTM!
No description provided.