From: Patrick Palka <ppalka@redhat.com>
To: Tim Song <t.canens.cpp@gmail.com>
Cc: Patrick Palka <ppalka@redhat.com>,
gcc-patches <gcc-patches@gcc.gnu.org>,
libstdc++ <libstdc++@gcc.gnu.org>
Subject: Re: [PATCH] libstdc++: Avoid hard error in ranges::unique_copy [PR100770]
Date: Wed, 26 May 2021 14:43:32 -0400 (EDT) [thread overview]
Message-ID: <c5f961df-d2ee-b83b-735c-28939285fcc@idea> (raw)
In-Reply-To: <CAPQZVxuOwjP498ZN8CkYBSGS2pVVdE0E6JuQBoZ0KKV=nqs6OQ@mail.gmail.com>
On Wed, 26 May 2021, Tim Song wrote:
> I noticed that output_iterator_wrapper still has a (non-void)
> value_type. Perhaps we can get better coverage if it doesn't have one?
> The existing tests should have caught this case with that change, at least.
Good point, and I guess it should be fine to make its pointer and
reference void as well. I'm testing:
--- a/libstdc++-v3/testsuite/util/testsuite_iterators.h
+++ b/libstdc++-v3/testsuite/util/testsuite_iterators.h
@@ -122,7 +122,7 @@ namespace __gnu_test
*/
template<class T>
struct output_iterator_wrapper
- : public std::iterator<std::output_iterator_tag, T, std::ptrdiff_t, T*, T&>
+ : public std::iterator<std::output_iterator_tag, void, std::ptrdiff_t, void, void>
{
protected:
output_iterator_wrapper() : ptr(0), SharedInfo(0)
>
> On Wed, May 26, 2021 at 12:00 PM Patrick Palka via Libstdc++
> <libstdc++@gcc.gnu.org> wrote:
> >
> > - else if constexpr (input_iterator<_Out>
> > - && same_as<iter_value_t<_Iter>, iter_value_t<_Out>>)
> > + else if constexpr (requires { requires (input_iterator<_Out>
> > + && same_as<iter_value_t<_Iter>,
> > + iter_value_t<_Out>>); })
>
> It's arguably cleaner to extract this into a concept which can then
> also be used in the constraint.
Sounds good, though I'm not sure what name to give to this relatively
ad-hoc set of requirements. Any suggestions? :)
next prev parent reply other threads:[~2021-05-26 18:43 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-05-26 16:45 Patrick Palka
2021-05-26 17:27 ` Tim Song
2021-05-26 18:43 ` Patrick Palka [this message]
2021-05-26 19:07 ` Tim Song
2021-05-27 13:50 ` Patrick Palka
2021-06-03 11:54 ` Jonathan Wakely
2021-05-26 19:55 ` Jonathan Wakely
2021-05-27 0:38 ` Tim Song
2021-05-26 17:28 ` 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=c5f961df-d2ee-b83b-735c-28939285fcc@idea \
--to=ppalka@redhat.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=libstdc++@gcc.gnu.org \
--cc=t.canens.cpp@gmail.com \
/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).