c# - 枚举作为通用约束 : What's the Reason Microsoft Didn't Want to Implement It?

标签 c# enums

我意识到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/

相关文章:

c# - 如何在 C# 中找出字典值的并集?

c# - 依赖于 C++/CLI DLL 的 .NET 程序集的搜索路径

c++ - 错误 C2511 : overloaded member function not found in Class

java - 使用鼠标监听器创建主菜单

python - 如何使用基于 ctypes 和 ctypes 的枚举正确调用以 "custom enum"作为参数的函数?

vb.net - 随机数生成器 VB.NET 出现问题

c# - 将 WatiN 附加到 Firefox

c# - REQ/REP 模式中的 ZeroMQ FiniteStateMachineException

c# - 在 System.Data.SqlDbType 和 Microsoft.SqlServer.Management.Smo.SqlDataType 之间转换

c# - 如何保护网页