public Vec(T[] array) { if (array == null) { this = default; return; // returns default } if (default(T) == null && array.GetType() != typeof(T[])) { VecThrowHelper.ThrowArrayTypeMismatchException(); } _length = array.Length; _pinnable = Unsafe.As <Pinnable <T> >(array); _byteOffset = VecHelpers.PerTypeValues <T> .ArrayAdjustment; _runtimeTypeId = VecTypeHelper <T> .RuntimeVecInfo.RuntimeTypeId; }
// // Enable use of ThrowHelper from TryFormat() routines without introducing dozens of non-code-coveraged "bytesWritten = 0; return false" boilerplate. // public static bool TryFormatThrowFormatException(out int bytesWritten) { bytesWritten = 0; VecThrowHelper.ThrowFormatException_BadFormatSpecifier(); return(false); }