[all-commits] [llvm/llvm-project] c63a29: [libc][cpp] reverse_iterator support (#85702)

Nick Desaulniers via All-commits all-commits at lists.llvm.org
Tue Mar 19 09:26:19 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: c63a291c64852a086cb447c7078e5312aac1a05c
      https://github.com/llvm/llvm-project/commit/c63a291c64852a086cb447c7078e5312aac1a05c
  Author: Nick Desaulniers <nickdesaulniers at users.noreply.github.com>
  Date:   2024-03-19 (Tue, 19 Mar 2024)

  Changed paths:
    M libc/src/__support/CPP/array.h
    A libc/src/__support/CPP/iterator.h
    M libc/test/src/__support/CPP/CMakeLists.txt
    A libc/test/src/__support/CPP/array_test.cpp

  Log Message:
  -----------
  [libc][cpp] reverse_iterator support (#85702)

Towards the goal of implementing __cxa_finalize (#85651) I'd like to be able to
reverse iterate over cpp::arrays such as the one used in FixedVector.

Implement the enough iterator support to be able to iterate a cpp::array in
reverse, and add tests.

Of note, reverse iterator's begin() refers to forward iterator's end() (and
vice versa). When dereferenced (operator*), the reverse iterator returns a copy
that's been pre-decremented (the underlying forward iterator is advanced).



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list