Skip to content
Snippets Groups Projects
Unverified Commit 066c260a authored by Ken Matsui's avatar Ken Matsui
Browse files

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: default avatarKen Matsui <kmatsui@gcc.gnu.org>
Reviewed-by: default avatarJonathan Wakely <jwakely@redhat.com>
parent 685abdb4
No related branches found
No related tags found
No related merge requests found
...@@ -78,24 +78,24 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -78,24 +78,24 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
constexpr _Tp integral_constant<_Tp, __v>::value; constexpr _Tp integral_constant<_Tp, __v>::value;
#endif #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 /// @cond undocumented
/// bool_constant for C++11 /// bool_constant for C++11
template<bool __v> template<bool __v>
using __bool_constant = integral_constant<bool, __v>; using __bool_constant = integral_constant<bool, __v>;
/// @endcond /// @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 #if __cplusplus >= 201703L
# define __cpp_lib_bool_constant 201505L # define __cpp_lib_bool_constant 201505L
/// Alias template for compile-time boolean constant types. /// Alias template for compile-time boolean constant types.
/// @since C++17 /// @since C++17
template<bool __v> template<bool __v>
using bool_constant = integral_constant<bool, __v>; using bool_constant = __bool_constant<__v>;
#endif #endif
// Metaprogramming helper types. // Metaprogramming helper types.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment