发明申请
- 专利标题: Generic representation of optional values
- 专利标题(中): 可选值的通用表示
-
申请号: US10891459申请日: 2004-07-14
-
公开(公告)号: US20060015528A1公开(公告)日: 2006-01-19
- 发明人: Anders Hejlsberg , Anthony Moore , Brian Grunkemeyer , Donald Box , Gang Peng , Krzysztof Cwalina
- 申请人: Anders Hejlsberg , Anthony Moore , Brian Grunkemeyer , Donald Box , Gang Peng , Krzysztof Cwalina
- 申请人地址: US WA Redmond
- 专利权人: Microsoft Corporation
- 当前专利权人: Microsoft Corporation
- 当前专利权人地址: US WA Redmond
- 主分类号: G06F17/00
- IPC分类号: G06F17/00
摘要:
A generic nullable type that is capable of representing null values for reference, value, and other types in a uniform manner is described. The nullable generic type includes at least two portions: a container portion and a Boolean member portion. The container portion can hold other objects of other types, including both reference and value types. The Boolean member portion indicates whether the type held by the container has a value or not. Specifically, when the Boolean member is true, the values of the general type held by the container are valid. When the Boolean member is false, the values of the general type are invalid or undefined to represent an unspecified or null condition. Stack memory usage for the nullable type, a comparison of two objects of the nullable type, and an example database manipulation using the nullable type are also described.