Item 19: Ensure That 0 Is a Valid State for Value Types(Effective C#)
摘要:
The system initializes all instances of value types to 0. There is no way toprevent users from creating instances of value types that are all 0s. If possible,make the all 0 case the natural default. As a special case, enums usedas flags should ensure that 0 is the absence of all flags. 阅读全文
posted @ 2011-02-09 21:22 Ray Z 阅读(125) 评论(0) 推荐(0) 编辑