System.ThrowHelper.ThrowArgumentException_InvalidTypeWithPointersNotSupported C# (CSharp) Метод

ThrowArgumentException_InvalidTypeWithPointersNotSupported() статический приватный Метод

static private ThrowArgumentException_InvalidTypeWithPointersNotSupported ( Type type ) : void
type Type
Результат void
        internal static void ThrowArgumentException_InvalidTypeWithPointersNotSupported(Type type) { throw CreateArgumentException_InvalidTypeWithPointersNotSupported(type); }
        [MethodImpl(MethodImplOptions.NoInlining)]

Usage Example

Пример #1
0
        public static ReadOnlySpan <byte> AsBytes <T>(this ReadOnlySpan <T> source)
            where T : struct
        {
            if (!SpanHelpers.IsReferenceFree <T>())
            {
                ThrowHelper.ThrowArgumentException_InvalidTypeWithPointersNotSupported(typeof(T));
            }

            int newLength = checked (source.Length * Unsafe.SizeOf <T>());

            return(new ReadOnlySpan <byte>(Unsafe.As <Pinnable <byte> >(source.Pinnable), source.ByteOffset, newLength));
        }
All Usage Examples Of System.ThrowHelper::ThrowArgumentException_InvalidTypeWithPointersNotSupported