How to declare a C# Record Type?

前端 未结 6 1622
日久生厌
日久生厌 2021-02-06 23:22

I read on a blog that C# 7 will feature record types

class studentInfo(string StudentFName, string StudentMName, string StudentLName);

However

6条回答
  •  猫巷女王i
    2021-02-07 00:10

    Record types were on the roadmap for C# 7.0, but were ultimately delayed until a later version of the language.

    To quote Mads Torgersen in reply to this blog post,

    [Primary constructors] are still on the radar, along with the related concept of record types (which we considered for C# 7.0), and I am hopeful that we can land on a better design – maybe one that encompasses both.

    As of C# 7's release, the GitHub proposal for this language feature still indicates that the implementation is "In Progress."

提交回复
热议问题