Redigera

Dela via


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

Definition

Returns a value that indicates whether a specified managed pointer is greater than another specified managed pointer.

public:
generic <typename T>
 static bool IsAddressGreaterThan(T % left, T % right);
public static bool IsAddressGreaterThan<T> (ref T left, ref T right);
static member IsAddressGreaterThan : 'T * 'T -> bool
Public Shared Function IsAddressGreaterThan(Of T) (ByRef left As T, ByRef right As T) As Boolean

Type Parameters

T

The elemental type of the managed pointer.

Parameters

left
T

The first managed pointer to compare.

right
T

The second managed pointer to compare.

Returns

true if left is greater than right; otherwise, false.

Remarks

This check is conceptually similar to (void*)(&left) > (void*)(&right).

The return value of this method is a moment-in-time result. If left and right each reference different objects in GC-managed address space, the GC could relocate items between calls, causing the result of this method to change.

The return value is guaranteed stable if left and right point to the same managed object.

Applies to