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

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

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

    One of the prominent additions coming with the C++20 programming language is the consistent comparison operator, or "spaceship operator" as it's commonly referred to. The support was merged for GCC 10 last month ahead of entering stage three development while this week some more improvements were made to the implementation...

    http://www.phoronix.com/scan.php?pag...eship-Operator

  • #2
    What's next? Fish Operator (><>)? Shrug Operator (¯\_(ツ)_/¯)?

    I have an idea but I don't want to say it...

    Comment


    • #3
      "We've received this comment from NASA about the crash of their latest Space Shuttle launch:"

      Originally posted by NASA
      We had a bug in the way we used the spaceship operator. Unfortunately, the spaceshuttle operator is only due to land in C++23 and only MSVC++ supports it at the moment, so we couldn't have used that instead.

      Comment


      • #4
        Originally posted by tildearrow View Post
        What's next?
        In C++23, a new operator @('_')@ has been proposed to facilitate monkey patching.

        Comment


        • #5
          Originally posted by tildearrow View Post
          What's next? Fish Operator (><>)? Shrug Operator (¯\_(ツ)_/¯)?

          I have an idea but I don't want to say it...
          Perhaps the Elvis operator?

          Comment


          • #6
            Great, I look forward to ripping this one out of the code written by interns so that we can get our projects to compile on compilers we actually use :/

            I suppose C is the language aiming at lifespan. C++ is becoming a bit of a random rule soup. Every gimmicky operator like this wrecks havoc with our safety / debug std library.

            Comment


            • #7
              Originally posted by kpedersen View Post
              I suppose C is the language aiming at lifespan. C++ is becoming a bit of a random rule soup. Every gimmicky operator like this wrecks havoc with our safety / debug std library.
              ... you have a custom std for debugging? What could go wrong.

              Comment


              • #8
                Originally posted by kpedersen View Post
                Great, I look forward to ripping this one out of the code written by interns so that we can get our projects to compile on compilers we actually use :/
                You let your interns submit code that doesn't compile (on the compilers you support)? You don't make them use the correct software/compilers?

                Comment


                • #9
                  Originally posted by AsuMagic View Post

                  Perhaps the Elvis operator?
                  Has been at least supported by GCC at least for years if not decades, by making the second argument of a tertiary operator optional.

                  Comment


                  • #10
                    looking at http://www.open-std.org/jtc1/sc22/wg...17/p0515r3.pdf it looks like "a<=>b" would return something like "a-b" for arithmetic-capable types, and just the sign corresponding to that operation if the types are comparable but not substractible. I was not familiar with this operator.

                    Comment

                    Working...
                    X