My understanding is that Parameterless constructors in structs are now allowed.
But the following gives me a compile error in VS 2015 Community
public struct Person
{
public string Name { get; }
public int Age { get; }
public Person(string name, int age) { Name = name; Age = age; }
public Person() : this("Jane Doe", 37) { }
}
Error: "Structs cannot contain explicit parameterless constructors"
Anyone know why?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…