Message ID | CAML+3pW_2+9XTYMWEVHDyU8BKBpQEuGTkwmYVr+dcwUtzHVgsw@mail.gmail.com |
---|---|
State | Superseded |
Headers |
Return-Path: <gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org> X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 129543858033 for <patchwork@sourceware.org>; Mon, 20 Mar 2023 02:54:01 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 129543858033 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1679280841; bh=sWLkDCM5fosUPmc8Rk2lBhJ6DLVv5LccqGLyr/3nvTs=; h=Date:Subject:To:Cc:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From:Reply-To:From; b=d+E1S6F5hE5bnW/7rp4tkNBdvKy7yk0LPVyYmFwT+319FfJwXd4wB7qExl1JY8sTt 6U4Vs09PO02Vigw7ga155V5Pcso5E+0hfpkAyWJoyG0wVhKYhBjF0EmQEy26zaxIrt It3HTzhecTLcDnK/OrOu8fOTPTa0cwka+JGkqke4= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-vs1-xe33.google.com (mail-vs1-xe33.google.com [IPv6:2607:f8b0:4864:20::e33]) by sourceware.org (Postfix) with ESMTPS id CD49D3858C53 for <gcc-patches@gcc.gnu.org>; Mon, 20 Mar 2023 02:53:31 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org CD49D3858C53 Received: by mail-vs1-xe33.google.com with SMTP id d2so3057106vso.9 for <gcc-patches@gcc.gnu.org>; Sun, 19 Mar 2023 19:53:31 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679280810; h=cc:to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=sWLkDCM5fosUPmc8Rk2lBhJ6DLVv5LccqGLyr/3nvTs=; b=R6llUzKS4CuNXUjpmg5uRTpiYRKsrFXzOhP9eN6PFJqr/N4mBd0Y0HS/uxFXEqy4i1 akKcgIXf9aySYax9d7rQyFzumykKnJKP0LCP1PKhsTswyP8Q3ccdtKNrZ4cHSo0piPAT dowsRoehkeFo9dBe4KQY+qqQVN+Twq5osNkdmfnLCpft2C7AOfrq1278ugppJFzHIlts 8uJV4Zfa0336KRLcargcBJeDaFORTnzr2e5SYPDJfpOuZE8EFURw4EYaRdzFTEzx8lXR wOD20wIKfl4V5sLHFLqF7XpdhNJ2iuoDHOBdmQqMbSFWFbFJke7UeVKfH8C4dnzhsWlq KRFQ== X-Gm-Message-State: AO0yUKVYEexSTrwdhu8EHFNmNVxnouz3KRKmVe3HtFcnsjpOkbMdRZ8s Ze7FT4tQ7W7IE3Ep8yxS54Vplj0hhRpKdV7ntOxU/Jk8ayvNq/50DG0= X-Google-Smtp-Source: AK7set/eKG61MyutKPaHSV7aJqZ+NnLIN8FZC2+9tcfg+8bL7jchRTvY5ybHWt/CDP/Ak+aNymnhhI10M+prirHRgtQ= X-Received: by 2002:a67:d289:0:b0:425:e8fe:f59b with SMTP id z9-20020a67d289000000b00425e8fef59bmr3128283vsi.6.1679280809893; Sun, 19 Mar 2023 19:53:29 -0700 (PDT) MIME-Version: 1.0 Date: Sun, 19 Mar 2023 19:53:19 -0700 Message-ID: <CAML+3pW_2+9XTYMWEVHDyU8BKBpQEuGTkwmYVr+dcwUtzHVgsw@mail.gmail.com> Subject: [PATCH] libstdc++: use new built-in trait __remove_pointer To: gcc-patches@gcc.gnu.org Cc: Patrick Palka <ppalka@redhat.com> Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-10.2 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list <gcc-patches.gcc.gnu.org> List-Unsubscribe: <https://gcc.gnu.org/mailman/options/gcc-patches>, <mailto:gcc-patches-request@gcc.gnu.org?subject=unsubscribe> List-Archive: <https://gcc.gnu.org/pipermail/gcc-patches/> List-Post: <mailto:gcc-patches@gcc.gnu.org> List-Help: <mailto:gcc-patches-request@gcc.gnu.org?subject=help> List-Subscribe: <https://gcc.gnu.org/mailman/listinfo/gcc-patches>, <mailto:gcc-patches-request@gcc.gnu.org?subject=subscribe> From: Ken Matsui via Gcc-patches <gcc-patches@gcc.gnu.org> Reply-To: Ken Matsui <kmatsui@cs.washington.edu> Errors-To: gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org Sender: "Gcc-patches" <gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org> |
Series |
libstdc++: use new built-in trait __remove_pointer
|
|
Commit Message
Ken Matsui
March 20, 2023, 2:53 a.m. UTC
libstdc++-v3/ChangeLog: * include/std/type_traits (is_reference): Use __remove_pointer built-in trait. ---
Comments
CCing libstdc++@gcc.gnu.org. On Sun, Mar 19, 2023 at 7:53 PM Ken Matsui <kmatsui@cs.washington.edu> wrote: > > libstdc++-v3/ChangeLog: > > * include/std/type_traits (is_reference): Use __remove_pointer built-in trait. > > --- > diff --git a/libstdc++-v3/include/std/type_traits > b/libstdc++-v3/include/std/type_traits > index 2bd607a8b8f..cba98091aad 100644 > --- a/libstdc++-v3/include/std/type_traits > +++ b/libstdc++-v3/include/std/type_traits > @@ -2025,17 +2025,23 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION > > template<typename _Tp, typename> > struct __remove_pointer_helper > - { typedef _Tp type; }; > + { using type = _Tp; }; > > template<typename _Tp, typename _Up> > struct __remove_pointer_helper<_Tp, _Up*> > - { typedef _Up type; }; > + { using type = _Up; }; > > /// remove_pointer > +#if __has_builtin(__remove_pointer) > + template<typename _Tp> > + struct remove_pointer > + { using type = __remove_pointer(_Tp); }; > +#else > template<typename _Tp> > struct remove_pointer > : public __remove_pointer_helper<_Tp, __remove_cv_t<_Tp>> > { }; > +#endif > > template<typename _Tp, typename = void> > struct __add_pointer_helper
On Mon, 20 Mar 2023, 07:32 Ken Matsui via Libstdc++, <libstdc++@gcc.gnu.org> wrote: > CCing libstdc++@gcc.gnu.org. > > On Sun, Mar 19, 2023 at 7:53 PM Ken Matsui <kmatsui@cs.washington.edu> > wrote: > > > > libstdc++-v3/ChangeLog: > > > > * include/std/type_traits (is_reference): Use __remove_pointer built-in > trait. > The changelog entry says is_reference but the patch is for remove_pointer. > > > --- > > diff --git a/libstdc++-v3/include/std/type_traits > > b/libstdc++-v3/include/std/type_traits > > index 2bd607a8b8f..cba98091aad 100644 > > --- a/libstdc++-v3/include/std/type_traits > > +++ b/libstdc++-v3/include/std/type_traits > > @@ -2025,17 +2025,23 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION > > > > template<typename _Tp, typename> > > struct __remove_pointer_helper > > - { typedef _Tp type; }; > > + { using type = _Tp; }; > > > > template<typename _Tp, typename _Up> > > struct __remove_pointer_helper<_Tp, _Up*> > > - { typedef _Up type; }; > > + { using type = _Up; }; > The helper doesn't need to be defined for the case where we don't use it. > > > /// remove_pointer > > +#if __has_builtin(__remove_pointer) > > + template<typename _Tp> > > + struct remove_pointer > > + { using type = __remove_pointer(_Tp); }; > > +#else > > template<typename _Tp> > > struct remove_pointer > > : public __remove_pointer_helper<_Tp, __remove_cv_t<_Tp>> > > { }; > > +#endif > > > > template<typename _Tp, typename = void> > > struct __add_pointer_helper >
Ooh... Thank you for pointing that out! > The helper doesn't need to be defined for the case where we don't use it. I thought that macroing them out leads to compiler errors since users are possibly using those helpers. But do we not have to care about that? --- libstdc++-v3/ChangeLog: * include/std/type_traits (remove_pointer): Use __remove_pointer built-in trait. --- diff --git a/libstdc++-v3/include/std/type_traits b/libstdc++-v3/include/std/type_traits index 2bd607a8b8f..cba98091aad 100644 --- a/libstdc++-v3/include/std/type_traits +++ b/libstdc++-v3/include/std/type_traits @@ -2025,17 +2025,23 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION template<typename _Tp, typename> struct __remove_pointer_helper - { typedef _Tp type; }; + { using type = _Tp; }; template<typename _Tp, typename _Up> struct __remove_pointer_helper<_Tp, _Up*> - { typedef _Up type; }; + { using type = _Up; }; /// remove_pointer +#if __has_builtin(__remove_pointer) + template<typename _Tp> + struct remove_pointer + { using type = __remove_pointer(_Tp); }; +#else template<typename _Tp> struct remove_pointer : public __remove_pointer_helper<_Tp, __remove_cv_t<_Tp>> { }; +#endif template<typename _Tp, typename = void> struct __add_pointer_helper On Mon, Mar 20, 2023 at 12:57 AM Jonathan Wakely <jwakely.gcc@gmail.com> wrote: > > > > On Mon, 20 Mar 2023, 07:32 Ken Matsui via Libstdc++, <libstdc++@gcc.gnu.org> wrote: >> >> CCing libstdc++@gcc.gnu.org. >> >> On Sun, Mar 19, 2023 at 7:53 PM Ken Matsui <kmatsui@cs.washington.edu> wrote: >> > >> > libstdc++-v3/ChangeLog: >> > >> > * include/std/type_traits (is_reference): Use __remove_pointer built-in trait. > > > The changelog entry says is_reference but the patch is for remove_pointer. > > >> > >> > --- >> > diff --git a/libstdc++-v3/include/std/type_traits >> > b/libstdc++-v3/include/std/type_traits >> > index 2bd607a8b8f..cba98091aad 100644 >> > --- a/libstdc++-v3/include/std/type_traits >> > +++ b/libstdc++-v3/include/std/type_traits >> > @@ -2025,17 +2025,23 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION >> > >> > template<typename _Tp, typename> >> > struct __remove_pointer_helper >> > - { typedef _Tp type; }; >> > + { using type = _Tp; }; >> > >> > template<typename _Tp, typename _Up> >> > struct __remove_pointer_helper<_Tp, _Up*> >> > - { typedef _Up type; }; >> > + { using type = _Up; }; > > > The helper doesn't need to be defined for the case where we don't use it. > > >> > >> > /// remove_pointer >> > +#if __has_builtin(__remove_pointer) >> > + template<typename _Tp> >> > + struct remove_pointer >> > + { using type = __remove_pointer(_Tp); }; >> > +#else >> > template<typename _Tp> >> > struct remove_pointer >> > : public __remove_pointer_helper<_Tp, __remove_cv_t<_Tp>> >> > { }; >> > +#endif >> > >> > template<typename _Tp, typename = void> >> > struct __add_pointer_helper
On Mon, 20 Mar 2023 at 08:08, Ken Matsui <kmatsui@cs.washington.edu> wrote: > > Ooh... Thank you for pointing that out! > > > The helper doesn't need to be defined for the case where we don't use it. > > I thought that macroing them out leads to compiler errors since users > are possibly using those helpers. But do we not have to care about > that? No, absolutely not. > > --- > libstdc++-v3/ChangeLog: > > * include/std/type_traits (remove_pointer): Use __remove_pointer built-in trait. > > --- > diff --git a/libstdc++-v3/include/std/type_traits > b/libstdc++-v3/include/std/type_traits > index 2bd607a8b8f..cba98091aad 100644 > --- a/libstdc++-v3/include/std/type_traits > +++ b/libstdc++-v3/include/std/type_traits > @@ -2025,17 +2025,23 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION > > template<typename _Tp, typename> > struct __remove_pointer_helper > - { typedef _Tp type; }; > + { using type = _Tp; }; > > template<typename _Tp, typename _Up> > struct __remove_pointer_helper<_Tp, _Up*> > - { typedef _Up type; }; > + { using type = _Up; }; > > /// remove_pointer > +#if __has_builtin(__remove_pointer) > + template<typename _Tp> > + struct remove_pointer > + { using type = __remove_pointer(_Tp); }; > +#else > template<typename _Tp> > struct remove_pointer > : public __remove_pointer_helper<_Tp, __remove_cv_t<_Tp>> > { }; > +#endif > > template<typename _Tp, typename = void> > struct __add_pointer_helper > > On Mon, Mar 20, 2023 at 12:57 AM Jonathan Wakely <jwakely.gcc@gmail.com> wrote: > > > > > > > > On Mon, 20 Mar 2023, 07:32 Ken Matsui via Libstdc++, <libstdc++@gcc.gnu.org> wrote: > >> > >> CCing libstdc++@gcc.gnu.org. > >> > >> On Sun, Mar 19, 2023 at 7:53 PM Ken Matsui <kmatsui@cs.washington.edu> wrote: > >> > > >> > libstdc++-v3/ChangeLog: > >> > > >> > * include/std/type_traits (is_reference): Use __remove_pointer built-in trait. > > > > > > The changelog entry says is_reference but the patch is for remove_pointer. > > > > > >> > > >> > --- > >> > diff --git a/libstdc++-v3/include/std/type_traits > >> > b/libstdc++-v3/include/std/type_traits > >> > index 2bd607a8b8f..cba98091aad 100644 > >> > --- a/libstdc++-v3/include/std/type_traits > >> > +++ b/libstdc++-v3/include/std/type_traits > >> > @@ -2025,17 +2025,23 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION > >> > > >> > template<typename _Tp, typename> > >> > struct __remove_pointer_helper > >> > - { typedef _Tp type; }; > >> > + { using type = _Tp; }; > >> > > >> > template<typename _Tp, typename _Up> > >> > struct __remove_pointer_helper<_Tp, _Up*> > >> > - { typedef _Up type; }; > >> > + { using type = _Up; }; > > > > > > The helper doesn't need to be defined for the case where we don't use it. > > > > > >> > > >> > /// remove_pointer > >> > +#if __has_builtin(__remove_pointer) > >> > + template<typename _Tp> > >> > + struct remove_pointer > >> > + { using type = __remove_pointer(_Tp); }; > >> > +#else > >> > template<typename _Tp> > >> > struct remove_pointer > >> > : public __remove_pointer_helper<_Tp, __remove_cv_t<_Tp>> > >> > { }; > >> > +#endif > >> > > >> > template<typename _Tp, typename = void> > >> > struct __add_pointer_helper
Thank you! On Mon, Mar 20, 2023 at 2:12 AM Jonathan Wakely <jwakely.gcc@gmail.com> wrote: > On Mon, 20 Mar 2023 at 08:08, Ken Matsui <kmatsui@cs.washington.edu> > wrote: > > > > Ooh... Thank you for pointing that out! > > > > > The helper doesn't need to be defined for the case where we don't use > it. > > > > I thought that macroing them out leads to compiler errors since users > > are possibly using those helpers. But do we not have to care about > > that? > > No, absolutely not. > > > > > --- > > libstdc++-v3/ChangeLog: > > > > * include/std/type_traits (remove_pointer): Use __remove_pointer > built-in trait. > > > > --- > > diff --git a/libstdc++-v3/include/std/type_traits > > b/libstdc++-v3/include/std/type_traits > > index 2bd607a8b8f..cba98091aad 100644 > > --- a/libstdc++-v3/include/std/type_traits > > +++ b/libstdc++-v3/include/std/type_traits > > @@ -2025,17 +2025,23 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION > > > > template<typename _Tp, typename> > > struct __remove_pointer_helper > > - { typedef _Tp type; }; > > + { using type = _Tp; }; > > > > template<typename _Tp, typename _Up> > > struct __remove_pointer_helper<_Tp, _Up*> > > - { typedef _Up type; }; > > + { using type = _Up; }; > > > > /// remove_pointer > > +#if __has_builtin(__remove_pointer) > > + template<typename _Tp> > > + struct remove_pointer > > + { using type = __remove_pointer(_Tp); }; > > +#else > > template<typename _Tp> > > struct remove_pointer > > : public __remove_pointer_helper<_Tp, __remove_cv_t<_Tp>> > > { }; > > +#endif > > > > template<typename _Tp, typename = void> > > struct __add_pointer_helper > > > > On Mon, Mar 20, 2023 at 12:57 AM Jonathan Wakely <jwakely.gcc@gmail.com> > wrote: > > > > > > > > > > > > On Mon, 20 Mar 2023, 07:32 Ken Matsui via Libstdc++, < > libstdc++@gcc.gnu.org> wrote: > > >> > > >> CCing libstdc++@gcc.gnu.org. > > >> > > >> On Sun, Mar 19, 2023 at 7:53 PM Ken Matsui <kmatsui@cs.washington.edu> > wrote: > > >> > > > >> > libstdc++-v3/ChangeLog: > > >> > > > >> > * include/std/type_traits (is_reference): Use __remove_pointer > built-in trait. > > > > > > > > > The changelog entry says is_reference but the patch is for > remove_pointer. > > > > > > > > >> > > > >> > --- > > >> > diff --git a/libstdc++-v3/include/std/type_traits > > >> > b/libstdc++-v3/include/std/type_traits > > >> > index 2bd607a8b8f..cba98091aad 100644 > > >> > --- a/libstdc++-v3/include/std/type_traits > > >> > +++ b/libstdc++-v3/include/std/type_traits > > >> > @@ -2025,17 +2025,23 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION > > >> > > > >> > template<typename _Tp, typename> > > >> > struct __remove_pointer_helper > > >> > - { typedef _Tp type; }; > > >> > + { using type = _Tp; }; > > >> > > > >> > template<typename _Tp, typename _Up> > > >> > struct __remove_pointer_helper<_Tp, _Up*> > > >> > - { typedef _Up type; }; > > >> > + { using type = _Up; }; > > > > > > > > > The helper doesn't need to be defined for the case where we don't use > it. > > > > > > > > >> > > > >> > /// remove_pointer > > >> > +#if __has_builtin(__remove_pointer) > > >> > + template<typename _Tp> > > >> > + struct remove_pointer > > >> > + { using type = __remove_pointer(_Tp); }; > > >> > +#else > > >> > template<typename _Tp> > > >> > struct remove_pointer > > >> > : public __remove_pointer_helper<_Tp, __remove_cv_t<_Tp>> > > >> > { }; > > >> > +#endif > > >> > > > >> > template<typename _Tp, typename = void> > > >> > struct __add_pointer_helper >
Please disregard this email. On Mon, Mar 20, 2023 at 6:26 AM Ken Matsui <kmatsui@cs.washington.edu> wrote: > Thank you! > > On Mon, Mar 20, 2023 at 2:12 AM Jonathan Wakely <jwakely.gcc@gmail.com> > wrote: > >> On Mon, 20 Mar 2023 at 08:08, Ken Matsui <kmatsui@cs.washington.edu> >> wrote: >> > >> > Ooh... Thank you for pointing that out! >> > >> > > The helper doesn't need to be defined for the case where we don't use >> it. >> > >> > I thought that macroing them out leads to compiler errors since users >> > are possibly using those helpers. But do we not have to care about >> > that? >> >> No, absolutely not. >> >> > >> > --- >> > libstdc++-v3/ChangeLog: >> > >> > * include/std/type_traits (remove_pointer): Use __remove_pointer >> built-in trait. >> > >> > --- >> > diff --git a/libstdc++-v3/include/std/type_traits >> > b/libstdc++-v3/include/std/type_traits >> > index 2bd607a8b8f..cba98091aad 100644 >> > --- a/libstdc++-v3/include/std/type_traits >> > +++ b/libstdc++-v3/include/std/type_traits >> > @@ -2025,17 +2025,23 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION >> > >> > template<typename _Tp, typename> >> > struct __remove_pointer_helper >> > - { typedef _Tp type; }; >> > + { using type = _Tp; }; >> > >> > template<typename _Tp, typename _Up> >> > struct __remove_pointer_helper<_Tp, _Up*> >> > - { typedef _Up type; }; >> > + { using type = _Up; }; >> > >> > /// remove_pointer >> > +#if __has_builtin(__remove_pointer) >> > + template<typename _Tp> >> > + struct remove_pointer >> > + { using type = __remove_pointer(_Tp); }; >> > +#else >> > template<typename _Tp> >> > struct remove_pointer >> > : public __remove_pointer_helper<_Tp, __remove_cv_t<_Tp>> >> > { }; >> > +#endif >> > >> > template<typename _Tp, typename = void> >> > struct __add_pointer_helper >> > >> > On Mon, Mar 20, 2023 at 12:57 AM Jonathan Wakely <jwakely.gcc@gmail.com> >> wrote: >> > > >> > > >> > > >> > > On Mon, 20 Mar 2023, 07:32 Ken Matsui via Libstdc++, < >> libstdc++@gcc.gnu.org> wrote: >> > >> >> > >> CCing libstdc++@gcc.gnu.org. >> > >> >> > >> On Sun, Mar 19, 2023 at 7:53 PM Ken Matsui < >> kmatsui@cs.washington.edu> wrote: >> > >> > >> > >> > libstdc++-v3/ChangeLog: >> > >> > >> > >> > * include/std/type_traits (is_reference): Use __remove_pointer >> built-in trait. >> > > >> > > >> > > The changelog entry says is_reference but the patch is for >> remove_pointer. >> > > >> > > >> > >> > >> > >> > --- >> > >> > diff --git a/libstdc++-v3/include/std/type_traits >> > >> > b/libstdc++-v3/include/std/type_traits >> > >> > index 2bd607a8b8f..cba98091aad 100644 >> > >> > --- a/libstdc++-v3/include/std/type_traits >> > >> > +++ b/libstdc++-v3/include/std/type_traits >> > >> > @@ -2025,17 +2025,23 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION >> > >> > >> > >> > template<typename _Tp, typename> >> > >> > struct __remove_pointer_helper >> > >> > - { typedef _Tp type; }; >> > >> > + { using type = _Tp; }; >> > >> > >> > >> > template<typename _Tp, typename _Up> >> > >> > struct __remove_pointer_helper<_Tp, _Up*> >> > >> > - { typedef _Up type; }; >> > >> > + { using type = _Up; }; >> > > >> > > >> > > The helper doesn't need to be defined for the case where we don't use >> it. >> > > >> > > >> > >> > >> > >> > /// remove_pointer >> > >> > +#if __has_builtin(__remove_pointer) >> > >> > + template<typename _Tp> >> > >> > + struct remove_pointer >> > >> > + { using type = __remove_pointer(_Tp); }; >> > >> > +#else >> > >> > template<typename _Tp> >> > >> > struct remove_pointer >> > >> > : public __remove_pointer_helper<_Tp, __remove_cv_t<_Tp>> >> > >> > { }; >> > >> > +#endif >> > >> > >> > >> > template<typename _Tp, typename = void> >> > >> > struct __add_pointer_helper >> >
diff --git a/libstdc++-v3/include/std/type_traits b/libstdc++-v3/include/std/type_traits index 2bd607a8b8f..cba98091aad 100644 --- a/libstdc++-v3/include/std/type_traits +++ b/libstdc++-v3/include/std/type_traits @@ -2025,17 +2025,23 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION template<typename _Tp, typename> struct __remove_pointer_helper - { typedef _Tp type; }; + { using type = _Tp; }; template<typename _Tp, typename _Up> struct __remove_pointer_helper<_Tp, _Up*> - { typedef _Up type; }; + { using type = _Up; }; /// remove_pointer +#if __has_builtin(__remove_pointer) + template<typename _Tp> + struct remove_pointer + { using type = __remove_pointer(_Tp); }; +#else template<typename _Tp> struct remove_pointer : public __remove_pointer_helper<_Tp, __remove_cv_t<_Tp>> { }; +#endif template<typename _Tp, typename = void> struct __add_pointer_helper