From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1984) id 131C3398E409; Fri, 17 Jul 2020 12:48:25 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 131C3398E409 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1594990105; bh=rsuIxQk/aUw+Q+sM5TtgzWOQuH/jYH0CQgmitNl89yY=; h=From:To:Subject:Date:From; b=BtaKUT6jwo4Iyh8q7wxti8mFd7OrXtZBZyCpm57tBn2IUrpcaPlzHPvAHaFDG8fZW r1XdqFC2loEvFyVcqeZib7sWg3Cl4vsn9jZPyro6ZLBGO9D7kHKIEFJGIGV6yWc9FB gx7O3QVz7Up8dktR9R45pZQSs04ACHvKcvGqn43M= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Tamar Christina To: gcc-cvs@gcc.gnu.org, libstdc++-cvs@gcc.gnu.org Subject: [gcc(refs/vendors/ARM/heads/arm-perf-staging)] libstdc++: Apply the move_iterator changes described in P1207R4 X-Act-Checkin: gcc X-Git-Author: Patrick Palka X-Git-Refname: refs/vendors/ARM/heads/arm-perf-staging X-Git-Oldrev: 3ef39186b61939da7c658561b97f04b62973bf92 X-Git-Newrev: 7db12d155ddf4b5d7a5e783a97995f85e19e88dd Message-Id: <20200717124825.131C3398E409@sourceware.org> Date: Fri, 17 Jul 2020 12:48:25 +0000 (GMT) X-BeenThere: libstdc++-cvs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libstdc++-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Jul 2020 12:48:25 -0000 https://gcc.gnu.org/g:7db12d155ddf4b5d7a5e783a97995f85e19e88dd commit 7db12d155ddf4b5d7a5e783a97995f85e19e88dd Author: Patrick Palka Date: Wed Jan 22 16:51:19 2020 -0500 libstdc++: Apply the move_iterator changes described in P1207R4 These changes are needed for some of the tests in the constrained algorithm patch, because they use move_iterator with an uncopyable output_iterator. The other changes described in the paper are already applied, it seems. libstdc++-v3/ChangeLog: * include/bits/stl_iterator.h (move_iterator::move_iterator): Move __i when initializing _M_current. (move_iterator::base): Split into two overloads differing in ref-qualifiers as in P1207R4 for C++20. Diff: --- libstdc++-v3/ChangeLog | 7 +++++++ libstdc++-v3/include/bits/stl_iterator.h | 15 ++++++++++++++- 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index d925a0b3de8..b54f1f694e4 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,10 @@ +2020-02-05 Patrick Palka + + * include/bits/stl_iterator.h (move_iterator::move_iterator): Move __i + when initializing _M_current. + (move_iterator::base): Split into two overloads differing in + ref-qualifiers as in P1207R4 for C++20. + 2020-02-04 Jonathan Wakely * include/std/functional (_GLIBCXX_NOT_FN_CALL_OP): Un-define after diff --git a/libstdc++-v3/include/bits/stl_iterator.h b/libstdc++-v3/include/bits/stl_iterator.h index 784d200d22f..c200f7a9d14 100644 --- a/libstdc++-v3/include/bits/stl_iterator.h +++ b/libstdc++-v3/include/bits/stl_iterator.h @@ -1166,16 +1166,29 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION explicit _GLIBCXX17_CONSTEXPR move_iterator(iterator_type __i) - : _M_current(__i) { } + : _M_current(std::move(__i)) { } template _GLIBCXX17_CONSTEXPR move_iterator(const move_iterator<_Iter>& __i) : _M_current(__i.base()) { } +#if __cplusplus <= 201703L _GLIBCXX17_CONSTEXPR iterator_type base() const { return _M_current; } +#else + constexpr iterator_type + base() const & +#if __cpp_lib_concepts + requires copy_constructible +#endif + { return _M_current; } + + constexpr iterator_type + base() && + { return std::move(_M_current); } +#endif _GLIBCXX17_CONSTEXPR reference operator*() const