From: Jonathan Wakely <jwakely@redhat.com>
To: "François Dumont" <frs.dumont@gmail.com>
Cc: "libstdc++" <libstdc++@gcc.gnu.org>,
gcc-patches <gcc-patches@gcc.gnu.org>
Subject: Re: [committed] libstdc++: Specialize std::pointer_traits<__normal_iterator<I, C>>
Date: Sat, 2 Oct 2021 21:28:12 +0100 [thread overview]
Message-ID: <CACb0b4=yoqhypntCKKYSpfZx2yaoBwnRfJp9XBVFPrRvRz-yYg@mail.gmail.com> (raw)
In-Reply-To: <0dbec215-2a5f-5291-49d7-afea2cd611a7@gmail.com>
On Sat, 2 Oct 2021 at 14:08, François Dumont <frs.dumont@gmail.com> wrote:
>
> On 02/10/21 12:29 am, Jonathan Wakely wrote:
> > On Thu, 30 Sept 2021 at 21:27, François Dumont via Libstdc++
> > <libstdc++@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.)
>
> Is the attached patch what you had in mind ?
Yes, although I don't think we need to us __make_not_void for
to_pointer, because I don't think we would ever have
__normal_iterator<void*, C>. I don't think it will even compile,
because void* is not an iterator type, and iterator_traits<void*> is
invalid (in C++20 it's constrained with is_object_v<T> and before
C++20 it will just give an error, because void& is ill-formed).
next prev parent reply other threads:[~2021-10-02 20:28 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-09-28 19:25 [committed] libstdc++: Specialize std::pointer_traits<__normal_iterator<I,C>> Jonathan Wakely
2021-09-30 20:24 ` François Dumont
2021-10-01 22:29 ` [committed] libstdc++: Specialize std::pointer_traits<__normal_iterator<I, C>> Jonathan Wakely
2021-10-02 13:08 ` [committed] libstdc++: Specialize std::pointer_traits<__normal_iterator<I,C>> François Dumont
2021-10-02 20:28 ` Jonathan Wakely [this message]
2021-10-02 17:27 ` François Dumont
2021-10-02 20:24 ` [committed] libstdc++: Specialize std::pointer_traits<__normal_iterator<I, C>> Jonathan Wakely
2021-10-04 20:05 ` [committed] libstdc++: Specialize std::pointer_traits<__normal_iterator<I,C>> François Dumont
2021-10-04 20:26 ` François Dumont
2021-10-04 20:30 ` [committed] libstdc++: Specialize std::pointer_traits<__normal_iterator<I, C>> Jonathan Wakely
2021-10-06 17:18 ` [committed] libstdc++: Specialize std::pointer_traits<__normal_iterator<I,C>> François Dumont
2021-10-06 17:25 ` François Dumont
2021-12-14 6:53 ` François Dumont
2021-12-14 13:12 ` [committed] libstdc++: Specialize std::pointer_traits<__normal_iterator<I, C>> Jonathan Wakely
2021-12-15 21:16 ` [committed] libstdc++: Specialize std::pointer_traits<__normal_iterator<I,C>> François Dumont
2021-12-15 21:21 ` [committed] libstdc++: Specialize std::pointer_traits<__normal_iterator<I, C>> Jonathan Wakely
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CACb0b4=yoqhypntCKKYSpfZx2yaoBwnRfJp9XBVFPrRvRz-yYg@mail.gmail.com' \
--to=jwakely@redhat.com \
--cc=frs.dumont@gmail.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=libstdc++@gcc.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).