12[
TypeForwardedFrom(
"mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089")]
13public readonly
struct IntPtr :
IEquatable<nint>,
IComparable,
IComparable<nint>,
ISpanFormattable,
IFormattable,
ISerializable,
IBinaryInteger<nint>,
IBinaryNumber<nint>,
IBitwiseOperators<nint, nint, nint>,
INumber<nint>,
IAdditionOperators<nint, nint, nint>,
IAdditiveIdentity<nint, nint>,
IComparisonOperators<nint, nint>,
IEqualityOperators<nint, nint>,
IDecrementOperators<nint>,
IDivisionOperators<nint, nint, nint>,
IIncrementOperators<nint>,
IModulusOperators<nint, nint, nint>,
IMultiplicativeIdentity<nint, nint>,
IMultiplyOperators<nint, nint, nint>,
ISpanParseable<nint>,
IParseable<nint>,
ISubtractionOperators<nint, nint, nint>,
IUnaryNegationOperators<nint, nint>,
IUnaryPlusOperators<nint, nint>,
IShiftOperators<nint, nint>,
IMinMaxValue<nint>,
ISignedNumber<nint>
15 private unsafe readonly
void*
_value;
34 return (
IntPtr)
long.MaxValue;
43 return (
IntPtr)
long.MinValue;
47 [
RequiresPreviewFeatures(
"Generic Math is in preview.", Url =
"https://aka.ms/dotnet-warnings/generic-math-preview")]
50 [
RequiresPreviewFeatures(
"Generic Math is in preview.", Url =
"https://aka.ms/dotnet-warnings/generic-math-preview")]
53 [
RequiresPreviewFeatures(
"Generic Math is in preview.", Url =
"https://aka.ms/dotnet-warnings/generic-math-preview")]
56 [
RequiresPreviewFeatures(
"Generic Math is in preview.", Url =
"https://aka.ms/dotnet-warnings/generic-math-preview")]
59 [
RequiresPreviewFeatures(
"Generic Math is in preview.", Url =
"https://aka.ms/dotnet-warnings/generic-math-preview")]
62 [
RequiresPreviewFeatures(
"Generic Math is in preview.", Url =
"https://aka.ms/dotnet-warnings/generic-math-preview")]
65 [
RequiresPreviewFeatures(
"Generic Math is in preview.", Url =
"https://aka.ms/dotnet-warnings/generic-math-preview")]
89 long @
int =
info.GetInt64(
"value");
117 return (
int)num ^ (int)(num >> 32);
162 long num = (long)
value._value;
169 return (nint)
value._value;
249 return ((
long)
_value).ToString();
279 return (
IntPtr)
long.Parse(
s, style);
321 [
RequiresPreviewFeatures(
"Generic Math is in preview.", Url =
"https://aka.ms/dotnet-warnings/generic-math-preview")]
327 [
RequiresPreviewFeatures(
"Generic Math is in preview.", Url =
"https://aka.ms/dotnet-warnings/generic-math-preview")]
334 [
RequiresPreviewFeatures(
"Generic Math is in preview.", Url =
"https://aka.ms/dotnet-warnings/generic-math-preview")]
341 [
RequiresPreviewFeatures(
"Generic Math is in preview.", Url =
"https://aka.ms/dotnet-warnings/generic-math-preview")]
348 [
RequiresPreviewFeatures(
"Generic Math is in preview.", Url =
"https://aka.ms/dotnet-warnings/generic-math-preview")]
355 [
RequiresPreviewFeatures(
"Generic Math is in preview.", Url =
"https://aka.ms/dotnet-warnings/generic-math-preview")]
362 [
RequiresPreviewFeatures(
"Generic Math is in preview.", Url =
"https://aka.ms/dotnet-warnings/generic-math-preview")]
368 [
RequiresPreviewFeatures(
"Generic Math is in preview.", Url =
"https://aka.ms/dotnet-warnings/generic-math-preview")]
379 [
RequiresPreviewFeatures(
"Generic Math is in preview.", Url =
"https://aka.ms/dotnet-warnings/generic-math-preview")]
385 [
RequiresPreviewFeatures(
"Generic Math is in preview.", Url =
"https://aka.ms/dotnet-warnings/generic-math-preview")]
391 [
RequiresPreviewFeatures(
"Generic Math is in preview.", Url =
"https://aka.ms/dotnet-warnings/generic-math-preview")]
397 [
RequiresPreviewFeatures(
"Generic Math is in preview.", Url =
"https://aka.ms/dotnet-warnings/generic-math-preview")]
403 [
RequiresPreviewFeatures(
"Generic Math is in preview.", Url =
"https://aka.ms/dotnet-warnings/generic-math-preview")]
409 [
RequiresPreviewFeatures(
"Generic Math is in preview.", Url =
"https://aka.ms/dotnet-warnings/generic-math-preview")]
412 return left <= right;
415 [
RequiresPreviewFeatures(
"Generic Math is in preview.", Url =
"https://aka.ms/dotnet-warnings/generic-math-preview")]
421 [
RequiresPreviewFeatures(
"Generic Math is in preview.", Url =
"https://aka.ms/dotnet-warnings/generic-math-preview")]
424 return left >= right;
427 [
RequiresPreviewFeatures(
"Generic Math is in preview.", Url =
"https://aka.ms/dotnet-warnings/generic-math-preview")]
433 [
RequiresPreviewFeatures(
"Generic Math is in preview.", Url =
"https://aka.ms/dotnet-warnings/generic-math-preview")]
439 [
RequiresPreviewFeatures(
"Generic Math is in preview.", Url =
"https://aka.ms/dotnet-warnings/generic-math-preview")]
442 return left == right;
445 [
RequiresPreviewFeatures(
"Generic Math is in preview.", Url =
"https://aka.ms/dotnet-warnings/generic-math-preview")]
448 return left != right;
451 [
RequiresPreviewFeatures(
"Generic Math is in preview.", Url =
"https://aka.ms/dotnet-warnings/generic-math-preview")]
457 [
RequiresPreviewFeatures(
"Generic Math is in preview.", Url =
"https://aka.ms/dotnet-warnings/generic-math-preview")]
463 [
RequiresPreviewFeatures(
"Generic Math is in preview.", Url =
"https://aka.ms/dotnet-warnings/generic-math-preview")]
469 [
RequiresPreviewFeatures(
"Generic Math is in preview.", Url =
"https://aka.ms/dotnet-warnings/generic-math-preview")]
475 [
RequiresPreviewFeatures(
"Generic Math is in preview.", Url =
"https://aka.ms/dotnet-warnings/generic-math-preview")]
482 [
RequiresPreviewFeatures(
"Generic Math is in preview.", Url =
"https://aka.ms/dotnet-warnings/generic-math-preview")]
487 return (
byte)(object)
value;
491 return (
char)(object)
value;
497 return (nint)(long)(decimal)(object)
value;
501 return (nint)(double)(
object)
value;
505 return (
short)(object)
value;
509 return (
int)(object)
value;
513 return (nint)(long)(
object)
value;
521 return (sbyte)(object)
value;
525 return (nint)(float)(
object)
value;
529 return (ushort)(object)
value;
533 return (nint)(uint)(
object)
value;
537 return (nint)(ulong)(
object)
value;
549 [
RequiresPreviewFeatures(
"Generic Math is in preview.", Url =
"https://aka.ms/dotnet-warnings/generic-math-preview")]
554 return (
byte)(object)
value;
558 return (
char)(object)
value;
562 decimal num = (decimal)(
object)
value;
563 if (!(num > (decimal)(long)
MaxValue))
565 if (!(num < (decimal)(long)
MinValue))
567 return (nint)(long)num;
588 return (
short)(object)
value;
592 return (
int)(object)
value;
613 return (sbyte)(object)
value;
630 return (ushort)(object)
value;
664 [
RequiresPreviewFeatures(
"Generic Math is in preview.", Url =
"https://aka.ms/dotnet-warnings/generic-math-preview")]
669 return (
byte)(object)
value;
673 return (
char)(object)
value;
677 return (nint)(long)(decimal)(object)
value;
681 return (nint)(double)(
object)
value;
685 return (
short)(object)
value;
689 return (
int)(object)
value;
693 return (nint)(long)(
object)
value;
701 return (sbyte)(object)
value;
705 return (nint)(float)(
object)
value;
709 return (ushort)(object)
value;
713 return (nint)(uint)(
object)
value;
717 return (nint)(ulong)(
object)
value;
727 [
RequiresPreviewFeatures(
"Generic Math is in preview.", Url =
"https://aka.ms/dotnet-warnings/generic-math-preview")]
733 [
RequiresPreviewFeatures(
"Generic Math is in preview.", Url =
"https://aka.ms/dotnet-warnings/generic-math-preview")]
739 [
RequiresPreviewFeatures(
"Generic Math is in preview.", Url =
"https://aka.ms/dotnet-warnings/generic-math-preview")]
745 [
RequiresPreviewFeatures(
"Generic Math is in preview.", Url =
"https://aka.ms/dotnet-warnings/generic-math-preview")]
751 [
RequiresPreviewFeatures(
"Generic Math is in preview.", Url =
"https://aka.ms/dotnet-warnings/generic-math-preview")]
757 [
RequiresPreviewFeatures(
"Generic Math is in preview.", Url =
"https://aka.ms/dotnet-warnings/generic-math-preview")]
764 [
RequiresPreviewFeatures(
"Generic Math is in preview.", Url =
"https://aka.ms/dotnet-warnings/generic-math-preview")]
769 result = (byte)(
object)
value;
774 result = (char)(
object)
value;
779 decimal num = (decimal)(
object)
value;
785 result = (nint)(
long)num;
806 result = (int)(
object)
value;
827 result = (sbyte)(
object)
value;
843 result = (ushort)(
object)
value;
884 [
RequiresPreviewFeatures(
"Generic Math is in preview.", Url =
"https://aka.ms/dotnet-warnings/generic-math-preview")]
890 [
RequiresPreviewFeatures(
"Generic Math is in preview.", Url =
"https://aka.ms/dotnet-warnings/generic-math-preview")]
896 [
RequiresPreviewFeatures(
"Generic Math is in preview.", Url =
"https://aka.ms/dotnet-warnings/generic-math-preview")]
902 [
RequiresPreviewFeatures(
"Generic Math is in preview.", Url =
"https://aka.ms/dotnet-warnings/generic-math-preview")]
908 [
RequiresPreviewFeatures(
"Generic Math is in preview.", Url =
"https://aka.ms/dotnet-warnings/generic-math-preview")]
914 [
RequiresPreviewFeatures(
"Generic Math is in preview.", Url =
"https://aka.ms/dotnet-warnings/generic-math-preview")]
920 [
RequiresPreviewFeatures(
"Generic Math is in preview.", Url =
"https://aka.ms/dotnet-warnings/generic-math-preview")]
926 [
RequiresPreviewFeatures(
"Generic Math is in preview.", Url =
"https://aka.ms/dotnet-warnings/generic-math-preview")]
932 [
RequiresPreviewFeatures(
"Generic Math is in preview.", Url =
"https://aka.ms/dotnet-warnings/generic-math-preview")]
938 [
RequiresPreviewFeatures(
"Generic Math is in preview.", Url =
"https://aka.ms/dotnet-warnings/generic-math-preview")]
944 [
RequiresPreviewFeatures(
"Generic Math is in preview.", Url =
"https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool Is64BitProcess
static byte Clamp(byte value, byte min, byte max)
static byte Min(byte val1, byte val2)
static double Abs(double value)
static int DivRem(int a, int b, out int result)
static int Sign(decimal value)
static byte Max(byte val1, byte val2)
static int TrailingZeroCount(int value)
static bool IsPow2(int value)
static int PopCount(uint value)
static int Log2(uint value)
static uint RotateRight(uint value, int offset)
static int LeadingZeroCount(uint value)
static uint RotateLeft(uint value, int offset)
static string Arg_MustBeIntPtr
static void ThrowNotSupportedException(ExceptionResource resource)
static void ThrowValueArgumentOutOfRange_NeedNonNegNumException()
static TResult AdditiveIdentity
static TSelf RotateRight(TSelf value, int rotateAmount)
static TSelf LeadingZeroCount(TSelf value)
static TSelf PopCount(TSelf value)
static TSelf TrailingZeroCount(TSelf value)
static TSelf RotateLeft(TSelf value, int rotateAmount)
static bool IsPow2(TSelf value)
static TSelf Log2(TSelf value)
static TResult MultiplicativeIdentity
static TSelf Max(TSelf x, TSelf y)
static bool TryParse([NotNullWhen(true)] string? s, NumberStyles style, IFormatProvider? provider, out TSelf result)
static TSelf Parse(string s, NumberStyles style, IFormatProvider? provider)
static TSelf Sign(TSelf value)
static TSelf Min(TSelf x, TSelf y)
static TSelf Abs(TSelf value)
static TSelf Clamp(TSelf value, TSelf min, TSelf max)
static bool TryParse([NotNullWhen(true)] string? s, IFormatProvider? provider, out TSelf result)
static TSelf Parse(string s, IFormatProvider? provider)
static bool TryParse(ReadOnlySpan< char > s, IFormatProvider? provider, out TSelf result)
static TSelf Parse(ReadOnlySpan< char > s, IFormatProvider? provider)
void GetObjectData(SerializationInfo info, StreamingContext context)
static bool TryParse(ReadOnlySpan< char > s, NumberStyles style, IFormatProvider? provider, out IntPtr result)
unsafe int CompareTo(object? value)
static IntPtr Add(IntPtr pointer, int offset)
static unsafe IntPtr operator-(IntPtr pointer, int offset)
static bool TryParse([NotNullWhen(true)] string? s, NumberStyles style, IFormatProvider? provider, out IntPtr result)
unsafe bool Equals(IntPtr other)
static unsafe IntPtr operator+(IntPtr pointer, int offset)
static IntPtr Parse(string s, NumberStyles style)
unsafe string ToString(string? format, IFormatProvider? provider)
static nint IMinMaxValue< IntPtr >. MinValue
unsafe override string ToString()
static bool TryParse([NotNullWhen(true)] string? s, out IntPtr result)
unsafe override bool Equals([NotNullWhen(true)] object? obj)
unsafe string ToString(IFormatProvider? provider)
static readonly IntPtr Zero
static unsafe bool operator!=(IntPtr value1, IntPtr value2)
unsafe IntPtr(long value)
static nint nint Remainder INumber< IntPtr >. DivRem(nint left, nint right)
static IntPtr Parse(string s, NumberStyles style, IFormatProvider? provider)
static IntPtr Parse(string s)
static bool TryParse(ReadOnlySpan< char > s, out IntPtr result)
unsafe int CompareTo(IntPtr value)
static nint IMinMaxValue< IntPtr >. MaxValue
static unsafe bool operator==(IntPtr value1, IntPtr value2)
static IntPtr Subtract(IntPtr pointer, int offset)
unsafe bool TryFormat(Span< char > destination, out int charsWritten, ReadOnlySpan< char > format=default(ReadOnlySpan< char >), IFormatProvider? provider=null)
unsafe IntPtr(SerializationInfo info, StreamingContext context)
unsafe IntPtr(void *value)
unsafe override int GetHashCode()
unsafe readonly void * _value
unsafe string ToString(string? format)
unsafe void * ToPointer()
static IntPtr Parse(ReadOnlySpan< char > s, NumberStyles style=NumberStyles.Integer, IFormatProvider? provider=null)
static IntPtr Parse(string s, IFormatProvider? provider)