This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] Simplify the base characteristics for some type traits


This removes some seemingly redundant conditions from a few traits. If
__is_trivially_assignable correctly checks the assignable condition as
well as triviality, then we don't need is_assignable explicitly.  Does
anybody see a problem with that

I added some extra tests for cases that had been problematic with
__is_trivially_constructible.

We can definitely do that change for is_trivially_constructible,
because Ville fixed the intrinsic recently (PR 86398)

It also simplifies some others to replace
integral_constant<bool, foo<T>::value> with the equivalent
foo<T>::type, or to replace integral_constant<bool, !foo<T>::value>
with the equivalent __not_<foo<T>>::type.

I also started a wholesale replacement of integral_constant<bool, X>
with __bool_constant<X> but backed that out again. It's a fair bit of
churn for not much benefit (the two cases I did change allow better
line wrapping which makes me a happy boy).

	* include/std/type_traits (__is_member_object_pointer_helper): Use
	__not_<is_function<_Tp>>::type instead of integral_constant.
	(__is_member_function_pointer_helper): Likewise for
	is_function<_Tp>::type.
	(is_compund): Likewise for __not_<is_fundamental<_Tp>>::type.
	(__do_is_nt_destructible_impl): Use __bool_constant and reindent.
	(is_trivially_constructible): Remove redundant use of
	is_constructible.
	(__is_trivially_copy_assignable_impl): Remove redundant use of
	is_copy_assignable.
	(__is_trivially_move_assignable_impl): Remove redundant use of
	is_move_assignable.
	(is_trivially_destructible): Use __bool_constant.
	* testsuite/20_util/is_trivially_assignable/value.cc: Add some more
	tests for scalar types.

Tested powerpc64le-linux.


Attachment: patch.txt
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]