Message ID | 20230323110608.42262-1-kmatsui@cs.washington.edu |
---|---|
State | Committed |
Commit | 637edefc5863cf3b572c0c0bcd58fcc01ee60184 |
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 507B238708C2 for <patchwork@sourceware.org>; Thu, 23 Mar 2023 11:06:51 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 507B238708C2 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1679569611; bh=uCrU1pgph0RqzUhOm84aTpVasAiF6sD52NJ8MkUmTZU=; h=To:Cc:Subject:Date:In-Reply-To:References:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=buKzsNKPP7E/8l6tNVR3kpnOcMlePyIht/uWnUg/RBvyMvmNyVRpyEkllTkxy2S7C sUSTC+TlQoY54fPuPGyzZGzNwmIxh15249xExwJHAuTf/LmduXyHMxWxSrKIaQH1+5 QLYtAXQT6XL5v8QAWt5SuCQeo3IoH7Qw8GU3NI9I= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mx0b-00641c01.pphosted.com (mx0b-00641c01.pphosted.com [205.220.177.146]) by sourceware.org (Postfix) with ESMTPS id 0CFDB3858C31; Thu, 23 Mar 2023 11:06:22 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 0CFDB3858C31 Received: from pps.filterd (m0247477.ppops.net [127.0.0.1]) by mx0a-00641c01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 32NB6LVV015372; Thu, 23 Mar 2023 11:06:21 GMT Received: from mxout23.cac.washington.edu (mxout23.cac.washington.edu [140.142.32.140]) by mx0a-00641c01.pphosted.com (PPS) with ESMTPS id 3pg63p4sjf-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 23 Mar 2023 11:06:21 +0000 Received: from smtp.washington.edu (smtp.washington.edu [128.208.60.54]) by mxout23.cac.washington.edu (8.14.4+UW20.07/8.14.4+UW22.04) with ESMTP id 32NB6GuY008263 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 23 Mar 2023 04:06:16 -0700 X-Auth-Received: from localhost.localdomain ([10.154.74.245]) (authenticated authid=kmatsui) by smtp.washington.edu (8.16.1+UW21.10/8.14.4+UW19.10) with ESMTPSA id 32NB6GIf003418 (version=TLSv1.2 cipher=DHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT); Thu, 23 Mar 2023 04:06:16 -0700 X-UW-Orig-Sender: kmatsui@smtp.washington.edu To: gcc-patches@gcc.gnu.org Cc: libstdc++@gcc.gnu.org, Jonathan Wakely <jwakely@redhat.com>, ville.voutilainen@gmail.com, Ken Matsui <kmatsui@cs.washington.edu> Subject: [PATCH] libstdc++: use __bool_constant instead of integral_constant Date: Thu, 23 Mar 2023 04:06:08 -0700 Message-Id: <20230323110608.42262-1-kmatsui@cs.washington.edu> X-Mailer: git-send-email 2.40.0 In-Reply-To: <CAML+3pXgiJ93E=16mDnhMBaYy1RETKkqw9G8YA+BNFMxuG8eng@mail.gmail.com> References: <CAML+3pXgiJ93E=16mDnhMBaYy1RETKkqw9G8YA+BNFMxuG8eng@mail.gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Proofpoint-ORIG-GUID: wExHFs-M5w0C1M0UzNMQDrmKUDLuxijh X-Proofpoint-GUID: wExHFs-M5w0C1M0UzNMQDrmKUDLuxijh X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.942,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-03-22_21,2023-03-22_01,2023-02-09_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 bulkscore=0 mlxscore=0 spamscore=0 phishscore=0 malwarescore=0 adultscore=0 impostorscore=0 suspectscore=0 lowpriorityscore=0 clxscore=1015 mlxlogscore=749 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2303150002 definitions=main-2303230084 X-Spam-Status: No, score=-14.4 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_STATUS, RCVD_IN_DNSWL_LOW, 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 __bool_constant instead of integral_constant
|
|
Commit Message
Ken Matsui
March 23, 2023, 11:06 a.m. UTC
In the type_traits header, both integral_constant<bool> and __bool_constant
are used. This patch unifies those usages into __bool_constant.
libstdc++-v3/ChangeLog:
* include/std/type_traits: Use __bool_constant instead of
integral_constant.
Signed-off-by: Ken Matsui <kmatsui@cs.washington.edu>
---
libstdc++-v3/include/std/type_traits | 32 ++++++++++++++--------------
1 file changed, 16 insertions(+), 16 deletions(-)
Comments
Ping for this patch. On Thu, Mar 23, 2023 at 4:06 AM Ken Matsui <kmatsui@cs.washington.edu> wrote: > > In the type_traits header, both integral_constant<bool> and __bool_constant > are used. This patch unifies those usages into __bool_constant. > > libstdc++-v3/ChangeLog: > > * include/std/type_traits: Use __bool_constant instead of > integral_constant. > > Signed-off-by: Ken Matsui <kmatsui@cs.washington.edu> > --- > libstdc++-v3/include/std/type_traits | 32 ++++++++++++++-------------- > 1 file changed, 16 insertions(+), 16 deletions(-) > > diff --git a/libstdc++-v3/include/std/type_traits b/libstdc++-v3/include/std/type_traits > index 2bd607a8b8f..bc6982f9e64 100644 > --- a/libstdc++-v3/include/std/type_traits > +++ b/libstdc++-v3/include/std/type_traits > @@ -578,19 +578,19 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION > /// is_enum > template<typename _Tp> > struct is_enum > - : public integral_constant<bool, __is_enum(_Tp)> > + : public __bool_constant<__is_enum(_Tp)> > { }; > > /// is_union > template<typename _Tp> > struct is_union > - : public integral_constant<bool, __is_union(_Tp)> > + : public __bool_constant<__is_union(_Tp)> > { }; > > /// is_class > template<typename _Tp> > struct is_class > - : public integral_constant<bool, __is_class(_Tp)> > + : public __bool_constant<__is_class(_Tp)> > { }; > > /// is_function > @@ -784,7 +784,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION > /// is_trivial > template<typename _Tp> > struct is_trivial > - : public integral_constant<bool, __is_trivial(_Tp)> > + : public __bool_constant<__is_trivial(_Tp)> > { > static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}), > "template argument must be a complete class or an unbounded array"); > @@ -793,7 +793,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION > /// is_trivially_copyable > template<typename _Tp> > struct is_trivially_copyable > - : public integral_constant<bool, __is_trivially_copyable(_Tp)> > + : public __bool_constant<__is_trivially_copyable(_Tp)> > { > static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}), > "template argument must be a complete class or an unbounded array"); > @@ -802,7 +802,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION > /// is_standard_layout > template<typename _Tp> > struct is_standard_layout > - : public integral_constant<bool, __is_standard_layout(_Tp)> > + : public __bool_constant<__is_standard_layout(_Tp)> > { > static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}), > "template argument must be a complete class or an unbounded array"); > @@ -817,7 +817,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION > struct > _GLIBCXX20_DEPRECATED_SUGGEST("is_standard_layout && is_trivial") > is_pod > - : public integral_constant<bool, __is_pod(_Tp)> > + : public __bool_constant<__is_pod(_Tp)> > { > static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}), > "template argument must be a complete class or an unbounded array"); > @@ -831,7 +831,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION > struct > _GLIBCXX17_DEPRECATED > is_literal_type > - : public integral_constant<bool, __is_literal_type(_Tp)> > + : public __bool_constant<__is_literal_type(_Tp)> > { > static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}), > "template argument must be a complete class or an unbounded array"); > @@ -840,13 +840,13 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION > /// is_empty > template<typename _Tp> > struct is_empty > - : public integral_constant<bool, __is_empty(_Tp)> > + : public __bool_constant<__is_empty(_Tp)> > { }; > > /// is_polymorphic > template<typename _Tp> > struct is_polymorphic > - : public integral_constant<bool, __is_polymorphic(_Tp)> > + : public __bool_constant<__is_polymorphic(_Tp)> > { }; > > #if __cplusplus >= 201402L > @@ -855,14 +855,14 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION > /// @since C++14 > template<typename _Tp> > struct is_final > - : public integral_constant<bool, __is_final(_Tp)> > + : public __bool_constant<__is_final(_Tp)> > { }; > #endif > > /// is_abstract > template<typename _Tp> > struct is_abstract > - : public integral_constant<bool, __is_abstract(_Tp)> > + : public __bool_constant<__is_abstract(_Tp)> > { }; > > /// @cond undocumented > @@ -873,7 +873,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION > > template<typename _Tp> > struct __is_signed_helper<_Tp, true> > - : public integral_constant<bool, _Tp(-1) < _Tp(0)> > + : public __bool_constant<_Tp(-1) < _Tp(0)> > { }; > /// @endcond > > @@ -1333,7 +1333,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION > /// has_virtual_destructor > template<typename _Tp> > struct has_virtual_destructor > - : public integral_constant<bool, __has_virtual_destructor(_Tp)> > + : public __bool_constant<__has_virtual_destructor(_Tp)> > { > static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}), > "template argument must be a complete class or an unbounded array"); > @@ -1392,7 +1392,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION > template<typename _Tp, typename _Up> > struct is_same > #ifdef _GLIBCXX_HAVE_BUILTIN_IS_SAME > - : public integral_constant<bool, __is_same(_Tp, _Up)> > + : public __bool_constant<__is_same(_Tp, _Up)> > #else > : public false_type > #endif > @@ -1408,7 +1408,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION > /// is_base_of > template<typename _Base, typename _Derived> > struct is_base_of > - : public integral_constant<bool, __is_base_of(_Base, _Derived)> > + : public __bool_constant<__is_base_of(_Base, _Derived)> > { }; > > #if __has_builtin(__is_convertible) > -- > 2.40.0 >
This looks good, thanks, but we're too close to the gcc 13 release now, and this isn't fixing any bugs. I'll push it after the release. On Thu, 23 Mar 2023, 11:07 Ken Matsui via Libstdc++, <libstdc++@gcc.gnu.org> wrote: > In the type_traits header, both integral_constant<bool> and __bool_constant > are used. This patch unifies those usages into __bool_constant. > > libstdc++-v3/ChangeLog: > > * include/std/type_traits: Use __bool_constant instead of > integral_constant. > > Signed-off-by: Ken Matsui <kmatsui@cs.washington.edu> > --- > libstdc++-v3/include/std/type_traits | 32 ++++++++++++++-------------- > 1 file changed, 16 insertions(+), 16 deletions(-) > > diff --git a/libstdc++-v3/include/std/type_traits > b/libstdc++-v3/include/std/type_traits > index 2bd607a8b8f..bc6982f9e64 100644 > --- a/libstdc++-v3/include/std/type_traits > +++ b/libstdc++-v3/include/std/type_traits > @@ -578,19 +578,19 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION > /// is_enum > template<typename _Tp> > struct is_enum > - : public integral_constant<bool, __is_enum(_Tp)> > + : public __bool_constant<__is_enum(_Tp)> > { }; > > /// is_union > template<typename _Tp> > struct is_union > - : public integral_constant<bool, __is_union(_Tp)> > + : public __bool_constant<__is_union(_Tp)> > { }; > > /// is_class > template<typename _Tp> > struct is_class > - : public integral_constant<bool, __is_class(_Tp)> > + : public __bool_constant<__is_class(_Tp)> > { }; > > /// is_function > @@ -784,7 +784,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION > /// is_trivial > template<typename _Tp> > struct is_trivial > - : public integral_constant<bool, __is_trivial(_Tp)> > + : public __bool_constant<__is_trivial(_Tp)> > { > > static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}), > "template argument must be a complete class or an unbounded > array"); > @@ -793,7 +793,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION > /// is_trivially_copyable > template<typename _Tp> > struct is_trivially_copyable > - : public integral_constant<bool, __is_trivially_copyable(_Tp)> > + : public __bool_constant<__is_trivially_copyable(_Tp)> > { > > static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}), > "template argument must be a complete class or an unbounded > array"); > @@ -802,7 +802,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION > /// is_standard_layout > template<typename _Tp> > struct is_standard_layout > - : public integral_constant<bool, __is_standard_layout(_Tp)> > + : public __bool_constant<__is_standard_layout(_Tp)> > { > > static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}), > "template argument must be a complete class or an unbounded > array"); > @@ -817,7 +817,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION > struct > _GLIBCXX20_DEPRECATED_SUGGEST("is_standard_layout && is_trivial") > is_pod > - : public integral_constant<bool, __is_pod(_Tp)> > + : public __bool_constant<__is_pod(_Tp)> > { > > static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}), > "template argument must be a complete class or an unbounded > array"); > @@ -831,7 +831,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION > struct > _GLIBCXX17_DEPRECATED > is_literal_type > - : public integral_constant<bool, __is_literal_type(_Tp)> > + : public __bool_constant<__is_literal_type(_Tp)> > { > > static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}), > "template argument must be a complete class or an unbounded > array"); > @@ -840,13 +840,13 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION > /// is_empty > template<typename _Tp> > struct is_empty > - : public integral_constant<bool, __is_empty(_Tp)> > + : public __bool_constant<__is_empty(_Tp)> > { }; > > /// is_polymorphic > template<typename _Tp> > struct is_polymorphic > - : public integral_constant<bool, __is_polymorphic(_Tp)> > + : public __bool_constant<__is_polymorphic(_Tp)> > { }; > > #if __cplusplus >= 201402L > @@ -855,14 +855,14 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION > /// @since C++14 > template<typename _Tp> > struct is_final > - : public integral_constant<bool, __is_final(_Tp)> > + : public __bool_constant<__is_final(_Tp)> > { }; > #endif > > /// is_abstract > template<typename _Tp> > struct is_abstract > - : public integral_constant<bool, __is_abstract(_Tp)> > + : public __bool_constant<__is_abstract(_Tp)> > { }; > > /// @cond undocumented > @@ -873,7 +873,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION > > template<typename _Tp> > struct __is_signed_helper<_Tp, true> > - : public integral_constant<bool, _Tp(-1) < _Tp(0)> > + : public __bool_constant<_Tp(-1) < _Tp(0)> > { }; > /// @endcond > > @@ -1333,7 +1333,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION > /// has_virtual_destructor > template<typename _Tp> > struct has_virtual_destructor > - : public integral_constant<bool, __has_virtual_destructor(_Tp)> > + : public __bool_constant<__has_virtual_destructor(_Tp)> > { > > static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}), > "template argument must be a complete class or an unbounded > array"); > @@ -1392,7 +1392,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION > template<typename _Tp, typename _Up> > struct is_same > #ifdef _GLIBCXX_HAVE_BUILTIN_IS_SAME > - : public integral_constant<bool, __is_same(_Tp, _Up)> > + : public __bool_constant<__is_same(_Tp, _Up)> > #else > : public false_type > #endif > @@ -1408,7 +1408,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION > /// is_base_of > template<typename _Base, typename _Derived> > struct is_base_of > - : public integral_constant<bool, __is_base_of(_Base, _Derived)> > + : public __bool_constant<__is_base_of(_Base, _Derived)> > { }; > > #if __has_builtin(__is_convertible) > -- > 2.40.0 > >
I see. Thank you! On Sat, Apr 8, 2023 at 12:52 AM Jonathan Wakely <jwakely.gcc@gmail.com> wrote: > > This looks good, thanks, but we're too close to the gcc 13 release now, and this isn't fixing any bugs. I'll push it after the release. > > > On Thu, 23 Mar 2023, 11:07 Ken Matsui via Libstdc++, <libstdc++@gcc.gnu.org> wrote: >> >> In the type_traits header, both integral_constant<bool> and __bool_constant >> are used. This patch unifies those usages into __bool_constant. >> >> libstdc++-v3/ChangeLog: >> >> * include/std/type_traits: Use __bool_constant instead of >> integral_constant. >> >> Signed-off-by: Ken Matsui <kmatsui@cs.washington.edu> >> --- >> libstdc++-v3/include/std/type_traits | 32 ++++++++++++++-------------- >> 1 file changed, 16 insertions(+), 16 deletions(-) >> >> diff --git a/libstdc++-v3/include/std/type_traits b/libstdc++-v3/include/std/type_traits >> index 2bd607a8b8f..bc6982f9e64 100644 >> --- a/libstdc++-v3/include/std/type_traits >> +++ b/libstdc++-v3/include/std/type_traits >> @@ -578,19 +578,19 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION >> /// is_enum >> template<typename _Tp> >> struct is_enum >> - : public integral_constant<bool, __is_enum(_Tp)> >> + : public __bool_constant<__is_enum(_Tp)> >> { }; >> >> /// is_union >> template<typename _Tp> >> struct is_union >> - : public integral_constant<bool, __is_union(_Tp)> >> + : public __bool_constant<__is_union(_Tp)> >> { }; >> >> /// is_class >> template<typename _Tp> >> struct is_class >> - : public integral_constant<bool, __is_class(_Tp)> >> + : public __bool_constant<__is_class(_Tp)> >> { }; >> >> /// is_function >> @@ -784,7 +784,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION >> /// is_trivial >> template<typename _Tp> >> struct is_trivial >> - : public integral_constant<bool, __is_trivial(_Tp)> >> + : public __bool_constant<__is_trivial(_Tp)> >> { >> static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}), >> "template argument must be a complete class or an unbounded array"); >> @@ -793,7 +793,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION >> /// is_trivially_copyable >> template<typename _Tp> >> struct is_trivially_copyable >> - : public integral_constant<bool, __is_trivially_copyable(_Tp)> >> + : public __bool_constant<__is_trivially_copyable(_Tp)> >> { >> static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}), >> "template argument must be a complete class or an unbounded array"); >> @@ -802,7 +802,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION >> /// is_standard_layout >> template<typename _Tp> >> struct is_standard_layout >> - : public integral_constant<bool, __is_standard_layout(_Tp)> >> + : public __bool_constant<__is_standard_layout(_Tp)> >> { >> static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}), >> "template argument must be a complete class or an unbounded array"); >> @@ -817,7 +817,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION >> struct >> _GLIBCXX20_DEPRECATED_SUGGEST("is_standard_layout && is_trivial") >> is_pod >> - : public integral_constant<bool, __is_pod(_Tp)> >> + : public __bool_constant<__is_pod(_Tp)> >> { >> static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}), >> "template argument must be a complete class or an unbounded array"); >> @@ -831,7 +831,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION >> struct >> _GLIBCXX17_DEPRECATED >> is_literal_type >> - : public integral_constant<bool, __is_literal_type(_Tp)> >> + : public __bool_constant<__is_literal_type(_Tp)> >> { >> static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}), >> "template argument must be a complete class or an unbounded array"); >> @@ -840,13 +840,13 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION >> /// is_empty >> template<typename _Tp> >> struct is_empty >> - : public integral_constant<bool, __is_empty(_Tp)> >> + : public __bool_constant<__is_empty(_Tp)> >> { }; >> >> /// is_polymorphic >> template<typename _Tp> >> struct is_polymorphic >> - : public integral_constant<bool, __is_polymorphic(_Tp)> >> + : public __bool_constant<__is_polymorphic(_Tp)> >> { }; >> >> #if __cplusplus >= 201402L >> @@ -855,14 +855,14 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION >> /// @since C++14 >> template<typename _Tp> >> struct is_final >> - : public integral_constant<bool, __is_final(_Tp)> >> + : public __bool_constant<__is_final(_Tp)> >> { }; >> #endif >> >> /// is_abstract >> template<typename _Tp> >> struct is_abstract >> - : public integral_constant<bool, __is_abstract(_Tp)> >> + : public __bool_constant<__is_abstract(_Tp)> >> { }; >> >> /// @cond undocumented >> @@ -873,7 +873,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION >> >> template<typename _Tp> >> struct __is_signed_helper<_Tp, true> >> - : public integral_constant<bool, _Tp(-1) < _Tp(0)> >> + : public __bool_constant<_Tp(-1) < _Tp(0)> >> { }; >> /// @endcond >> >> @@ -1333,7 +1333,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION >> /// has_virtual_destructor >> template<typename _Tp> >> struct has_virtual_destructor >> - : public integral_constant<bool, __has_virtual_destructor(_Tp)> >> + : public __bool_constant<__has_virtual_destructor(_Tp)> >> { >> static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}), >> "template argument must be a complete class or an unbounded array"); >> @@ -1392,7 +1392,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION >> template<typename _Tp, typename _Up> >> struct is_same >> #ifdef _GLIBCXX_HAVE_BUILTIN_IS_SAME >> - : public integral_constant<bool, __is_same(_Tp, _Up)> >> + : public __bool_constant<__is_same(_Tp, _Up)> >> #else >> : public false_type >> #endif >> @@ -1408,7 +1408,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION >> /// is_base_of >> template<typename _Base, typename _Derived> >> struct is_base_of >> - : public integral_constant<bool, __is_base_of(_Base, _Derived)> >> + : public __bool_constant<__is_base_of(_Base, _Derived)> >> { }; >> >> #if __has_builtin(__is_convertible) >> -- >> 2.40.0 >>
It appears that GCC 13 has been released, but I am wondering if there are any issues preventing this patch from being merged yet. Can you provide any information on this? On Sat, Apr 8, 2023 at 2:08 PM Ken Matsui <kmatsui@cs.washington.edu> wrote: > > I see. Thank you! > > On Sat, Apr 8, 2023 at 12:52 AM Jonathan Wakely <jwakely.gcc@gmail.com> wrote: > > > > This looks good, thanks, but we're too close to the gcc 13 release now, and this isn't fixing any bugs. I'll push it after the release. > > > > > > On Thu, 23 Mar 2023, 11:07 Ken Matsui via Libstdc++, <libstdc++@gcc.gnu.org> wrote: > >> > >> In the type_traits header, both integral_constant<bool> and __bool_constant > >> are used. This patch unifies those usages into __bool_constant. > >> > >> libstdc++-v3/ChangeLog: > >> > >> * include/std/type_traits: Use __bool_constant instead of > >> integral_constant. > >> > >> Signed-off-by: Ken Matsui <kmatsui@cs.washington.edu> > >> --- > >> libstdc++-v3/include/std/type_traits | 32 ++++++++++++++-------------- > >> 1 file changed, 16 insertions(+), 16 deletions(-) > >> > >> diff --git a/libstdc++-v3/include/std/type_traits b/libstdc++-v3/include/std/type_traits > >> index 2bd607a8b8f..bc6982f9e64 100644 > >> --- a/libstdc++-v3/include/std/type_traits > >> +++ b/libstdc++-v3/include/std/type_traits > >> @@ -578,19 +578,19 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION > >> /// is_enum > >> template<typename _Tp> > >> struct is_enum > >> - : public integral_constant<bool, __is_enum(_Tp)> > >> + : public __bool_constant<__is_enum(_Tp)> > >> { }; > >> > >> /// is_union > >> template<typename _Tp> > >> struct is_union > >> - : public integral_constant<bool, __is_union(_Tp)> > >> + : public __bool_constant<__is_union(_Tp)> > >> { }; > >> > >> /// is_class > >> template<typename _Tp> > >> struct is_class > >> - : public integral_constant<bool, __is_class(_Tp)> > >> + : public __bool_constant<__is_class(_Tp)> > >> { }; > >> > >> /// is_function > >> @@ -784,7 +784,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION > >> /// is_trivial > >> template<typename _Tp> > >> struct is_trivial > >> - : public integral_constant<bool, __is_trivial(_Tp)> > >> + : public __bool_constant<__is_trivial(_Tp)> > >> { > >> static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}), > >> "template argument must be a complete class or an unbounded array"); > >> @@ -793,7 +793,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION > >> /// is_trivially_copyable > >> template<typename _Tp> > >> struct is_trivially_copyable > >> - : public integral_constant<bool, __is_trivially_copyable(_Tp)> > >> + : public __bool_constant<__is_trivially_copyable(_Tp)> > >> { > >> static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}), > >> "template argument must be a complete class or an unbounded array"); > >> @@ -802,7 +802,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION > >> /// is_standard_layout > >> template<typename _Tp> > >> struct is_standard_layout > >> - : public integral_constant<bool, __is_standard_layout(_Tp)> > >> + : public __bool_constant<__is_standard_layout(_Tp)> > >> { > >> static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}), > >> "template argument must be a complete class or an unbounded array"); > >> @@ -817,7 +817,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION > >> struct > >> _GLIBCXX20_DEPRECATED_SUGGEST("is_standard_layout && is_trivial") > >> is_pod > >> - : public integral_constant<bool, __is_pod(_Tp)> > >> + : public __bool_constant<__is_pod(_Tp)> > >> { > >> static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}), > >> "template argument must be a complete class or an unbounded array"); > >> @@ -831,7 +831,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION > >> struct > >> _GLIBCXX17_DEPRECATED > >> is_literal_type > >> - : public integral_constant<bool, __is_literal_type(_Tp)> > >> + : public __bool_constant<__is_literal_type(_Tp)> > >> { > >> static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}), > >> "template argument must be a complete class or an unbounded array"); > >> @@ -840,13 +840,13 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION > >> /// is_empty > >> template<typename _Tp> > >> struct is_empty > >> - : public integral_constant<bool, __is_empty(_Tp)> > >> + : public __bool_constant<__is_empty(_Tp)> > >> { }; > >> > >> /// is_polymorphic > >> template<typename _Tp> > >> struct is_polymorphic > >> - : public integral_constant<bool, __is_polymorphic(_Tp)> > >> + : public __bool_constant<__is_polymorphic(_Tp)> > >> { }; > >> > >> #if __cplusplus >= 201402L > >> @@ -855,14 +855,14 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION > >> /// @since C++14 > >> template<typename _Tp> > >> struct is_final > >> - : public integral_constant<bool, __is_final(_Tp)> > >> + : public __bool_constant<__is_final(_Tp)> > >> { }; > >> #endif > >> > >> /// is_abstract > >> template<typename _Tp> > >> struct is_abstract > >> - : public integral_constant<bool, __is_abstract(_Tp)> > >> + : public __bool_constant<__is_abstract(_Tp)> > >> { }; > >> > >> /// @cond undocumented > >> @@ -873,7 +873,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION > >> > >> template<typename _Tp> > >> struct __is_signed_helper<_Tp, true> > >> - : public integral_constant<bool, _Tp(-1) < _Tp(0)> > >> + : public __bool_constant<_Tp(-1) < _Tp(0)> > >> { }; > >> /// @endcond > >> > >> @@ -1333,7 +1333,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION > >> /// has_virtual_destructor > >> template<typename _Tp> > >> struct has_virtual_destructor > >> - : public integral_constant<bool, __has_virtual_destructor(_Tp)> > >> + : public __bool_constant<__has_virtual_destructor(_Tp)> > >> { > >> static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}), > >> "template argument must be a complete class or an unbounded array"); > >> @@ -1392,7 +1392,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION > >> template<typename _Tp, typename _Up> > >> struct is_same > >> #ifdef _GLIBCXX_HAVE_BUILTIN_IS_SAME > >> - : public integral_constant<bool, __is_same(_Tp, _Up)> > >> + : public __bool_constant<__is_same(_Tp, _Up)> > >> #else > >> : public false_type > >> #endif > >> @@ -1408,7 +1408,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION > >> /// is_base_of > >> template<typename _Base, typename _Derived> > >> struct is_base_of > >> - : public integral_constant<bool, __is_base_of(_Base, _Derived)> > >> + : public __bool_constant<__is_base_of(_Base, _Derived)> > >> { }; > >> > >> #if __has_builtin(__is_convertible) > >> -- > >> 2.40.0 > >>
On Fri, 12 May 2023, Ken Matsui via Libstdc++ wrote: > It appears that GCC 13 has been released, but I am wondering if there > are any issues preventing this patch from being merged yet. Can you > provide any information on this? Thanks for the reminder, I pushed this to trunk just now (r14-940-g637edefc5863cf). Congrats on your first libstdc++ commit! > > On Sat, Apr 8, 2023 at 2:08 PM Ken Matsui <kmatsui@cs.washington.edu> wrote: > > > > I see. Thank you! > > > > On Sat, Apr 8, 2023 at 12:52 AM Jonathan Wakely <jwakely.gcc@gmail.com> wrote: > > > > > > This looks good, thanks, but we're too close to the gcc 13 release now, and this isn't fixing any bugs. I'll push it after the release. > > > > > > > > > On Thu, 23 Mar 2023, 11:07 Ken Matsui via Libstdc++, <libstdc++@gcc.gnu.org> wrote: > > >> > > >> In the type_traits header, both integral_constant<bool> and __bool_constant > > >> are used. This patch unifies those usages into __bool_constant. > > >> > > >> libstdc++-v3/ChangeLog: > > >> > > >> * include/std/type_traits: Use __bool_constant instead of > > >> integral_constant. > > >> > > >> Signed-off-by: Ken Matsui <kmatsui@cs.washington.edu> > > >> --- > > >> libstdc++-v3/include/std/type_traits | 32 ++++++++++++++-------------- > > >> 1 file changed, 16 insertions(+), 16 deletions(-) > > >> > > >> diff --git a/libstdc++-v3/include/std/type_traits b/libstdc++-v3/include/std/type_traits > > >> index 2bd607a8b8f..bc6982f9e64 100644 > > >> --- a/libstdc++-v3/include/std/type_traits > > >> +++ b/libstdc++-v3/include/std/type_traits > > >> @@ -578,19 +578,19 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION > > >> /// is_enum > > >> template<typename _Tp> > > >> struct is_enum > > >> - : public integral_constant<bool, __is_enum(_Tp)> > > >> + : public __bool_constant<__is_enum(_Tp)> > > >> { }; > > >> > > >> /// is_union > > >> template<typename _Tp> > > >> struct is_union > > >> - : public integral_constant<bool, __is_union(_Tp)> > > >> + : public __bool_constant<__is_union(_Tp)> > > >> { }; > > >> > > >> /// is_class > > >> template<typename _Tp> > > >> struct is_class > > >> - : public integral_constant<bool, __is_class(_Tp)> > > >> + : public __bool_constant<__is_class(_Tp)> > > >> { }; > > >> > > >> /// is_function > > >> @@ -784,7 +784,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION > > >> /// is_trivial > > >> template<typename _Tp> > > >> struct is_trivial > > >> - : public integral_constant<bool, __is_trivial(_Tp)> > > >> + : public __bool_constant<__is_trivial(_Tp)> > > >> { > > >> static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}), > > >> "template argument must be a complete class or an unbounded array"); > > >> @@ -793,7 +793,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION > > >> /// is_trivially_copyable > > >> template<typename _Tp> > > >> struct is_trivially_copyable > > >> - : public integral_constant<bool, __is_trivially_copyable(_Tp)> > > >> + : public __bool_constant<__is_trivially_copyable(_Tp)> > > >> { > > >> static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}), > > >> "template argument must be a complete class or an unbounded array"); > > >> @@ -802,7 +802,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION > > >> /// is_standard_layout > > >> template<typename _Tp> > > >> struct is_standard_layout > > >> - : public integral_constant<bool, __is_standard_layout(_Tp)> > > >> + : public __bool_constant<__is_standard_layout(_Tp)> > > >> { > > >> static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}), > > >> "template argument must be a complete class or an unbounded array"); > > >> @@ -817,7 +817,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION > > >> struct > > >> _GLIBCXX20_DEPRECATED_SUGGEST("is_standard_layout && is_trivial") > > >> is_pod > > >> - : public integral_constant<bool, __is_pod(_Tp)> > > >> + : public __bool_constant<__is_pod(_Tp)> > > >> { > > >> static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}), > > >> "template argument must be a complete class or an unbounded array"); > > >> @@ -831,7 +831,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION > > >> struct > > >> _GLIBCXX17_DEPRECATED > > >> is_literal_type > > >> - : public integral_constant<bool, __is_literal_type(_Tp)> > > >> + : public __bool_constant<__is_literal_type(_Tp)> > > >> { > > >> static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}), > > >> "template argument must be a complete class or an unbounded array"); > > >> @@ -840,13 +840,13 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION > > >> /// is_empty > > >> template<typename _Tp> > > >> struct is_empty > > >> - : public integral_constant<bool, __is_empty(_Tp)> > > >> + : public __bool_constant<__is_empty(_Tp)> > > >> { }; > > >> > > >> /// is_polymorphic > > >> template<typename _Tp> > > >> struct is_polymorphic > > >> - : public integral_constant<bool, __is_polymorphic(_Tp)> > > >> + : public __bool_constant<__is_polymorphic(_Tp)> > > >> { }; > > >> > > >> #if __cplusplus >= 201402L > > >> @@ -855,14 +855,14 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION > > >> /// @since C++14 > > >> template<typename _Tp> > > >> struct is_final > > >> - : public integral_constant<bool, __is_final(_Tp)> > > >> + : public __bool_constant<__is_final(_Tp)> > > >> { }; > > >> #endif > > >> > > >> /// is_abstract > > >> template<typename _Tp> > > >> struct is_abstract > > >> - : public integral_constant<bool, __is_abstract(_Tp)> > > >> + : public __bool_constant<__is_abstract(_Tp)> > > >> { }; > > >> > > >> /// @cond undocumented > > >> @@ -873,7 +873,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION > > >> > > >> template<typename _Tp> > > >> struct __is_signed_helper<_Tp, true> > > >> - : public integral_constant<bool, _Tp(-1) < _Tp(0)> > > >> + : public __bool_constant<_Tp(-1) < _Tp(0)> > > >> { }; > > >> /// @endcond > > >> > > >> @@ -1333,7 +1333,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION > > >> /// has_virtual_destructor > > >> template<typename _Tp> > > >> struct has_virtual_destructor > > >> - : public integral_constant<bool, __has_virtual_destructor(_Tp)> > > >> + : public __bool_constant<__has_virtual_destructor(_Tp)> > > >> { > > >> static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}), > > >> "template argument must be a complete class or an unbounded array"); > > >> @@ -1392,7 +1392,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION > > >> template<typename _Tp, typename _Up> > > >> struct is_same > > >> #ifdef _GLIBCXX_HAVE_BUILTIN_IS_SAME > > >> - : public integral_constant<bool, __is_same(_Tp, _Up)> > > >> + : public __bool_constant<__is_same(_Tp, _Up)> > > >> #else > > >> : public false_type > > >> #endif > > >> @@ -1408,7 +1408,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION > > >> /// is_base_of > > >> template<typename _Base, typename _Derived> > > >> struct is_base_of > > >> - : public integral_constant<bool, __is_base_of(_Base, _Derived)> > > >> + : public __bool_constant<__is_base_of(_Base, _Derived)> > > >> { }; > > >> > > >> #if __has_builtin(__is_convertible) > > >> -- > > >> 2.40.0 > > >> > >
Thank you! On Wed, May 17, 2023 at 8:53 AM Patrick Palka <ppalka@redhat.com> wrote: > > On Fri, 12 May 2023, Ken Matsui via Libstdc++ wrote: > > > It appears that GCC 13 has been released, but I am wondering if there > > are any issues preventing this patch from being merged yet. Can you > > provide any information on this? > > Thanks for the reminder, I pushed this to trunk just now > (r14-940-g637edefc5863cf). Congrats on your first libstdc++ commit! > > > > > On Sat, Apr 8, 2023 at 2:08 PM Ken Matsui <kmatsui@cs.washington.edu> wrote: > > > > > > I see. Thank you! > > > > > > On Sat, Apr 8, 2023 at 12:52 AM Jonathan Wakely <jwakely.gcc@gmail.com> wrote: > > > > > > > > This looks good, thanks, but we're too close to the gcc 13 release now, and this isn't fixing any bugs. I'll push it after the release. > > > > > > > > > > > > On Thu, 23 Mar 2023, 11:07 Ken Matsui via Libstdc++, <libstdc++@gcc.gnu.org> wrote: > > > >> > > > >> In the type_traits header, both integral_constant<bool> and __bool_constant > > > >> are used. This patch unifies those usages into __bool_constant. > > > >> > > > >> libstdc++-v3/ChangeLog: > > > >> > > > >> * include/std/type_traits: Use __bool_constant instead of > > > >> integral_constant. > > > >> > > > >> Signed-off-by: Ken Matsui <kmatsui@cs.washington.edu> > > > >> --- > > > >> libstdc++-v3/include/std/type_traits | 32 ++++++++++++++-------------- > > > >> 1 file changed, 16 insertions(+), 16 deletions(-) > > > >> > > > >> diff --git a/libstdc++-v3/include/std/type_traits b/libstdc++-v3/include/std/type_traits > > > >> index 2bd607a8b8f..bc6982f9e64 100644 > > > >> --- a/libstdc++-v3/include/std/type_traits > > > >> +++ b/libstdc++-v3/include/std/type_traits > > > >> @@ -578,19 +578,19 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION > > > >> /// is_enum > > > >> template<typename _Tp> > > > >> struct is_enum > > > >> - : public integral_constant<bool, __is_enum(_Tp)> > > > >> + : public __bool_constant<__is_enum(_Tp)> > > > >> { }; > > > >> > > > >> /// is_union > > > >> template<typename _Tp> > > > >> struct is_union > > > >> - : public integral_constant<bool, __is_union(_Tp)> > > > >> + : public __bool_constant<__is_union(_Tp)> > > > >> { }; > > > >> > > > >> /// is_class > > > >> template<typename _Tp> > > > >> struct is_class > > > >> - : public integral_constant<bool, __is_class(_Tp)> > > > >> + : public __bool_constant<__is_class(_Tp)> > > > >> { }; > > > >> > > > >> /// is_function > > > >> @@ -784,7 +784,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION > > > >> /// is_trivial > > > >> template<typename _Tp> > > > >> struct is_trivial > > > >> - : public integral_constant<bool, __is_trivial(_Tp)> > > > >> + : public __bool_constant<__is_trivial(_Tp)> > > > >> { > > > >> static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}), > > > >> "template argument must be a complete class or an unbounded array"); > > > >> @@ -793,7 +793,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION > > > >> /// is_trivially_copyable > > > >> template<typename _Tp> > > > >> struct is_trivially_copyable > > > >> - : public integral_constant<bool, __is_trivially_copyable(_Tp)> > > > >> + : public __bool_constant<__is_trivially_copyable(_Tp)> > > > >> { > > > >> static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}), > > > >> "template argument must be a complete class or an unbounded array"); > > > >> @@ -802,7 +802,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION > > > >> /// is_standard_layout > > > >> template<typename _Tp> > > > >> struct is_standard_layout > > > >> - : public integral_constant<bool, __is_standard_layout(_Tp)> > > > >> + : public __bool_constant<__is_standard_layout(_Tp)> > > > >> { > > > >> static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}), > > > >> "template argument must be a complete class or an unbounded array"); > > > >> @@ -817,7 +817,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION > > > >> struct > > > >> _GLIBCXX20_DEPRECATED_SUGGEST("is_standard_layout && is_trivial") > > > >> is_pod > > > >> - : public integral_constant<bool, __is_pod(_Tp)> > > > >> + : public __bool_constant<__is_pod(_Tp)> > > > >> { > > > >> static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}), > > > >> "template argument must be a complete class or an unbounded array"); > > > >> @@ -831,7 +831,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION > > > >> struct > > > >> _GLIBCXX17_DEPRECATED > > > >> is_literal_type > > > >> - : public integral_constant<bool, __is_literal_type(_Tp)> > > > >> + : public __bool_constant<__is_literal_type(_Tp)> > > > >> { > > > >> static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}), > > > >> "template argument must be a complete class or an unbounded array"); > > > >> @@ -840,13 +840,13 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION > > > >> /// is_empty > > > >> template<typename _Tp> > > > >> struct is_empty > > > >> - : public integral_constant<bool, __is_empty(_Tp)> > > > >> + : public __bool_constant<__is_empty(_Tp)> > > > >> { }; > > > >> > > > >> /// is_polymorphic > > > >> template<typename _Tp> > > > >> struct is_polymorphic > > > >> - : public integral_constant<bool, __is_polymorphic(_Tp)> > > > >> + : public __bool_constant<__is_polymorphic(_Tp)> > > > >> { }; > > > >> > > > >> #if __cplusplus >= 201402L > > > >> @@ -855,14 +855,14 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION > > > >> /// @since C++14 > > > >> template<typename _Tp> > > > >> struct is_final > > > >> - : public integral_constant<bool, __is_final(_Tp)> > > > >> + : public __bool_constant<__is_final(_Tp)> > > > >> { }; > > > >> #endif > > > >> > > > >> /// is_abstract > > > >> template<typename _Tp> > > > >> struct is_abstract > > > >> - : public integral_constant<bool, __is_abstract(_Tp)> > > > >> + : public __bool_constant<__is_abstract(_Tp)> > > > >> { }; > > > >> > > > >> /// @cond undocumented > > > >> @@ -873,7 +873,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION > > > >> > > > >> template<typename _Tp> > > > >> struct __is_signed_helper<_Tp, true> > > > >> - : public integral_constant<bool, _Tp(-1) < _Tp(0)> > > > >> + : public __bool_constant<_Tp(-1) < _Tp(0)> > > > >> { }; > > > >> /// @endcond > > > >> > > > >> @@ -1333,7 +1333,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION > > > >> /// has_virtual_destructor > > > >> template<typename _Tp> > > > >> struct has_virtual_destructor > > > >> - : public integral_constant<bool, __has_virtual_destructor(_Tp)> > > > >> + : public __bool_constant<__has_virtual_destructor(_Tp)> > > > >> { > > > >> static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}), > > > >> "template argument must be a complete class or an unbounded array"); > > > >> @@ -1392,7 +1392,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION > > > >> template<typename _Tp, typename _Up> > > > >> struct is_same > > > >> #ifdef _GLIBCXX_HAVE_BUILTIN_IS_SAME > > > >> - : public integral_constant<bool, __is_same(_Tp, _Up)> > > > >> + : public __bool_constant<__is_same(_Tp, _Up)> > > > >> #else > > > >> : public false_type > > > >> #endif > > > >> @@ -1408,7 +1408,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION > > > >> /// is_base_of > > > >> template<typename _Base, typename _Derived> > > > >> struct is_base_of > > > >> - : public integral_constant<bool, __is_base_of(_Base, _Derived)> > > > >> + : public __bool_constant<__is_base_of(_Base, _Derived)> > > > >> { }; > > > >> > > > >> #if __has_builtin(__is_convertible) > > > >> -- > > > >> 2.40.0 > > > >> > > > >
diff --git a/libstdc++-v3/include/std/type_traits b/libstdc++-v3/include/std/type_traits index 2bd607a8b8f..bc6982f9e64 100644 --- a/libstdc++-v3/include/std/type_traits +++ b/libstdc++-v3/include/std/type_traits @@ -578,19 +578,19 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION /// is_enum template<typename _Tp> struct is_enum - : public integral_constant<bool, __is_enum(_Tp)> + : public __bool_constant<__is_enum(_Tp)> { }; /// is_union template<typename _Tp> struct is_union - : public integral_constant<bool, __is_union(_Tp)> + : public __bool_constant<__is_union(_Tp)> { }; /// is_class template<typename _Tp> struct is_class - : public integral_constant<bool, __is_class(_Tp)> + : public __bool_constant<__is_class(_Tp)> { }; /// is_function @@ -784,7 +784,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION /// is_trivial template<typename _Tp> struct is_trivial - : public integral_constant<bool, __is_trivial(_Tp)> + : public __bool_constant<__is_trivial(_Tp)> { static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}), "template argument must be a complete class or an unbounded array"); @@ -793,7 +793,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION /// is_trivially_copyable template<typename _Tp> struct is_trivially_copyable - : public integral_constant<bool, __is_trivially_copyable(_Tp)> + : public __bool_constant<__is_trivially_copyable(_Tp)> { static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}), "template argument must be a complete class or an unbounded array"); @@ -802,7 +802,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION /// is_standard_layout template<typename _Tp> struct is_standard_layout - : public integral_constant<bool, __is_standard_layout(_Tp)> + : public __bool_constant<__is_standard_layout(_Tp)> { static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}), "template argument must be a complete class or an unbounded array"); @@ -817,7 +817,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION struct _GLIBCXX20_DEPRECATED_SUGGEST("is_standard_layout && is_trivial") is_pod - : public integral_constant<bool, __is_pod(_Tp)> + : public __bool_constant<__is_pod(_Tp)> { static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}), "template argument must be a complete class or an unbounded array"); @@ -831,7 +831,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION struct _GLIBCXX17_DEPRECATED is_literal_type - : public integral_constant<bool, __is_literal_type(_Tp)> + : public __bool_constant<__is_literal_type(_Tp)> { static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}), "template argument must be a complete class or an unbounded array"); @@ -840,13 +840,13 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION /// is_empty template<typename _Tp> struct is_empty - : public integral_constant<bool, __is_empty(_Tp)> + : public __bool_constant<__is_empty(_Tp)> { }; /// is_polymorphic template<typename _Tp> struct is_polymorphic - : public integral_constant<bool, __is_polymorphic(_Tp)> + : public __bool_constant<__is_polymorphic(_Tp)> { }; #if __cplusplus >= 201402L @@ -855,14 +855,14 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION /// @since C++14 template<typename _Tp> struct is_final - : public integral_constant<bool, __is_final(_Tp)> + : public __bool_constant<__is_final(_Tp)> { }; #endif /// is_abstract template<typename _Tp> struct is_abstract - : public integral_constant<bool, __is_abstract(_Tp)> + : public __bool_constant<__is_abstract(_Tp)> { }; /// @cond undocumented @@ -873,7 +873,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION template<typename _Tp> struct __is_signed_helper<_Tp, true> - : public integral_constant<bool, _Tp(-1) < _Tp(0)> + : public __bool_constant<_Tp(-1) < _Tp(0)> { }; /// @endcond @@ -1333,7 +1333,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION /// has_virtual_destructor template<typename _Tp> struct has_virtual_destructor - : public integral_constant<bool, __has_virtual_destructor(_Tp)> + : public __bool_constant<__has_virtual_destructor(_Tp)> { static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}), "template argument must be a complete class or an unbounded array"); @@ -1392,7 +1392,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION template<typename _Tp, typename _Up> struct is_same #ifdef _GLIBCXX_HAVE_BUILTIN_IS_SAME - : public integral_constant<bool, __is_same(_Tp, _Up)> + : public __bool_constant<__is_same(_Tp, _Up)> #else : public false_type #endif @@ -1408,7 +1408,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION /// is_base_of template<typename _Base, typename _Derived> struct is_base_of - : public integral_constant<bool, __is_base_of(_Base, _Derived)> + : public __bool_constant<__is_base_of(_Base, _Derived)> { }; #if __has_builtin(__is_convertible)