-
Notifications
You must be signed in to change notification settings - Fork 1.6k
/
Copy pathNullable.xml
368 lines (343 loc) · 24.9 KB
/
Nullable.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
<Type Name="Nullable" FullName="System.Nullable">
<TypeSignature Language="C#" Value="public static class Nullable" />
<TypeSignature Language="ILAsm" Value=".class public auto ansi abstract sealed beforefieldinit Nullable extends System.Object" />
<TypeSignature Language="DocId" Value="T:System.Nullable" />
<TypeSignature Language="VB.NET" Value="Public Class Nullable" />
<TypeSignature Language="F#" Value="type Nullable = class" />
<TypeSignature Language="C++ CLI" Value="public ref class Nullable abstract sealed" />
<AssemblyInfo>
<AssemblyName>System.Runtime</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
<AssemblyVersion>4.0.20.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
<AssemblyVersion>4.2.1.0</AssemblyVersion>
<AssemblyVersion>4.2.2.0</AssemblyVersion>
<AssemblyVersion>5.0.0.0</AssemblyVersion>
<AssemblyVersion>6.0.0.0</AssemblyVersion>
<AssemblyVersion>7.0.0.0</AssemblyVersion>
<AssemblyVersion>8.0.0.0</AssemblyVersion>
<AssemblyVersion>9.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<TypeForwardingChain>
<TypeForwarding From="mscorlib" FromVersion="4.0.0.0" To="System.Runtime" ToVersion="0.0.0.0" FrameworkAlternate="dotnet-uwp-10.0" />
<TypeForwarding From="netstandard" FromVersion="2.1.0.0" To="System.Runtime" ToVersion="5.0.0.0" FrameworkAlternate="net-5.0" />
<TypeForwarding From="netstandard" FromVersion="2.1.0.0" To="System.Runtime" ToVersion="6.0.0.0" FrameworkAlternate="net-6.0" />
<TypeForwarding From="netstandard" FromVersion="2.1.0.0" To="System.Runtime" ToVersion="7.0.0.0" FrameworkAlternate="net-7.0" />
<TypeForwarding From="netstandard" FromVersion="2.1.0.0" To="System.Runtime" ToVersion="8.0.0.0" FrameworkAlternate="net-8.0" />
<TypeForwarding From="netstandard" FromVersion="2.1.0.0" To="System.Runtime" ToVersion="9.0.0.0" FrameworkAlternate="net-9.0" />
<TypeForwarding From="System.Runtime" FromVersion="4.1.1.1" To="mscorlib" ToVersion="4.0.0.0" FrameworkAlternate="netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netframework-4.8.1" />
</TypeForwardingChain>
<Base>
<BaseTypeName>System.Object</BaseTypeName>
</Base>
<Interfaces />
<Attributes>
<Attribute FrameworkAlternate="netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netframework-4.8.1">
<AttributeName Language="C#">[System.Runtime.InteropServices.ComVisible(true)]</AttributeName>
<AttributeName Language="F#">[<System.Runtime.InteropServices.ComVisible(true)>]</AttributeName>
</Attribute>
</Attributes>
<Docs>
<summary>Supports a value type that can be assigned <see langword="null" />. This class cannot be inherited.</summary>
<remarks>For more information about this API, see <see href="/dotnet/fundamentals/runtime-libraries/system-nullable">Supplemental API remarks for Nullable</see>.</remarks>
<altmember cref="T:System.Nullable`1" />
<related type="Article" href="/dotnet/csharp/language-reference/builtin-types/nullable-value-types">Nullable Types (C# Programming Guide)</related>
<related type="Article" href="/dotnet/visual-basic/programming-guide/language-features/data-types/nullable-value-types">Nullable Value Types (Visual Basic)</related>
</Docs>
<Members>
<Member MemberName="Compare<T>">
<MemberSignature Language="C#" Value="public static int Compare<T> (T? n1, T? n2) where T : struct;" />
<MemberSignature Language="ILAsm" Value=".method public static hidebysig int32 Compare<struct .ctor (class System.ValueType) T>(valuetype System.Nullable`1<!!T> n1, valuetype System.Nullable`1<!!T> n2) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Nullable.Compare``1(System.Nullable{``0},System.Nullable{``0})" />
<MemberSignature Language="VB.NET" Value="Public Shared Function Compare(Of T As Structure) (n1 As Nullable(Of T), n2 As Nullable(Of T)) As Integer" />
<MemberSignature Language="F#" Value="static member Compare : Nullable<'T (requires 'T : struct)> * Nullable<'T (requires 'T : struct)> -> int (requires 'T : struct)" Usage="System.Nullable.Compare (n1, n2)" />
<MemberSignature Language="C++ CLI" Value="public:
generic <typename T>
 where T : value class static int Compare(Nullable<T> n1, Nullable<T> n2);" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Runtime</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
<AssemblyVersion>4.0.20.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
<AssemblyVersion>4.2.1.0</AssemblyVersion>
<AssemblyVersion>4.2.2.0</AssemblyVersion>
<AssemblyVersion>5.0.0.0</AssemblyVersion>
<AssemblyVersion>6.0.0.0</AssemblyVersion>
<AssemblyVersion>7.0.0.0</AssemblyVersion>
<AssemblyVersion>8.0.0.0</AssemblyVersion>
<AssemblyVersion>9.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netframework-4.8.1">
<AttributeName Language="C#">[System.Runtime.InteropServices.ComVisible(true)]</AttributeName>
<AttributeName Language="F#">[<System.Runtime.InteropServices.ComVisible(true)>]</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Int32</ReturnType>
</ReturnValue>
<TypeParameters>
<TypeParameter Name="T">
<Constraints>
<ParameterAttribute>DefaultConstructorConstraint</ParameterAttribute>
<ParameterAttribute>NotNullableValueTypeConstraint</ParameterAttribute>
<BaseTypeName>System.ValueType</BaseTypeName>
</Constraints>
</TypeParameter>
</TypeParameters>
<Parameters>
<Parameter Name="n1" Type="System.Nullable<T>" />
<Parameter Name="n2" Type="System.Nullable<T>" />
</Parameters>
<Docs>
<typeparam name="T">The underlying value type of the <paramref name="n1" /> and <paramref name="n2" /> parameters.</typeparam>
<param name="n1">A <see cref="T:System.Nullable`1" /> object.</param>
<param name="n2">A <see cref="T:System.Nullable`1" /> object.</param>
<summary>Compares the relative values of two <see cref="T:System.Nullable`1" /> objects.</summary>
<returns>An integer that indicates the relative values of the <paramref name="n1" /> and <paramref name="n2" /> parameters.
<list type="table"><listheader><term> Return Value
</term><description> Description
</description></listheader><item><term> Less than zero
</term><description> The <see cref="P:System.Nullable`1.HasValue" /> property for <paramref name="n1" /> is <see langword="false" />, and the <see cref="P:System.Nullable`1.HasValue" /> property for <paramref name="n2" /> is <see langword="true" />, or the <see cref="P:System.Nullable`1.HasValue" /> properties for <paramref name="n1" /> and <paramref name="n2" /> are <see langword="true" />, and the value of the <see cref="P:System.Nullable`1.Value" /> property for <paramref name="n1" /> is less than the value of the <see cref="P:System.Nullable`1.Value" /> property for <paramref name="n2" />.
</description></item><item><term> Zero
</term><description> The <see cref="P:System.Nullable`1.HasValue" /> properties for <paramref name="n1" /> and <paramref name="n2" /> are <see langword="false" />, or the <see cref="P:System.Nullable`1.HasValue" /> properties for <paramref name="n1" /> and <paramref name="n2" /> are <see langword="true" />, and the value of the <see cref="P:System.Nullable`1.Value" /> property for <paramref name="n1" /> is equal to the value of the <see cref="P:System.Nullable`1.Value" /> property for <paramref name="n2" />.
</description></item><item><term> Greater than zero
</term><description> The <see cref="P:System.Nullable`1.HasValue" /> property for <paramref name="n1" /> is <see langword="true" />, and the <see cref="P:System.Nullable`1.HasValue" /> property for <paramref name="n2" /> is <see langword="false" />, or the <see cref="P:System.Nullable`1.HasValue" /> properties for <paramref name="n1" /> and <paramref name="n2" /> are <see langword="true" />, and the value of the <see cref="P:System.Nullable`1.Value" /> property for <paramref name="n1" /> is greater than the value of the <see cref="P:System.Nullable`1.Value" /> property for <paramref name="n2" />.
</description></item></list></returns>
<remarks>To be added.</remarks>
</Docs>
</Member>
<Member MemberName="Equals<T>">
<MemberSignature Language="C#" Value="public static bool Equals<T> (T? n1, T? n2) where T : struct;" />
<MemberSignature Language="ILAsm" Value=".method public static hidebysig bool Equals<struct .ctor (class System.ValueType) T>(valuetype System.Nullable`1<!!T> n1, valuetype System.Nullable`1<!!T> n2) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Nullable.Equals``1(System.Nullable{``0},System.Nullable{``0})" />
<MemberSignature Language="VB.NET" Value="Public Shared Function Equals(Of T As Structure) (n1 As Nullable(Of T), n2 As Nullable(Of T)) As Boolean" />
<MemberSignature Language="F#" Value="static member Equals : Nullable<'T (requires 'T : struct)> * Nullable<'T (requires 'T : struct)> -> bool (requires 'T : struct)" Usage="System.Nullable.Equals (n1, n2)" />
<MemberSignature Language="C++ CLI" Value="public:
generic <typename T>
 where T : value class static bool Equals(Nullable<T> n1, Nullable<T> n2);" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Runtime</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
<AssemblyVersion>4.0.20.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
<AssemblyVersion>4.2.1.0</AssemblyVersion>
<AssemblyVersion>4.2.2.0</AssemblyVersion>
<AssemblyVersion>5.0.0.0</AssemblyVersion>
<AssemblyVersion>6.0.0.0</AssemblyVersion>
<AssemblyVersion>7.0.0.0</AssemblyVersion>
<AssemblyVersion>8.0.0.0</AssemblyVersion>
<AssemblyVersion>9.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netframework-4.8.1">
<AttributeName Language="C#">[System.Runtime.InteropServices.ComVisible(true)]</AttributeName>
<AttributeName Language="F#">[<System.Runtime.InteropServices.ComVisible(true)>]</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Boolean</ReturnType>
</ReturnValue>
<TypeParameters>
<TypeParameter Name="T">
<Constraints>
<ParameterAttribute>DefaultConstructorConstraint</ParameterAttribute>
<ParameterAttribute>NotNullableValueTypeConstraint</ParameterAttribute>
<BaseTypeName>System.ValueType</BaseTypeName>
</Constraints>
</TypeParameter>
</TypeParameters>
<Parameters>
<Parameter Name="n1" Type="System.Nullable<T>" />
<Parameter Name="n2" Type="System.Nullable<T>" />
</Parameters>
<Docs>
<typeparam name="T">The underlying value type of the <paramref name="n1" /> and <paramref name="n2" /> parameters.</typeparam>
<param name="n1">A <see cref="T:System.Nullable`1" /> object.</param>
<param name="n2">A <see cref="T:System.Nullable`1" /> object.</param>
<summary>Indicates whether two specified <see cref="T:System.Nullable`1" /> objects are equal.</summary>
<returns>
<see langword="true" /> if the <paramref name="n1" /> parameter is equal to the <paramref name="n2" /> parameter; otherwise, <see langword="false" />.
The return value depends on the <see cref="P:System.Nullable`1.HasValue" /> and <see cref="P:System.Nullable`1.Value" /> properties of the two parameters that are compared.
<list type="table"><listheader><term> Return Value
</term><description> Description
</description></listheader><item><term><see langword="true" /></term><description> The <see cref="P:System.Nullable`1.HasValue" /> properties for <paramref name="n1" /> and <paramref name="n2" /> are <see langword="false" />, or the <see cref="P:System.Nullable`1.HasValue" /> properties for <paramref name="n1" /> and <paramref name="n2" /> are <see langword="true" />, and the <see cref="P:System.Nullable`1.Value" /> properties of the parameters are equal.
</description></item><item><term><see langword="false" /></term><description> The <see cref="P:System.Nullable`1.HasValue" /> property is <see langword="true" /> for one parameter and <see langword="false" /> for the other parameter, or the <see cref="P:System.Nullable`1.HasValue" /> properties for <paramref name="n1" /> and <paramref name="n2" /> are <see langword="true" />, and the <see cref="P:System.Nullable`1.Value" /> properties of the parameters are unequal.
</description></item></list></returns>
<remarks>To be added.</remarks>
</Docs>
</Member>
<Member MemberName="GetUnderlyingType">
<MemberSignature Language="C#" Value="public static Type GetUnderlyingType (Type nullableType);" FrameworkAlternate="dotnet-uwp-10.0;netcore-1.0;netcore-1.1;netcore-2.0;netcore-2.1;netcore-2.2;netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netframework-4.8.1;netstandard-1.0;netstandard-1.1;netstandard-1.2;netstandard-1.3;netstandard-1.4;netstandard-1.5;netstandard-1.6;netstandard-2.0;netstandard-2.1" />
<MemberSignature Language="ILAsm" Value=".method public static hidebysig class System.Type GetUnderlyingType(class System.Type nullableType) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Nullable.GetUnderlyingType(System.Type)" />
<MemberSignature Language="VB.NET" Value="Public Shared Function GetUnderlyingType (nullableType As Type) As Type" />
<MemberSignature Language="F#" Value="static member GetUnderlyingType : Type -> Type" Usage="System.Nullable.GetUnderlyingType nullableType" />
<MemberSignature Language="C++ CLI" Value="public:
 static Type ^ GetUnderlyingType(Type ^ nullableType);" />
<MemberSignature Language="C#" Value="public static Type? GetUnderlyingType (Type nullableType);" FrameworkAlternate="net-5.0;net-6.0;net-7.0;net-8.0;net-9.0;netcore-3.0;netcore-3.1" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Runtime</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
<AssemblyVersion>4.0.20.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
<AssemblyVersion>4.2.1.0</AssemblyVersion>
<AssemblyVersion>4.2.2.0</AssemblyVersion>
<AssemblyVersion>5.0.0.0</AssemblyVersion>
<AssemblyVersion>6.0.0.0</AssemblyVersion>
<AssemblyVersion>7.0.0.0</AssemblyVersion>
<AssemblyVersion>8.0.0.0</AssemblyVersion>
<AssemblyVersion>9.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="net-8.0;net-9.0">
<AttributeName Language="C#">[System.Runtime.CompilerServices.NullableContext(1)]</AttributeName>
<AttributeName Language="F#">[<System.Runtime.CompilerServices.NullableContext(1)>]</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Type</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="nullableType" Type="System.Type" />
</Parameters>
<Docs>
<param name="nullableType">A <see cref="T:System.Type" /> object that describes a closed generic nullable type.</param>
<summary>Returns the underlying type argument of the specified nullable type.</summary>
<returns>The type argument of the <paramref name="nullableType" /> parameter, if the <paramref name="nullableType" /> parameter is a closed generic nullable type; otherwise, <see langword="null" />.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
A generic type definition is a type declaration, such as <xref:System.Nullable%601>, that contains a type parameter list, and the type parameter list declares one or more type parameters. A closed generic type is a type declaration where a particular type is specified for a type parameter.
For example, if the `nullableType` parameter is the type of `Nullable<Int32>` in C# (`Nullable(Of Int32)` in Visual Basic), the return value is the type of <xref:System.Int32> (that is, the type argument of the closed generic type).
## Examples
The following code example defines a method whose return value is of type <xref:System.Nullable%601> of <xref:System.Int32>. The code example uses the <xref:System.Nullable.GetUnderlyingType%2A> method to display the type argument of the return value.
:::code language="csharp" source="~/snippets/csharp/System/Nullable/GetUnderlyingType/gut.cs" interactive="try-dotnet" id="Snippet1":::
:::code language="fsharp" source="~/snippets/fsharp/System/Nullable/GetUnderlyingType/gut.fs" id="Snippet1":::
:::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR_System/system.nullable_GetUnderlyingType/vb/gut.vb" id="Snippet1":::
]]></format>
</remarks>
<exception cref="T:System.ArgumentNullException">
<paramref name="nullableType" /> is <see langword="null" />.</exception>
</Docs>
</Member>
<Member MemberName="GetValueRefOrDefaultRef<T>">
<MemberSignature Language="C#" Value="public static ref readonly T GetValueRefOrDefaultRef<T> (in T? nullable) where T : struct;" FrameworkAlternate="net-7.0" />
<MemberSignature Language="ILAsm" Value=".method public static hidebysig !!T GetValueRefOrDefaultRef<struct .ctor (class System.ValueType) T>([in]valuetype System.Nullable`1<!!T>& nullable) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Nullable.GetValueRefOrDefaultRef``1(System.Nullable{``0}@)" />
<MemberSignature Language="VB.NET" Value="Public Shared Function GetValueRefOrDefaultRef(Of T As Structure) (ByRef nullable As Nullable(Of T)) As T" />
<MemberSignature Language="F#" Value="static member GetValueRefOrDefaultRef : Nullable -> 'T (requires 'T : struct)" Usage="System.Nullable.GetValueRefOrDefaultRef nullable" />
<MemberSignature Language="C++ CLI" Value="public:
generic <typename T>
 where T : value class static T& ^ GetValueRefOrDefaultRef(Nullable<T> % nullable);" />
<MemberSignature Language="C#" Value="public static ref readonly T GetValueRefOrDefaultRef<T> (ref T? nullable) where T : struct;" FrameworkAlternate="net-8.0;net-9.0" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Runtime</AssemblyName>
<AssemblyVersion>7.0.0.0</AssemblyVersion>
<AssemblyVersion>8.0.0.0</AssemblyVersion>
<AssemblyVersion>9.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
</AssemblyInfo>
<ReturnValue RefType="Readonly">
<ReturnType>T</ReturnType>
<Attributes>
<Attribute FrameworkAlternate="net-7.0">
<AttributeName Language="C#">[System.Runtime.CompilerServices.IsReadOnly]</AttributeName>
<AttributeName Language="F#">[<System.Runtime.CompilerServices.IsReadOnly>]</AttributeName>
</Attribute>
</Attributes>
</ReturnValue>
<TypeParameters>
<TypeParameter Name="T">
<Constraints>
<ParameterAttribute>DefaultConstructorConstraint</ParameterAttribute>
<ParameterAttribute>NotNullableValueTypeConstraint</ParameterAttribute>
<BaseTypeName>System.ValueType</BaseTypeName>
</Constraints>
</TypeParameter>
</TypeParameters>
<Parameters>
<Parameter Name="nullable" Type="System.Nullable<T>" RefType="ref" Index="0" FrameworkAlternate="net-7.0;net-8.0;net-9.0">
<Attributes>
<Attribute FrameworkAlternate="net-7.0">
<AttributeName Language="C#">[System.Runtime.CompilerServices.IsReadOnly]</AttributeName>
<AttributeName Language="F#">[<System.Runtime.CompilerServices.IsReadOnly>]</AttributeName>
</Attribute>
<Attribute FrameworkAlternate="net-8.0;net-9.0">
<AttributeName Language="C#">[System.Runtime.CompilerServices.RequiresLocation]</AttributeName>
<AttributeName Language="F#">[<System.Runtime.CompilerServices.RequiresLocation>]</AttributeName>
</Attribute>
</Attributes>
</Parameter>
</Parameters>
<Docs>
<typeparam name="T">The underlying value type of the <see cref="T:System.Nullable`1" /> generic type.</typeparam>
<param name="nullable">The readonly reference to the input <see cref="T:System.Nullable`1" /> value.</param>
<summary>Retrieves a readonly reference to the location in the <see cref="T:System.Nullable`1" /> instance where the value is stored.</summary>
<returns>A readonly reference to the location where the instance's <typeparamref name="T" /> value is stored. If the instance's <see cref="P:System.Nullable`1.HasValue" /> is <see langword="false" />, the current value at that location may be the default value.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
As the returned readonly reference refers to data that is stored in the input `nullable` value, this method should only ever be
called when the input reference points to a value with an actual location and not an "rvalue" (an expression that may appear on the right side but not left side of an assignment). That is, if this API is called and the input reference
points to a value that is produced by the compiler as a defensive copy or a temporary copy, the behavior might not match the desired one.
]]></format>
</remarks>
</Docs>
</Member>
</Members>
</Type>