You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Implement LongSpan<T> constructor and indexed access #9
Implement the missing runtime functionality for LongSpan<T>.
Required changes
Update src/LongSpan.cs so that LongSpan<T> can represent and expose a valid memory range.
Add a constructor that initializes _reference and Length.
Add a bounds-checked indexer.
Return indexed elements by using Unsafe.Add(ref _reference, index).
Preserve IsEmpty as a check of Length.
Rationale
The current type has no constructor or element accessor. _reference and Length therefore cannot be initialized for useful instances, and callers cannot access span elements.
Affected area
src/LongSpan.cs
Acceptance criteria
LongSpan<T> initializes its reference and length through a public constructor.
The indexer returns the element at a valid index.
The indexer rejects indexes below zero and indexes greater than or equal to Length.
Activity