Announcement

Collapse
No announcement yet.

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

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • #31
    Originally posted by Luke_Wolf View Post

    ...there's no reason that the starship operator should ever show up in caller code.
    This is especially true since you would write a beast such as:

    Code:
    if ((a <==> b) > 0)
    Which totally defeat the point of having a spaceship operator to correctly provide automatically generated operators such as >, >=, <, <= and ==.

    This operator is to be used to define other operators in classes. Define one and you'll get all the other for free. This seems like a win to me, especially in order to avoid silly copy'n'paste bugs here and there.

    Comment

    Working...
    X