From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ej1-x633.google.com (mail-ej1-x633.google.com [IPv6:2a00:1450:4864:20::633]) by sourceware.org (Postfix) with ESMTPS id 35BD33858D1E; Sat, 8 Apr 2023 07:52:46 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 35BD33858D1E Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-ej1-x633.google.com with SMTP id gb34so1766145ejc.12; Sat, 08 Apr 2023 00:52:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1680940365; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=pWQ9BFTxO1AHSDWv+A2GtoAKBzjj5B5GBJtgayKzhDc=; b=FAiOWxZI0V8LTeq4GNqpP1/6fsjxd6RyjSbevmOeIq/aZgN9DzpRaQ9xzOrNIbkG0x 6OBvmpA2qG8WdayR8IzFJ8eJD5X1tTw6rnR9RxrgD48eGVBLRCviTe1uTe44MyvhM8QH 1Yax4iS4CtWEZexkQvBsW5+JshlzsBhqiNcPLdGSpkgOPMYgJMimBJYSDHMTYFxx3VlD WLDOcfgIGSqSA+7CIpkYAR1vfUdd8RFHi5EdSD1kDUmuDoAlz6sKZ6R0D+AbCmBjCqz3 l5bgUQV2Z1FrvqTG2H8O4fBpsPuIrmKznECM5blrYNFzys3O8BxjcGVQVGEBkTUJdsLb aakw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680940365; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=pWQ9BFTxO1AHSDWv+A2GtoAKBzjj5B5GBJtgayKzhDc=; b=ykAkTn4SB/O0AROgfVSw+vyWoYqzTXHMo9bmfMkVUL9aUlUjEQXfPiXG6bZRUIL/FQ cX+ZfgTX0q5I+/viC6nrSAnOfFRN/0C7ac9ntinxGrMSCmVMZkgkcMf7RJCmn3nIGOFX D11L0lQGqPaFT6X83WhccucK06potRhTaPsJ4zqRRsM97GxxEel70cdr2Kh1/DeeIdv+ VMupyEh90b2p5gwn7XQkLJ4hDphQ8jtGJuGJyU7Ovs5cc6cKdtgw+wJHo2IHPNFYSlPb rVgmzx54pMK5XASkAgbSC32v/ZDcI971VYjKvMe3K4UusrymXgGhJcPhWaBOdEs4h1wa HQ/g== X-Gm-Message-State: AAQBX9fkTi+XEGhu+XBnezFC6/0WEKChNEG+ZRDH43muYTuOgaGhRM8i MrEA1aWdBLRhKZruYor6MNjxxEhFdflyd/Ska7A= X-Google-Smtp-Source: AKy350aTgh4yYxVDdgsMsSin87njiJ1ozUb8hKz95CdzUEFygfEiLElZ15+Qx9aSl0E80sg9Q6MXZwtIPuH4uRc7OgQ= X-Received: by 2002:a17:906:1759:b0:931:8502:ad02 with SMTP id d25-20020a170906175900b009318502ad02mr849262eje.13.1680940364681; Sat, 08 Apr 2023 00:52:44 -0700 (PDT) MIME-Version: 1.0 References: <20230323110608.42262-1-kmatsui@cs.washington.edu> In-Reply-To: <20230323110608.42262-1-kmatsui@cs.washington.edu> From: Jonathan Wakely Date: Sat, 8 Apr 2023 08:52:33 +0100 Message-ID: Subject: Re: [PATCH] libstdc++: use __bool_constant instead of integral_constant To: Ken Matsui Cc: gcc-patches , "libstdc++" , Jonathan Wakely , Ville Voutilainen Content-Type: multipart/alternative; boundary="0000000000005356a705f8ce6d32" X-Spam-Status: No, score=-6.7 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,GIT_PATCH_0,HTML_MESSAGE,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 List-Id: --0000000000005356a705f8ce6d32 Content-Type: text/plain; charset="UTF-8" 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++, wrote: > In the type_traits header, both integral_constant 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 > --- > 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 > struct is_enum > - : public integral_constant > + : public __bool_constant<__is_enum(_Tp)> > { }; > > /// is_union > template > struct is_union > - : public integral_constant > + : public __bool_constant<__is_union(_Tp)> > { }; > > /// is_class > template > struct is_class > - : public integral_constant > + : public __bool_constant<__is_class(_Tp)> > { }; > > /// is_function > @@ -784,7 +784,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION > /// is_trivial > template > struct is_trivial > - : public integral_constant > + : 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 > struct is_trivially_copyable > - : public integral_constant > + : 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 > struct is_standard_layout > - : public integral_constant > + : 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 > + : 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 > + : 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 > struct is_empty > - : public integral_constant > + : public __bool_constant<__is_empty(_Tp)> > { }; > > /// is_polymorphic > template > struct is_polymorphic > - : public integral_constant > + : public __bool_constant<__is_polymorphic(_Tp)> > { }; > > #if __cplusplus >= 201402L > @@ -855,14 +855,14 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION > /// @since C++14 > template > struct is_final > - : public integral_constant > + : public __bool_constant<__is_final(_Tp)> > { }; > #endif > > /// is_abstract > template > struct is_abstract > - : public integral_constant > + : public __bool_constant<__is_abstract(_Tp)> > { }; > > /// @cond undocumented > @@ -873,7 +873,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION > > template > struct __is_signed_helper<_Tp, true> > - : public integral_constant > + : public __bool_constant<_Tp(-1) < _Tp(0)> > { }; > /// @endcond > > @@ -1333,7 +1333,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION > /// has_virtual_destructor > template > struct has_virtual_destructor > - : public integral_constant > + : 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 > struct is_same > #ifdef _GLIBCXX_HAVE_BUILTIN_IS_SAME > - : public integral_constant > + : public __bool_constant<__is_same(_Tp, _Up)> > #else > : public false_type > #endif > @@ -1408,7 +1408,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION > /// is_base_of > template > struct is_base_of > - : public integral_constant > + : public __bool_constant<__is_base_of(_Base, _Derived)> > { }; > > #if __has_builtin(__is_convertible) > -- > 2.40.0 > > --0000000000005356a705f8ce6d32--