[all-commits] [llvm/llvm-project] a9bfb4: [libc++] Refactor stride_counting_iterator

Louis Dionne via All-commits all-commits at lists.llvm.org
Tue Jan 18 09:24:24 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: a9bfb4c4f48d9434918374566d5780c97a805bcc
      https://github.com/llvm/llvm-project/commit/a9bfb4c4f48d9434918374566d5780c97a805bcc
  Author: Louis Dionne <ldionne.2 at gmail.com>
  Date:   2022-01-18 (Tue, 18 Jan 2022)

  Changed paths:
    M libcxx/test/std/iterators/iterator.primitives/range.iter.ops/range.iter.ops.advance/iterator_sentinel.pass.cpp
    M libcxx/test/std/ranges/range.adaptors/range.drop/begin.pass.cpp
    M libcxx/test/support/test_iterators.h

  Log Message:
  -----------
  [libc++] Refactor stride_counting_iterator

Instead of storing the wrapped iterator inside the stride_counting_iterator,
store its base so we can have e.g. a stride_counting_iterator of an
input_iterator (which was previously impossible because input_iterators
are not copyable). Also a few other simplifications in stride_counting_iterator.

As a fly-by fix, remove the member base() functions, which are super
confusing.

Differential Revision: https://reviews.llvm.org/D116613




More information about the All-commits mailing list