Skip to content

Commit

Permalink
libstdc++: use new built-in trait __is_void for std::is_void
Browse files Browse the repository at this point in the history
This patch gets std::is_void to dispatch to new built-in trait __is_void.

libstdc++-v3/ChangeLog:

	* include/std/type_traits (is_void): Use __is_void built-in trait.

Signed-off-by: Ken Matsui <kmatsui@cs.washington.edu>
  • Loading branch information
ken-matsui authored and ouuleilei-bot committed Mar 30, 2023
1 parent 3e6797a commit 0363e29
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions libstdc++-v3/include/std/type_traits
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,12 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
// Primary type categories.

/// is_void
#if __has_builtin(__is_void)
template<typename _Tp>
struct is_void
: public __bool_constant<__is_void(_Tp)>
{ };
#else
template<typename _Tp>
struct is_void
: public false_type { };
Expand All @@ -313,6 +319,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
template<>
struct is_void<const volatile void>
: public true_type { };
#endif

/// @cond undocumented
template<typename>
Expand Down

0 comments on commit 0363e29

Please sign in to comment.