c# swap operator

josh BAUER 166 Reputation points
class ww
    static public bool operator <==>(ww firstParam,ww secondParam ){
        return false;

I do like above swaping operator. In c++ it would work fine because swaping operators
were introduced in c++ version15.

By swaping I mean to exchange two values.

How to do <=> operator in c#?

If it is not yet possible, would Microsoft make it possible same like they did it for c++?

An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
8,138 questions
0 comments No comments
{count} votes

1 additional answer

Sort by: Most helpful
  1. Viorel 94,021 Reputation points

    Could you show a reference (documentation) for swapping operators in C++?

    There is also a new “<=>” operator in C++, but it does not perform swapping. The equivalent in C# is the IComparable interface, I think.