Why is there no const member method in C# and const parameter?

后端 未结 3 647

Unlike C++, there aren\'t any const member method and const parameters in C#. What is the reason?

3条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-12-09 17:35

    C# doesn't have it because .NET doesn't. .NET doesn't because the CLR development team decided it wasn't worth the effort.

    You can read on MS blogs like Raymond Chen's "The Old New Thing" or Eric Lippert's "Fabulous Adventures in Coding", how Microsoft prioritizes features.

提交回复
热议问题