Šimon Tóth’s Post

View profile for Šimon Tóth

C++ Educational Content Creator | 20 years of Software Engineering experience distilled into digestible daily posts

The C++20 spaceship operator provides a three-way comparison, the result of which is then wrapped in an ordering type. The standard provides three ordering types because different types can only support some orderings. std::strong_ordering for which equality implies that the values are indistinguishable (i.e. if a == b, then f(a) == f(b)). std::weak_ordering allows equal, distinguishable values but doesn't permit uncomparable values. std::partial_ordering which allows uncomparable values (i.e. a < b, a > b and a == b all return false). Compiler Explorer link: https://lnkd.in/ej2U2QCv #cpp #cplusplus #coding #programming #dailybiteofcpp

  • text

The amount of C++ you read, write & share is just wild!

To view or add a comment, sign in

Explore content categories