Nidze Asked:2024-11-03 00:38:10 +0800 CST2024-11-03 00:38:10 +0800 CST 2024-11-03 00:38:10 +0800 CST 创建一个构造函数来生成泛型类[重复] 772 private T Create<T>() { return new T(); { 我需要实现类似的东西,以便将泛型作为输入传递并接收该类的特定实例作为输出 c# 1 个回答 Voted Best Answer Faraday 2024-11-03T00:49:36+08:002024-11-03T00:49:36+08:00 进行类型约束 private T Create<T>() where T : new()
进行类型约束