From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 7934) id E84B73857B82; Thu, 11 Jan 2024 04:09:19 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E84B73857B82 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1704946159; bh=JkYgHEI4d0/pKHyS1YGfNpVPc5/iFtb8pPSeFTaWYr4=; h=From:To:Subject:Date:From; b=A0BXQUbomWhysNqfqviGe8fi9vVDh8lesWNpkxBGYaRpjMQBU+1fJy8NxSS0FsEbB O+KkaiojCZ6WcXqWobqQkDvxtAwxikrYafVeov/i8qqi0VoM6hMUHVcxckA1dQ6MLM bmX4rXOetfrtSTxZs9XxYDYwFFwH1pJ47OVqhuR0= MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Ken Matsui To: gcc-cvs@gcc.gnu.org, libstdc++-cvs@gcc.gnu.org Subject: [gcc r14-7127] libstdc++: Optimize std::is_compound compilation performance X-Act-Checkin: gcc X-Git-Author: Ken Matsui X-Git-Refname: refs/heads/master X-Git-Oldrev: 49a14ee488b8569abe318ca230ab115c36ca6b0c X-Git-Newrev: 2105c49bbe826733eef5ab06d505d9345710f8d7 Message-Id: <20240111040919.E84B73857B82@sourceware.org> Date: Thu, 11 Jan 2024 04:09:19 +0000 (GMT) List-Id: https://gcc.gnu.org/g:2105c49bbe826733eef5ab06d505d9345710f8d7 commit r14-7127-g2105c49bbe826733eef5ab06d505d9345710f8d7 Author: Ken Matsui Date: Mon Jul 17 23:47:15 2023 -0700 libstdc++: Optimize std::is_compound compilation performance This patch optimizes the compilation performance of std::is_compound. libstdc++-v3/ChangeLog: * include/std/type_traits (is_compound): Do not use __not_. (is_compound_v): Use is_fundamental_v instead. Signed-off-by: Ken Matsui Diff: --- libstdc++-v3/include/std/type_traits | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libstdc++-v3/include/std/type_traits b/libstdc++-v3/include/std/type_traits index 1cec0822b73..b6b680a3c58 100644 --- a/libstdc++-v3/include/std/type_traits +++ b/libstdc++-v3/include/std/type_traits @@ -751,7 +751,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION /// is_compound template struct is_compound - : public __not_>::type { }; + : public __bool_constant::value> { }; /// is_member_pointer #if _GLIBCXX_USE_BUILTIN_TRAIT(__is_member_pointer) @@ -3305,7 +3305,7 @@ template template inline constexpr bool is_scalar_v = is_scalar<_Tp>::value; template - inline constexpr bool is_compound_v = is_compound<_Tp>::value; + inline constexpr bool is_compound_v = !is_fundamental_v<_Tp>; #if _GLIBCXX_USE_BUILTIN_TRAIT(__is_member_pointer) template