Unsafe.AreSame<T>(T, T) Method

Definition

Determines whether the specified managed pointers point to the same location.

C#
public static bool AreSame<T>(ref T left, ref T right);

Type Parameters

T

The elemental type of the managed pointers.

Parameters

left
T

The first managed pointer to compare.

right
T

The second managed pointer to compare.

Returns

true if left and right point to the same location; otherwise, false.

Applies to

Product Versions
.NET Core 1.1, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10
.NET Standard 2.0 (package-provided)