public inbox for libstdc++-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r14-7127] libstdc++: Optimize std::is_compound compilation performance
@ 2024-01-11  4:09 Ken Matsui
  0 siblings, 0 replies; only message in thread
From: Ken Matsui @ 2024-01-11  4:09 UTC (permalink / raw)
  To: gcc-cvs, libstdc++-cvs

https://gcc.gnu.org/g:2105c49bbe826733eef5ab06d505d9345710f8d7

commit r14-7127-g2105c49bbe826733eef5ab06d505d9345710f8d7
Author: Ken Matsui <kmatsui@gcc.gnu.org>
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 <kmatsui@gcc.gnu.org>

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<typename _Tp>
     struct is_compound
-    : public __not_<is_fundamental<_Tp>>::type { };
+    : public __bool_constant<!is_fundamental<_Tp>::value> { };
 
   /// is_member_pointer
 #if _GLIBCXX_USE_BUILTIN_TRAIT(__is_member_pointer)
@@ -3305,7 +3305,7 @@ template <typename _Tp>
 template <typename _Tp>
   inline constexpr bool is_scalar_v = is_scalar<_Tp>::value;
 template <typename _Tp>
-  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 <typename _Tp>

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2024-01-11  4:09 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-01-11  4:09 [gcc r14-7127] libstdc++: Optimize std::is_compound compilation performance Ken Matsui

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).