Skip to content

LWG3523: iota_view::sentinel is not always iota_view's sentinel #104336

Closed

Description

Activity

  1. added
    libc++libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi.
    lwg-issueCanonical version of a Library Working Group issue.
    on Aug 14, 2024
  2. frederick-vs-ja commented on Aug 28, 2024

    @frederick-vs-ja
    Contributor

    This was mostly implemented together with iota_view in LLVM 14.0 (7b20e05, https://reviews.llvm.org/D107396).

    _LIBCPP_HIDE_FROM_ABI
    constexpr iota_view(__iterator __first, __iterator __last)
    requires same_as<_Start, _Bound>
    : iota_view(_VSTD::move(__first.__value_), _VSTD::move(__last.__value_)) {}
    _LIBCPP_HIDE_FROM_ABI
    constexpr iota_view(__iterator __first, _Bound __last)
    requires same_as<_Bound, unreachable_sentinel_t>
    : iota_view(_VSTD::move(__first.__value_), _VSTD::move(__last)) {}
    _LIBCPP_HIDE_FROM_ABI
    constexpr iota_view(__iterator __first, __sentinel __last)
    requires (!same_as<_Start, _Bound> && !same_as<_Start, unreachable_sentinel_t>)
    : iota_view(_VSTD::move(__first.__value_), _VSTD::move(__last.__bound_)) {}

    But the constraints for the 3rd overload were initially incorrect and then got corrected in LLVM 17.0 (8685915, https://reviews.llvm.org/D150206).

    Now:

    _LIBCPP_HIDE_FROM_ABI constexpr _LIBCPP_EXPLICIT_SINCE_CXX23 iota_view(__iterator __first, __iterator __last)
    requires same_as<_Start, _BoundSentinel>
    : iota_view(std::move(__first.__value_), std::move(__last.__value_)) {}
    _LIBCPP_HIDE_FROM_ABI constexpr _LIBCPP_EXPLICIT_SINCE_CXX23 iota_view(__iterator __first, _BoundSentinel __last)
    requires same_as<_BoundSentinel, unreachable_sentinel_t>
    : iota_view(std::move(__first.__value_), std::move(__last)) {}
    _LIBCPP_HIDE_FROM_ABI constexpr _LIBCPP_EXPLICIT_SINCE_CXX23 iota_view(__iterator __first, __sentinel __last)
    requires(!same_as<_Start, _BoundSentinel> && !same_as<_BoundSentinel, unreachable_sentinel_t>)
    : iota_view(std::move(__first.__value_), std::move(__last.__bound_sentinel_)) {}

  3. added a commit that references this issue on Aug 28, 2024
    cc0f2d5
  4. added a commit that references this issue on Oct 7, 2026
    fc834a5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    c++23libc++libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi.lwg-issueCanonical version of a Library Working Group issue.rangesIssues related to `<ranges>`

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions