From: Ken Matsui Date: Tue, 18 Jul 2023 06:47:15 +0000 (-0700) Subject: libstdc++: Optimize std::is_compound compilation performance X-Git-Tag: basepoints/gcc-15~3012 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2105c49bbe826733eef5ab06d505d9345710f8d7;p=thirdparty%2Fgcc.git 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 --git a/libstdc++-v3/include/std/type_traits b/libstdc++-v3/include/std/type_traits index 1cec0822b73a..b6b680a3c583 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