C# - Why does a class, new() constraint use Activator.CreateInstance<T>()? [duplicate]
问题 This question already has answers here : Why does the c# compiler emit Activator.CreateInstance when calling new in with a generic type with a new() constraint? (5 answers) Closed 3 years ago . I just asked C# - How do generics with the new() constraint get machine code generated? After thinking about this for a while, I'm wondering why the C# Compiler emitted IL like that. Why couldn't it say some IL like: "Call T's default constructor"? 回答1: There is no such instruction in CIL (http://www