public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Ken Matsui <kmatsui@gcc.gnu.org>
To: gcc-patches@gcc.gnu.org
Cc: libstdc++@gcc.gnu.org, Ken Matsui <kmatsui@gcc.gnu.org>
Subject: [PATCH] libstdc++: Use __bool_constant entirely
Date: Fri, 14 Jul 2023 20:01:56 -0700	[thread overview]
Message-ID: <20230715030156.26231-1-kmatsui@gcc.gnu.org> (raw)

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>
---
 libstdc++-v3/include/std/type_traits | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/libstdc++-v3/include/std/type_traits b/libstdc++-v3/include/std/type_traits
index 9f086992ebc..7dc5791a7c5 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.
-- 
2.41.0


             reply	other threads:[~2023-07-15  3:02 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-15  3:01 Ken Matsui [this message]
2023-08-08 20:07 ` Jonathan Wakely

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230715030156.26231-1-kmatsui@gcc.gnu.org \
    --to=kmatsui@gcc.gnu.org \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=libstdc++@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).