Skip to content

Latest commit

 

History

History
33 lines (24 loc) · 979 Bytes

PointerTypeReference.md

File metadata and controls

33 lines (24 loc) · 979 Bytes

PointerTypeReference

[Transformation Source]

This type represents pointers and C++ references. In the case of C++ references, WasReference will be true.

Example

Given the following C++ code:

int* GetIntPointer();
int& GetIntReference();

You can expect the following declaration tree after type reduction has ocurred:

TranslatedFunction GetIntPointer
    ReturnType: PointerTypeReference System.Int32* ☣
        Inner: CSharpBuiltinTypeReference System.Int32
TranslatedFunction GetIntReference
    ReturnType: PointerTypeReference System.Int32& (WasReference) ☣
        Inner: CSharpBuiltinTypeReference System.Int32

The corresponding C# variable definitions are:

public static extern int* GetIntPointer();
public static extern int* GetIntReference();