Why must C# operator overloads be static?

后端 未结 3 2038
孤城傲影
孤城傲影 2020-12-03 01:40

Why does C# require operator overloads to be static methods rather than member functions (like C++)? (Perhaps more specifically: what was the design motivation for this deci

3条回答
  •  眼角桃花
    2020-12-03 01:50

    Perhaps its best to think why should the methods not be static. There is no need for state and hence this.

提交回复
热议问题