You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Effects: Initializes end_ with ranges::end(parent).
ranges::end(parent) should probably be ranges::end(parent.base_).
The design of sentinel's constructor seems to be unnecessarily inconsistent among range adaptors.
filter_view::sentinel ([range.filter.sentinel]) and join_view::sentinel ([range.join.sentinel]) have constructors that accept a reference to parent type, and call ranges::end inside that constructor. The parents simply pass *this as sentinel constructor argument in end().
transform_view::sentinel ([range.transform.sentinel]) and take_view::sentinel ([range.take.sentinel]) have constructors that accept a sentinel_t<Base>, the parents pass ranges::end(base_) as sentinel constructor argument in end().
The text was updated successfully, but these errors were encountered:
cpplearner
changed the title
filter_view::sentinel's single-parameter constructor seems wrong
[range.filter.sentinel]filter_view::sentinel's single-parameter constructor seems wrong
May 13, 2019
Nevermind 2. I think I understand now. The difference is because the iterators of filter_view and join_view use ranges::end(parent_->base_), which only makes sense when the sentinels hold the same value.
@CaseyCarter , do you have an opinion on the first item above?
Yes, the spec is completely bogus: either the specified initialization is ill-formed, or the resulting program will overflow its stack recursing between this constructor and filter_view::end.
I've submitted a PR with the editorial-ish fix; feel free to assign this issue to me.
[range.filter.sentinel]:
ranges::end(parent)
should probably beranges::end(parent.base_)
.The design of sentinel's constructor seems to be unnecessarily inconsistent among range adaptors.
filter_view::sentinel
([range.filter.sentinel]) andjoin_view::sentinel
([range.join.sentinel]) have constructors that accept a reference to parent type, and callranges::end
inside that constructor. The parents simply pass*this
as sentinel constructor argument inend()
.transform_view::sentinel
([range.transform.sentinel]) andtake_view::sentinel
([range.take.sentinel]) have constructors that accept asentinel_t<Base>
, the parents passranges::end(base_)
as sentinel constructor argument inend()
.The text was updated successfully, but these errors were encountered: