From: Ken Matsui Date: Sat, 15 Jul 2023 02:55:35 +0000 (-0700) Subject: libstdc++: Use __bool_constant entirely X-Git-Tag: basepoints/gcc-15~6965 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=066c260ad09dde95f43e503f7242b011d17a10f6;p=thirdparty%2Fgcc.git libstdc++: Use __bool_constant entirely This patch uses __bool_constant entirely instead of integral_constant in the type_traits header, specifically for true_type, false_type, and bool_constant. libstdc++-v3/ChangeLog: * include/std/type_traits (true_type): Use __bool_constant instead. (false_type): Likewise. (bool_constant): Likewise. Signed-off-by: Ken Matsui Reviewed-by: Jonathan Wakely --- diff --git a/libstdc++-v3/include/std/type_traits b/libstdc++-v3/include/std/type_traits index 9f086992ebcc..7dc5791a7c5e 100644 --- a/libstdc++-v3/include/std/type_traits +++ b/libstdc++-v3/include/std/type_traits @@ -78,24 +78,24 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION constexpr _Tp integral_constant<_Tp, __v>::value; #endif - /// The type used as a compile-time boolean with true value. - using true_type = integral_constant; - - /// The type used as a compile-time boolean with false value. - using false_type = integral_constant; - /// @cond undocumented /// bool_constant for C++11 template using __bool_constant = integral_constant; /// @endcond + /// The type used as a compile-time boolean with true value. + using true_type = __bool_constant; + + /// The type used as a compile-time boolean with false value. + using false_type = __bool_constant; + #if __cplusplus >= 201703L # define __cpp_lib_bool_constant 201505L /// Alias template for compile-time boolean constant types. /// @since C++17 template - using bool_constant = integral_constant; + using bool_constant = __bool_constant<__v>; #endif // Metaprogramming helper types.