/
IsExplicitlyDereferenced.xml
71 lines (60 loc) · 4.81 KB
/
IsExplicitlyDereferenced.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
<Type Name="IsExplicitlyDereferenced" FullName="System.Runtime.CompilerServices.IsExplicitlyDereferenced">
<TypeSignature Language="C#" Value="public static class IsExplicitlyDereferenced" />
<TypeSignature Language="ILAsm" Value=".class public auto ansi abstract sealed beforefieldinit IsExplicitlyDereferenced extends System.Object" />
<TypeSignature Language="DocId" Value="T:System.Runtime.CompilerServices.IsExplicitlyDereferenced" />
<TypeSignature Language="VB.NET" Value="Public Class IsExplicitlyDereferenced" />
<TypeSignature Language="F#" Value="type IsExplicitlyDereferenced = class" />
<TypeSignature Language="C++ CLI" Value="public ref class IsExplicitlyDereferenced abstract sealed" />
<AssemblyInfo>
<AssemblyName>System.Runtime.CompilerServices.VisualC</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.1.1.0</AssemblyVersion>
<AssemblyVersion>4.1.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="netstandard" FromVersion="2.1.0.0" To="System.Runtime.CompilerServices.VisualC" ToVersion="5.0.0.0" FrameworkAlternate="net-5.0" />
<TypeForwarding From="netstandard" FromVersion="2.1.0.0" To="System.Runtime.CompilerServices.VisualC" ToVersion="6.0.0.0" FrameworkAlternate="net-6.0" />
<TypeForwarding From="netstandard" FromVersion="2.1.0.0" To="System.Runtime.CompilerServices.VisualC" ToVersion="7.0.0.0" FrameworkAlternate="net-7.0" />
<TypeForwarding From="netstandard" FromVersion="2.1.0.0" To="System.Runtime.CompilerServices.VisualC" ToVersion="8.0.0.0" FrameworkAlternate="net-8.0" />
<TypeForwarding From="netstandard" FromVersion="2.1.0.0" To="System.Runtime.CompilerServices.VisualC" ToVersion="9.0.0.0" FrameworkAlternate="net-9.0" />
</TypeForwardingChain>
<Base>
<BaseTypeName>System.Object</BaseTypeName>
</Base>
<Interfaces />
<Docs>
<summary>Indicates that a managed pointer represents a pointer parameter within a method signature. This class cannot be inherited.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
In C++, managed pointers and managed references are emitted into metadata as pointers. To distinguish between the two types in metadata, the Microsoft C++ compiler applies this modifier to managed pointers. It emits no modifier on managed reference types. Compilers need to know the correct calling syntax when importing a method from metadata scope. The <xref:System.Runtime.CompilerServices.IsExplicitlyDereferenced> class and its partner, the <xref:System.Runtime.CompilerServices.IsImplicitlyDereferenced> class, disambiguate reference parameters from pointer parameters.
Compilers emit custom modifiers within metadata to change the way that the just-in-time (JIT) compiler handles values when the default behavior is not appropriate. When the JIT compiler encounters a custom modifier, it handles the value in the way that the modifier specifies. Compilers can apply custom modifiers to methods, parameters, and return values. The JIT compiler must respond to required modifiers but can ignore optional modifiers.
You can emit custom modifiers into metadata using one of the following techniques:
- Using methods in the <xref:System.Reflection.Emit.TypeBuilder> class such as <xref:System.Reflection.Emit.TypeBuilder.DefineMethod%2A>, <xref:System.Reflection.Emit.TypeBuilder.DefineField%2A>, <xref:System.Reflection.Emit.TypeBuilder.DefineConstructor%2A>, and <xref:System.Reflection.Emit.TypeBuilder.DefineProperty%2A>.
- Generating a Microsoft intermediate language (MSIL) instruction file that contains calls to `modopt` and `modreq`, and assembling the file with the [Ilasm.exe (IL Assembler)](/dotnet/framework/tools/ilasm-exe-il-assembler).
- Using the unmanaged reflection API.
## Examples
The following example demonstrates how to emit an <xref:System.Runtime.CompilerServices.IsExplicitlyDereferenced> object into an assembly using reflection.
:::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/Runtime.CompilerServices.IsExplicitlyDereferenced/cpp/sample.cpp" id="Snippet1":::
]]></format>
</remarks>
</Docs>
<Members />
</Type>