using extension methods on int

后端 未结 7 1292
难免孤独
难免孤独 2021-02-19 04:10

I\'m reading about extension methods, and monkeying around with them to see how they work, and I tried this:

namespace clunk {
    public static class oog {
             


        
7条回答
  •  轻奢々
    轻奢々 (楼主)
    2021-02-19 04:35

    Unfortunately you cannot use extension methods to add operators, and implicit type conversion in C# is implemented as an operator.

提交回复
热议问题