GCC 10's C++20 "Spaceship Operator" Support Appears To Be In Good Shape

The C++20 spaceship operator allows for easily performing a three-way comparison as a single operation. The behavior and syntax is the same as found in PHP7 and other programming languages with <=>.
The C++20 spaceship operator support was merged in early November for GCC 10. The commits this week meanwhile allow the operator to be used with std::pair and std::array, among other related commits in recent weeks.
See the GCC C++ status page for the state of C++20/C++2A with GCC 10. Most C++20 functionality is already in place even on GCC 8/9 but some pieces remain around atomic compare-and-exchange with padding bits, modules support, coroutines, using enum, and more implicit moves.
30 Comments