How to add LanguagePrimitives.GenericZero / get_Zero to System.String?

后端 未结 1 1571
忘了有多久
忘了有多久 2021-01-12 02:51

Note: I added a lot of Of interest comments at the end. These are not mean to suggest that one should use inline and static type parameters

相关标签:
1条回答
  • 2021-01-12 03:30

    Extension members aren't considered as part of member constraint resolution, so you're out of luck. With constraints that involve more than one type (such as the constraint on (+)), you can work around this via the use of a second type, but for the constraint on GenericZero there's no good workaround.

    0 讨论(0)
提交回复
热议问题