is unsafe code really that unavoidable?
is unsafe code really that unavoidable?
PointerLike being a type that can be implicitly converted to from a pointer, array, ref(???), span, etc
PointerLikevar array = new [] { 1, 2, 3, 4, 5 } // <-- Array
// ---^^^^^^^--- // <-- A "span" of elements: start index being 1, including 3 elements.
var span = array.AsSpan().Slice(1, 3); // <-- A span that represents the abovevoid SomeThing(int* a)
{
}
void SomeThing(PointerLike<int> a)
{
}