Type:Nullable`1: Difference between revisions

From Resonite Wiki
imported>Kisaragi marine
Created page with "{| class="wikitable" |- | Color | Type |- | style="background-color:{{Nullable-color}}" | | Nullable<nowiki><T></nowiki> |} A Nullable<nowiki><T></nowiki> is a type that repre..."
 
cleanup
 
(6 intermediate revisions by 4 users not shown)
Line 1: Line 1:
{| class="wikitable"
The '''Nullable&lt;T&gt;''' type is a C# construct that wraps around a non-nullable [https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/builtin-types/value-types C# value type] to allow the type to store an additional value--<code>null</code>--representing the absense of a value.
|-
 
| Color
Nullable types are a [[value type]] in the FrooxEngine data model, but an [[Type:Object|Object]] in the ProtoFlux data model.
| Type
 
|-
Nullable types are useful when one is unsure whether a value may or may not exist in the first place, rather than reling on some sort of default value that represents the absense of a value. In addition, whenever an "unset" state is useful to keep track of, nullables can come in handy.
| style="background-color:{{Nullable-color}}" |
 
| Nullable<nowiki><T></nowiki>
== See Also ==
|}
 
A Nullable<nowiki><T></nowiki> is a type that represents the value may be null.
* Microsoft's documentation on the [https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/builtin-types/nullable-value-types nullable value types] & [https://learn.microsoft.com/en-us/dotnet/csharp/nullable-references nullable reference types].
[[Category:Types]]
* Wikipedia's definition of [https://en.wikipedia.org/wiki/Nullable_type nullable types].
 
[[Category:Type]]
[[Category:Value Types]]

Latest revision as of 02:58, 10 December 2024

The Nullable<T> type is a C# construct that wraps around a non-nullable C# value type to allow the type to store an additional value--null--representing the absense of a value.

Nullable types are a value type in the FrooxEngine data model, but an Object in the ProtoFlux data model.

Nullable types are useful when one is unsure whether a value may or may not exist in the first place, rather than reling on some sort of default value that represents the absense of a value. In addition, whenever an "unset" state is useful to keep track of, nullables can come in handy.

See Also