【发布时间】:2018-12-05 00:01:59
【问题描述】:
是否可以在 C# 中创建泛型方法并为给定类型添加具体实现? 例如:
void Foo<T>(T value) {
//add generic implementation
}
void Foo<int>(int value) {
//add implementation specific to int type
}
【问题讨论】:
-
我已经放弃了我的答案,我也投票关闭,因为不清楚你在问什么。好像是XY problem。