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]

[committed] libstdc++: Implement "Safe Integral Comparisons" (P0586R2)


	* include/std/type_traits (__is_standard_integer): New helper trait.
	* include/std/utility (cmp_equal, cmp_not_equal, cmp_less, cmp_greater)
	(cmp_less_equal, cmp_greater_equal, in_range): Define for C++20.
	* include/std/version (__cpp_lib_integer_comparison_functions): Define.
	* testsuite/20_util/integer_comparisons/1.cc: New test.
	* testsuite/20_util/integer_comparisons/2.cc: New test.
	* testsuite/20_util/integer_comparisons/equal.cc: New test.
	* testsuite/20_util/integer_comparisons/equal_neg.cc: New test.
	* testsuite/20_util/integer_comparisons/greater_equal.cc: New test.
	* testsuite/20_util/integer_comparisons/greater_equal_neg.cc: New test.
	* testsuite/20_util/integer_comparisons/greater_neg.cc: New test.
	* testsuite/20_util/integer_comparisons/in_range.cc: New test.
	* testsuite/20_util/integer_comparisons/in_range_neg.cc: New test.
	* testsuite/20_util/integer_comparisons/less.cc: New test.
	* testsuite/20_util/integer_comparisons/less_equal.cc: New test.
	* testsuite/20_util/integer_comparisons/less_equal_neg.cc: New test.
	* testsuite/20_util/integer_comparisons/less_neg.cc: New test.
	* testsuite/20_util/integer_comparisons/not_equal.cc: New test.
	* testsuite/20_util/integer_comparisons/not_equal_neg.cc: New test.

Tested powerpc64le-linux, committed to master.

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]