From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ua1-x930.google.com (mail-ua1-x930.google.com [IPv6:2607:f8b0:4864:20::930]) by sourceware.org (Postfix) with ESMTPS id 0D04E3858D35 for ; Fri, 9 Jun 2023 23:53:51 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 0D04E3858D35 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=cs.washington.edu Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=cs.washington.edu Received: by mail-ua1-x930.google.com with SMTP id a1e0cc1a2514c-789c56ead4fso899306241.1 for ; Fri, 09 Jun 2023 16:53:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cs.washington.edu; s=goo201206; t=1686354830; x=1688946830; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=QYPPlPn1+6pgER7v8sVo/3wmnoq92uXJOKm2DIFOV5I=; b=kItzmSGbC6g1GQzhq0lgo/VhkWqK/r6Z+5iS1u994Alrg6/nqVrdQCVKQv10OCpjWd vXlaSU4tknOUHK2/zKXbSp6/yLeU2bMPENkDtdFgNeTR/RQNl7VTmwjDjhZieSajA1a3 1oxhZvld2Kk16G0BoLx11inctQRwgTULUQ1cM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686354830; x=1688946830; h=content-transfer-encoding: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=QYPPlPn1+6pgER7v8sVo/3wmnoq92uXJOKm2DIFOV5I=; b=KbclI79SgJVH8d1N64qK2LrCkvNid8zuAyswku2yfPDOraZgwgmT4lpNOqcuxPyLSI R1ia8dXBnDO5KWJUbtkmGyCzZg31YPew8j0R4awRkJOkyNSxQKJt8RC8b/SsfK+pXxsJ Awhpd4w9oudcmwd3O/szT6QHv2vrQ90cnLqfc8iz6y6DJo385yOVGCFrOm9QJPj/l6MS tu8A+iGzwOCyZn5DM26Q9PiLQB0DdRl60AHMWbOgAMLQt2tueAbGboRqzfMNX4PKzyFq wUWKIhfPAq+Cq8qJqh5Kdd/ZodfStQZ5ckyGvv2RtFtsGxcZ/LUt9cplJ7RhZ0LuvynJ LB2w== X-Gm-Message-State: AC+VfDxdUCeo9rknYIxJ5jD/OplJNoCsSCFVGhwZN98979E5g1YOq4Zp GY6dGiHAoUaa2JpCK6dCWEZA0OLGV6DVBiH3srFZmA== X-Google-Smtp-Source: ACHHUZ5mo3bwYBfqE5rJy3VWXAIkQRVxRkaUeI4RfeDBy/sUiZ24vSD7klogsIiXgUi3sXDpjDSkvZzKa8b1BVvg+Gk= X-Received: by 2002:a05:6102:34cc:b0:43b:5470:1263 with SMTP id a12-20020a05610234cc00b0043b54701263mr1957298vst.35.1686354830388; Fri, 09 Jun 2023 16:53:50 -0700 (PDT) MIME-Version: 1.0 References: <20230330183911.12640-1-kmatsui@cs.washington.edu> <20230402075314.39853-1-kmatsui@cs.washington.edu> <20230402075314.39853-5-kmatsui@cs.washington.edu> <80fa68bb-8849-f5f8-328a-5e3404f1ae12@idea> In-Reply-To: <80fa68bb-8849-f5f8-328a-5e3404f1ae12@idea> From: Ken Matsui Date: Fri, 9 Jun 2023 16:53:39 -0700 Message-ID: Subject: Re: [PATCH v3 4/6] libstdc++: use new built-in trait __is_function for std::is_function To: Patrick Palka Cc: gcc-patches@gcc.gnu.org, libstdc++@gcc.gnu.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-8.9 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,T_SCC_BODY_TEXT_LINE 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: On Fri, Jun 9, 2023 at 10:54=E2=80=AFAM Patrick Palka w= rote: > > On Sun, 2 Apr 2023, Ken Matsui via Gcc-patches wrote: > > > This patch gets std::is_function to dispatch to new built-in trait > > __is_function. > > For std::is_function and other predicate-like type traits, I think we als= o > want to make the corresponding variable template is_function_v directly > use the built-in too. Oh, thank you! Will implement it! > > > > libstdc++-v3/ChangeLog: > > > > * include/std/type_traits (is_function): Use __is_function built-= in > > trait. > > > > Signed-off-by: Ken Matsui > > --- > > libstdc++-v3/include/std/type_traits | 7 +++++++ > > 1 file changed, 7 insertions(+) > > > > diff --git a/libstdc++-v3/include/std/type_traits b/libstdc++-v3/includ= e/std/type_traits > > index 58a732735c8..9eafd6b16f2 100644 > > --- a/libstdc++-v3/include/std/type_traits > > +++ b/libstdc++-v3/include/std/type_traits > > @@ -594,6 +594,12 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION > > { }; > > > > /// is_function > > +#if __has_builtin(__is_function) > > + template > > + struct is_function > > + : public __bool_constant<__is_function(_Tp)> > > + { }; > > +#else > > template > > struct is_function > > : public __bool_constant::value> { }; > > @@ -605,6 +611,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION > > template > > struct is_function<_Tp&&> > > : public false_type { }; > > +#endif > > > > #define __cpp_lib_is_null_pointer 201309L > > > > -- > > 2.40.0 > > > > >