A struct
declared with the ref
modifier may not implement any interfaces and so can't implement IDisposable. Therefore, to enable a ref struct
to be disposed, it must have an accessible void Dispose()
method. This feature also applies to readonly ref struct
declarations.