C++20: Optimized Comparison with the Spaceship Operator

In this post, I conclude my miniseries on the three-way comparison operator with a few subtle details. The subtle details include the compiler-generated == and != operators and the interplay of classical comparison operators, and the three-way comparison operator.

Read more
Tags: Spaceship
Views: 15533

C++20: More Details to the Spaceship Operator

The compiler performs cleverly when it generates all six comparison operators. Ultimately, you get intuitive and efficient comparison operators for free. Let me dive into this post into the details of the spaceship operator.

Read more
Tags: Spaceship
Views: 46958

C++20: The Three-Way Comparison Operator

The three-way comparison operator <=> is often just called the spaceship operator. The spaceship operator determines whether A < B, A = B, or A > B for two values, A and B. You can define the spaceship operator, or the compiler can auto-generate it.

Read more
Tags: Spaceship
Views: 123159

Stay Informed about my Mentoring



English Books

Course: Modern C++ Concurrency in Practice

Course: C++ Standard Library including C++14 & C++17

Course: Embedded Programming with Modern C++

Course: Generic Programming (Templates)

Course: C++ Fundamentals for Professionals

Course: The All-in-One Guide to C++20

Course: Master Software Design Patterns and Architecture in C++

Subscribe to the newsletter (+ pdf bundle)

All tags

Blog archive

Source Code


Today 2195

Yesterday 4344

Week 39073

Month 19319

All 12097528

Currently are 136 guests and no members online

Kubik-Rubik Joomla! Extensions

Latest comments