otherwise how do you differentiate Get on PtrType<T> vs Get on PtrType<Ptr<T>>
otherwise how do you differentiate Get on PtrType<T> vs Get on PtrType<Ptr<T>>
Get<T>(this Ptr<T> x) where T does not allow ref structs as a genericPtrType/Ptr and also ConstPtrType/ConstPtrAsPtr method on the thing you want to take a ref to"), the SDP requires docs and unless we want to ignore our approved proposals we are not allowed to ship without docs.Quoted by kaijellinghaus#0000
Ptr<T> type instead of an array, I would be very confusedPtr<T> causes more problems than it solvesGet<T>(this Ptr<T> x)TPtrTypePtrConstPtrTypeConstPtrAsPtr// However, there are some caveats to this:
// - We use local functions in addition to the generic typeof(T) == typeof(whatever) pattern to work around some
// unfortunate inlining issues in platforms older that .NET 5, where the inliner was going over budget despite
// aggressively inlined functions supposedly being exempt from budgeting.
// See also: https://github.com/dotnet/runtime/issues/38106Ptr<T>Ptr<T>public static class PtrAccessor
{
public static PtrType<T2> Get<T2, T>(this PtrType<T> self, int i)
where T: IPtrMarker<T2>
{
// IDK take an index and do magic with the inner of PtrType
throw null;
}
public static PtrType<T3> Get<T3, T2, T>(this PtrType<T> self, int i, int j)
where T: IPtrMarker<T2>
where T2: IPtrMarker<T3>
{
return self.Get(i).Get(j);
}
}