我意识到enum
不能用作通用约束,并且Microsoft has declined to fix this bug 。
有什么理由吗?
最佳答案
您发布的链接说明了原因:
and is a somewhat arbitrary limitation of the language
可能会改变:
If we ever reopen constraints as a feature, this will be one of the things we will reevaluate. For the upcoming release we don't have the opportunity to add any more language features, so you'll see this resolved as "Won't Fix", but it remains on our lists for future consideration.
关于c# - 枚举作为通用约束 : What's the Reason Microsoft Didn't Want to Implement It?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2680801/