public inbox for libstdc++-cvs@sourceware.org
help / color / mirror / Atom feed
From: Aldy Hernandez <aldyh@gcc.gnu.org>
To: gcc-cvs@gcc.gnu.org, libstdc++-cvs@gcc.gnu.org
Subject: [gcc/devel/ranger] libstdc++: make common_iterator<I, S> require copyable<I> (LWG 3385)
Date: Wed, 17 Jun 2020 19:02:31 +0000 (GMT)	[thread overview]
Message-ID: <20200617190231.F3CE23959C69@sourceware.org> (raw)

https://gcc.gnu.org/g:1b425f3ac516f7250e9f7eac7cd4fe0908ccfa4e

commit 1b425f3ac516f7250e9f7eac7cd4fe0908ccfa4e
Author: Jonathan Wakely <jwakely@redhat.com>
Date:   Wed Feb 19 21:56:29 2020 +0000

    libstdc++: make common_iterator<I, S> require copyable<I> (LWG 3385)
    
            * include/bits/stl_iterator.h (common_iterator): Add copyable<I>
            requirement (LWG 3385).
            * testsuite/24_iterators/headers/iterator/synopsis_c++20.cc: Adjust
            expected declaration.

Diff:
---
 libstdc++-v3/ChangeLog                                               | 5 +++++
 libstdc++-v3/include/bits/stl_iterator.h                             | 2 +-
 .../testsuite/24_iterators/headers/iterator/synopsis_c++20.cc        | 2 +-
 3 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog
index ef91b80ef45..7f3f8876957 100644
--- a/libstdc++-v3/ChangeLog
+++ b/libstdc++-v3/ChangeLog
@@ -1,5 +1,10 @@
 2020-02-19  Jonathan Wakely  <jwakely@redhat.com>
 
+	* include/bits/stl_iterator.h (common_iterator): Add copyable<I>
+	requirement (LWG 3385).
+	* testsuite/24_iterators/headers/iterator/synopsis_c++20.cc: Adjust
+	expected declaration.
+
 	* include/std/ranges (take_while_view, drop_view, drop_while_view)
 	(elements_view:_Iterator): Initialize data members (LWG 3364).
 
diff --git a/libstdc++-v3/include/bits/stl_iterator.h b/libstdc++-v3/include/bits/stl_iterator.h
index fc9d442b475..372df223113 100644
--- a/libstdc++-v3/include/bits/stl_iterator.h
+++ b/libstdc++-v3/include/bits/stl_iterator.h
@@ -1426,7 +1426,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
 
   /// An iterator/sentinel adaptor for representing a non-common range.
   template<input_or_output_iterator _It, sentinel_for<_It> _Sent>
-    requires (!same_as<_It, _Sent>)
+    requires (!same_as<_It, _Sent>) && copyable<_It>
   class common_iterator
   {
     template<typename _Tp, typename _Up>
diff --git a/libstdc++-v3/testsuite/24_iterators/headers/iterator/synopsis_c++20.cc b/libstdc++-v3/testsuite/24_iterators/headers/iterator/synopsis_c++20.cc
index 4d8eca31d38..fbe116be2fd 100644
--- a/libstdc++-v3/testsuite/24_iterators/headers/iterator/synopsis_c++20.cc
+++ b/libstdc++-v3/testsuite/24_iterators/headers/iterator/synopsis_c++20.cc
@@ -56,7 +56,7 @@ namespace std
   template<semiregular S> class move_sentinel;
 
   template<input_or_output_iterator I, sentinel_for<I> S>
-    requires (!same_as<I, S>)
+    requires (!same_as<I, S>) && copyable<I>
     class common_iterator;
 
   template<class I, class S>


                 reply	other threads:[~2020-06-17 19:02 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20200617190231.F3CE23959C69@sourceware.org \
    --to=aldyh@gcc.gnu.org \
    --cc=gcc-cvs@gcc.gnu.org \
    --cc=libstdc++-cvs@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).