On Thu, 30 Sept 2021 at 21:27, François Dumont via Libstdc++
<libstd...@gcc.gnu.org> wrote:
>
> Here is the _Safe_iterator one.
>
> Doing so I noticed that pointer_traits rebind for __normal_iterator was
> wrong and added tests on it.

Oops, thanks!

> For _Safe_iterator maybe I should specialize only when instantiated with
> __normal_iterator ? Or maybe limit to random_access_iterator_tag ?

Yes, I think that's a good idea, maybe only for __normal_iterator<T*,
C>. I think that should cover all the cases we actually need to
support.

And could you change the existing pointer_traits<__normal_iterator<I,
C>> partial specialization to only be valid for
__normal_iterator<T*,C> as well? i.e. only for __normal_iterator that
wraps a pointer (which is true for string::iterator, vector::iterator
etc.)

> Whatever the pointer_to implementation is problematic, we can only
> produce singular iterator as I did ifor now.

Hmm, yes. I think that's OK, because I don't think anybody is actually
going to use that function. What matters is that it works with
std::__to_address for C++17 mode, and that doesn't depend on
pointer_to, so it's OK if it doesn't work usefully.

Thanks!

Reply via email to