Unsafe.IsAddressLessThan<T>(T, T) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Returns a value that indicates whether a specified managed pointer is less than another specified managed pointer.
public:
generic <typename T>
static bool IsAddressLessThan(T % left, T % right);
public static bool IsAddressLessThan<T> (ref T left, ref T right);
static member IsAddressLessThan : 'T * 'T -> bool
Public Shared Function IsAddressLessThan(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 less 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.