C#中的> +和>是什么意思

naw*_*fal -2 .net c# operators

我不小心试过这个,编译!所以我想知道这可能是什么意思..谷歌没有帮助..

if (3 >+ 4)
   dothis() //this is never hit btw..

if (3 >- 4)
   dothis() //this is hit.
Run Code Online (Sandbox Code Playgroud)

两个代码编译btw ..

jas*_*son 10

它解析为

3 > +4
Run Code Online (Sandbox Code Playgroud)

3 > -4
Run Code Online (Sandbox Code Playgroud)

所以进入一元+一元运算-符.

如果你想要一个有趣的方式来探索这个,写

Expression<Func<int, int, bool>> func = (x, y) => x >+ y;
Run Code Online (Sandbox Code Playgroud)

然后func在调试器中探索生成的表达式树.你会在树中看到一元运算符.