C++ Spaceship operator usage
C++20 introduced a new three-way comparison operator, also known as the spaceship operator. Here I explain how it works and show some simple examples. First, let’s take a look at some code, which I soon will explain: This code shows a simple three-way comparison of two integers. Since comparing the integers can have three different …