[libcxx-commits] [PATCH] D108855: [libcxx] contiguous iterator concept: don't require pointer or complete element types
Joe Loser via Phabricator via libcxx-commits
libcxx-commits at lists.llvm.org
Sat Aug 28 20:41:20 PDT 2021
jloser added inline comments.
================
Comment at: libcxx/test/std/iterators/iterator.requirements/iterator.concepts/iterator.concept.random.access/contiguous_iterator.compile.pass.cpp:106-107
typedef std::ptrdiff_t difference_type;
typedef int* pointer;
typedef short& reference;
typedef wrong_iter_reference_t self;
----------------
Quuxplusone wrote:
> This type is misnamed or misimplemented. It's called `wrong_iter_reference_t`, but actually its `reference` type is correct; it's the `pointer` type that is "wrong."
> I suggest changing it to have
> ```
> typedef short element_type;
> typedef short* pointer;
> typedef int* reference;
> ```
> so that the name can remain the same. However, please check whether there's already another test case in this file for the wrong-reference-type case.
Valid point; just changed it so the type's `reference` type is the "wrong" one so its name matches reality.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D108855/new/
https://reviews.llvm.org/D108855
More information about the libcxx-commits
mailing list