diff options
author | Ken Matsui <kmatsui@gcc.gnu.org> | 2023-07-14 19:55:35 -0700 |
---|---|---|
committer | Ken Matsui <kmatsui@gcc.gnu.org> | 2023-08-11 17:54:45 -0700 |
commit | 066c260ad09dde95f43e503f7242b011d17a10f6 (patch) | |
tree | ae3f0cf470cc82b5661663e3f450de82851bdd45 /libstdc++-v3/include | |
parent | 685abdb4a1fe46a12da5cc9ae1d5aaef9344a339 (diff) | |
download | gcc-066c260ad09dde95f43e503f7242b011d17a10f6.zip gcc-066c260ad09dde95f43e503f7242b011d17a10f6.tar.gz gcc-066c260ad09dde95f43e503f7242b011d17a10f6.tar.bz2 |
libstdc++: Use __bool_constant entirely
This patch uses __bool_constant entirely instead of integral_constant<bool>
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 <kmatsui@gcc.gnu.org>
Reviewed-by: Jonathan Wakely <jwakely@redhat.com>
Diffstat (limited to 'libstdc++-v3/include')
-rw-r--r-- | libstdc++-v3/include/std/type_traits | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/libstdc++-v3/include/std/type_traits b/libstdc++-v3/include/std/type_traits index 9f08699..7dc5791 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<bool, true>; - - /// The type used as a compile-time boolean with false value. - using false_type = integral_constant<bool, false>; - /// @cond undocumented /// bool_constant for C++11 template<bool __v> using __bool_constant = integral_constant<bool, __v>; /// @endcond + /// The type used as a compile-time boolean with true value. + using true_type = __bool_constant<true>; + + /// The type used as a compile-time boolean with false value. + using false_type = __bool_constant<false>; + #if __cplusplus >= 201703L # define __cpp_lib_bool_constant 201505L /// Alias template for compile-time boolean constant types. /// @since C++17 template<bool __v> - using bool_constant = integral_constant<bool, __v>; + using bool_constant = __bool_constant<__v>; #endif // Metaprogramming helper types. |