From: Ken Matsui <kmatsui@cs.washington.edu>
To: libstdc++@gcc.gnu.org
Subject: Question about _GLIBCXX_HAVE_BUILTIN_IS_SAME
Date: Wed, 7 Feb 2024 13:58:33 -0800 [thread overview]
Message-ID: <sirw5skiqemdvyehahyuhudj7fy4e3hjidzgnfw6ofhzgy6giw@ojchughmbk5m> (raw)
Hi,
I found we are using _GLIBCXX_HAVE_BUILTIN_IS_SAME in type_traits, but I
think we can use _GLIBCXX_USE_BUILTIN_TRAIT(__is_same) instead. I feel
this is a bit more readable and consistent with other traits. With this
change, AFAIK, _GLIBCXX_HAVE_BUILTIN_IS_SAME is not used anywhere, but
can we completely remove it from gcc/libstdc++-v3/include/bits/c++config
or is there any reason to keep it?
/// is_same
+#if _GLIBCXX_USE_BUILTIN_TRAIT(__is_same)
template<typename _Tp, typename _Up>
struct is_same
-#ifdef _GLIBCXX_HAVE_BUILTIN_IS_SAME
: public __bool_constant<__is_same(_Tp, _Up)>
+ { };
#else
+ template<typename _Tp, typename _Up>
+ struct is_same
: public false_type
-#endif
{ };
-#ifndef _GLIBCXX_HAVE_BUILTIN_IS_SAME
template<typename _Tp>
struct is_same<_Tp, _Tp>
: public true_type
{ };
#endif
I am also wondering if we could replace other _GLIBCXX_HAVE_BUILTIN_*
macros with _GLIBCXX_USE_BUILTIN_TRAIT(*):
* _GLIBCXX_HAVE_BUILTIN_HAS_UNIQ_OBJ_REP
* _GLIBCXX_HAVE_BUILTIN_IS_AGGREGATE
* _GLIBCXX_HAVE_BUILTIN_LAUNDER
--
Ken Matsui
next reply other threads:[~2024-02-07 21:59 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-07 21:58 Ken Matsui [this message]
2024-02-08 0:13 ` Jonathan Wakely
2024-02-09 19:35 ` Ken Matsui
2024-02-13 23:34 ` Ken Matsui
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=sirw5skiqemdvyehahyuhudj7fy4e3hjidzgnfw6ofhzgy6giw@ojchughmbk5m \
--to=kmatsui@cs.washington.edu \
--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).