是否有可能在C#中一个新的运营商?有可能、运营商

2023-09-02 21:20:31 作者:找不到籍口。

我知道你可以重载现有的运营商。我想知道是否有可能创建一个新的运营商。这是我的情景。

I know you can overload an existing operator. I want to know if it is possible to create a new operator. Here's my scenario.

我想这样的:

var x = (y < z) ? y : z;

要相当于这样的:

var x = y <? z;

换句话说,我想创建自己的&LT; 运营商

推荐答案

没有,那是不可能的。您将需要创建一个方法,而不是

No, it is not possible. You would need to create a method instead