Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add IEnumerable to arrays. #20

Open
xivk opened this issue Nov 15, 2019 · 3 comments
Open

Add IEnumerable to arrays. #20

xivk opened this issue Nov 15, 2019 · 3 comments

Comments

@xivk
Copy link
Contributor

xivk commented Nov 15, 2019

Add IEnumerable to arrays. We can do this by just adding it to the array base class.

@juliusfriedman
Copy link

juliusfriedman commented Feb 29, 2020

Is this the ask? Or did you want a special enumerator class that did something else?

in https://github.com/itinero/reminiscence/blob/develop/src/Reminiscence/Arrays/ArrayBase.cs

        /// <summary>
        /// Implements <see cref="IEnumerable{T}"/>
        /// </summary>
        /// <returns></returns>
        public IEnumerator<T> GetEnumerator()
        {
            for (long i = 0; i < Length; ++i)
                yield return this[i];
        }

        /// <summary>
        /// Implements <see cref="IEnumerable"/>
        /// </summary>
        /// <returns></returns>
        IEnumerator IEnumerable.GetEnumerator()
        {
            return GetEnumerator();
        }

Perhaps also some unit tests?

@juliusfriedman
Copy link

#21

@juliusfriedman
Copy link

I think this issue can be closed unless you needed something else for this to be completed. Just LMK

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants