r278981 - in /trunk/libstdc++-v3: ChangeLog inc...

redi@gcc.gnu.org redi@gcc.gnu.org
Thu Dec 5 00:42:00 GMT 2019


Author: redi
Date: Thu Dec  5 00:42:06 2019
New Revision: 278981

URL: https://gcc.gnu.org/viewcvs?rev=278981&root=gcc&view=rev
Log:
libstdc++: Implement spaceship for std::array (P1614R2)

As done for std::pair, this defines operator<=> as a non-member function
template and does not alter operator==, as expected to be proposed as
the resolution to an unpublished LWG issue.

Instead of calling std::lexicographical_compare_three_way the <=>
overload is implemented by hand to take advantage of the fact the
element types and array sizes are known to be the same.

	* include/bits/cpp_type_traits.h (__is_byte<char8_t>): Add
	specialization.
	* include/std/array (operator<=>): Likewise.
	* testsuite/23_containers/array/comparison_operators/constexpr.cc:
	Test three-way comparisons and arrays of unsigned char.
	* testsuite/23_containers/array/tuple_interface/get_neg.cc: Adjust
	dg-error line numbers.

Modified:
    trunk/libstdc++-v3/ChangeLog
    trunk/libstdc++-v3/include/bits/cpp_type_traits.h
    trunk/libstdc++-v3/include/std/array
    trunk/libstdc++-v3/testsuite/23_containers/array/comparison_operators/constexpr.cc
    trunk/libstdc++-v3/testsuite/23_containers/array/tuple_interface/get_neg.cc



More information about the Libstdc++-cvs mailing list