读书人

zz - Reprint - How do I create an i

发布时间: 2012-08-25 10:06:20 作者: rapoo

zz - Reprint - How do I create an immutable Class?

Guide lines to make a immutable C# classes.

?

the article is based on the post here:?http://stackoverflow.com/questions/352471/how-do-i-create-an-immutable-class

?

?

You cannot asssume that the C# language allows you to change the semantic of the assignment oprator, if is to copy the reference on the reference types, and to memberwise copy on the struct types.?

?

To make a class immutable in C#, you basically have to following the rules as follows.

?

?

?

I think you're on the right track -

读书人网 >编程

热点推荐