Jump to content
Celezt

Spring4Delphi: IArrayAccess<T>

Recommended Posts

Posted (edited)

I'm creating my own Span implementation (similar to C++ and C#) that requires access to the internal storage of, e.g., `IList<T>`. I learned about `IArrayAccess<T>` from this topic: https://en.delphipraxis.net/topic/12713-how-to-accessmodify-underlying-records-of-ilist/, but it seems not to work, and I can't find anything about it in the source code.

 

My current solution is to use pointer offsets to access the internal variables, but this is not a safe nor future-proof solution.

Edited by Celezt

Share this post


Link to post

Okay, I seem to have added this topic to the wrong category. How do I delete or move this 😅?

Share this post


Link to post

As I mentioned in the thread you referred to, this interface no longer exists.

 

But as you might have noticed in the Spring commits in develop, I have my own Span implementation, and IList<T> has the method AsSpan, which returns this.

  • Like 1

Share this post


Link to post

Thanks for the answer! I missed your last comment about it no longer existing.

 

Also, I was unaware of a Span implementation, but that sounds lovely!

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×