This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: [PATCH] Simplify _Node_insert_return to avoid including <tuple>
- From: Jonathan Wakely <jwakely at redhat dot com>
- To: Tim Song <t dot canens dot cpp at gmail dot com>
- Cc: libstdc++ <libstdc++ at gcc dot gnu dot org>, gcc-patches <gcc-patches at gcc dot gnu dot org>
- Date: Fri, 3 Nov 2017 11:06:00 +0000
- Subject: Re: [PATCH] Simplify _Node_insert_return to avoid including <tuple>
- Authentication-results: sourceware.org; auth=none
- Authentication-results: ext-mx03.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com
- Authentication-results: ext-mx03.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=jwakely at redhat dot com
- Dmarc-filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 756BA6A7C6
- References: <20171027175329.GA30253@redhat.com> <CAPQZVxu7gtfx=fMwwkUpkr_DoXGp1YUGThv0FPdUuF_89UukWA@mail.gmail.com> <20171103092916.GA9153@redhat.com>
On 03/11/17 09:29 +0000, Jonathan Wakely wrote:
On 02/11/17 18:00 -0400, Tim Song wrote:
Um, why are those member get's there at all (and with an index mapping
that doesn't agree with the member order)? [container.insert.return]
says that "It has no base classes or members other than those
specified."
Because I forgot to implement https://wg21.link/p0508r0 which changed
the spec, including the order of the members.
I'll do that shortly, thanks.
Fixed by this patch, tested powerpc64le-linux, committed to trunk.
commit a13d8a5a5620bbcc44ac6d6a1065e9c5d425b629
Author: Jonathan Wakely <jwakely@redhat.com>
Date: Fri Nov 3 09:48:59 2017 +0000
Remove _Node_insert_return::get() member functions (P0508R0)
* include/bits/node_handle.h (_Node_insert_return::get): Remove, as
per P0508R0.
diff --git a/libstdc++-v3/include/bits/node_handle.h b/libstdc++-v3/include/bits/node_handle.h
index f93bfd7f686..4a830630c89 100644
--- a/libstdc++-v3/include/bits/node_handle.h
+++ b/libstdc++-v3/include/bits/node_handle.h
@@ -282,54 +282,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
_Iterator position = _Iterator();
bool inserted = false;
_NodeHandle node;
-
- template<size_t _Idx>
- decltype(auto) get() &
- {
- static_assert(_Idx < 3);
- if constexpr (_Idx == 0)
- return inserted;
- else if constexpr (_Idx == 1)
- return position;
- else if constexpr (_Idx == 2)
- return node;
- }
-
- template<size_t _Idx>
- decltype(auto) get() const &
- {
- static_assert(_Idx < 3);
- if constexpr (_Idx == 0)
- return inserted;
- else if constexpr (_Idx == 1)
- return position;
- else if constexpr (_Idx == 2)
- return node;
- }
-
- template<size_t _Idx>
- decltype(auto) get() &&
- {
- static_assert(_Idx < 3);
- if constexpr (_Idx == 0)
- return std::move(inserted);
- else if constexpr (_Idx == 1)
- return std::move(position);
- else if constexpr (_Idx == 2)
- return std::move(node);
- }
-
- template<size_t _Idx>
- decltype(auto) get() const &&
- {
- static_assert(_Idx < 3);
- if constexpr (_Idx == 0)
- return std::move(inserted);
- else if constexpr (_Idx == 1)
- return std::move(position);
- else if constexpr (_Idx == 2)
- return std::move(node);
- }
};
_GLIBCXX_END_NAMESPACE_VERSION