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

[libc++] Add support for bounded iterators in std::array #110729

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Commits on Nov 5, 2024

  1. [libc++] Add support for bounded iterators in std::array

    This patch introduces a new kind of bounded iterator that knows the
    size of its valid range at compile-time, as in std::array. This allows
    computing the end of the range from the start of the range (and the
    size) instead of storing the size (or the end of the range) in the
    iterator. The iterator wrapper is otherwise identical in design to the
    existing __bounded_iter.
    
    Since this requires changing the type of the iterators returned by
    std::array, this new bounded iterator is controlled by an ABI flag.
    
    As a drive-by, centralize the tests for std::array::operator[] and
    add missing tests for OOB operator[] on non-empty arrays.
    
    Fixes llvm#70864
    ldionne committed Nov 5, 2024
    Configuration menu
    Copy the full SHA
    1f7f99f View commit details
    Browse the repository at this point in the history
  2. Constexpr since C++14

    ldionne committed Nov 5, 2024
    Configuration menu
    Copy the full SHA
    8e8b8b9 View commit details
    Browse the repository at this point in the history