Announcements

To be on our mailing list, join the Google Group at this link


April 17, 2025: Back to Basics: The <=> Spaceship Operator

Time and Location

THURSDAY, April 17, 2025 at 6:30 PM to 8:00 PM

Please be aware of and adhere to the Microsoft Reactor Code of Conduct

In Person:
Microsoft Redmond Reactor | 3709 157th Ave NE, Redmond, WA 98052
Conf Room 20/1143 (12) Maple Reactor

Remote:
On Line Using Microsoft Teams
Meeting ID: 239 620 662 099
Passcode: sK7CD3At

Call in (audio only)
+1 323-849-4874
Phone Conference ID: 539 711 210#

Title

Back to Basics: The <=> Spaceship Operator

Abstract

The three-way operator <=>, also commonly referred to as the spaceship operator, was added to the C++ Standard in C++20. Prior to C++ 20, definitions of all six individual comparison operators (==, !=, <, >, <=, >=) were required in a class to cover every contingency. From a logic point of view, if the == operator and the < operator were defined, the remaining remaining operators could be expressed in terms of these two operators, but separate implementations of all were still required. Starting in C++20, this is all streamlined thanks to the spaceship operator.

Coverage in books and other educational resources, however, seems to be limited, with the discussion often confined to default cases without much in the way of thorough coverage. In this talk, we will work our way from the basics through examples of full user-defined implementations of the <=> operator on a class.

Speaker Bio

Daniel Hanson is a former full-time lecturer in the Computational Finance & Risk Management program within the Department of Applied Mathematics at the University of Washington. His appointment followed over 25 years of experience in private sector quantitative development in finance and data science. He currently serves as the Student Program Coordinator for CppCon.

Post Meeting Social

Following the official meeting folks are welcome to wander over to the Coffee Haus at the Overlake Red Robin (148th Ave and 24th) to continue chatting until they close the doors!

A Word From Our Sponsor

Please thank Microsoft for sponsoring our meeting room and Teams account!

Resources

Coming Soon!