Unsafe.IsAddressLessThan<T>(T, T) Method
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
- T
The elemental type of the managed pointer.
- left
- T
The first managed pointer to compare.
- right
- T
The second managed pointer to compare.
true
if left
is less than right
; otherwise, false
.
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.
Product | Versions |
---|---|
.NET | Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10 |
.NET Standard | 2.0 (package-provided) |
.NET feedback
.NET is an open source project. Select a link to provide feedback: