aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKen Matsui <kmatsui@gcc.gnu.org>2023-07-17 23:47:15 -0700
committerKen Matsui <kmatsui@gcc.gnu.org>2024-01-10 20:08:26 -0800
commit2105c49bbe826733eef5ab06d505d9345710f8d7 (patch)
tree48f30dbacad55b5f56f072afbb42a2aba9605804
parent49a14ee488b8569abe318ca230ab115c36ca6b0c (diff)
downloadgcc-2105c49bbe826733eef5ab06d505d9345710f8d7.zip
gcc-2105c49bbe826733eef5ab06d505d9345710f8d7.tar.gz
gcc-2105c49bbe826733eef5ab06d505d9345710f8d7.tar.bz2
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>
-rw-r--r--libstdc++-v3/include/std/type_traits4
1 files changed, 2 insertions, 2 deletions
diff --git a/libstdc++-v3/include/std/type_traits b/libstdc++-v3/include/std/type_traits
index 1cec082..b6b680a 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>