sestoft / C5

C5 generic collection library for C#/.NET
http://www.itu.dk/research/c5/
MIT License
1.03k stars 181 forks source link

Some collections should implement IReadOnlyList #31

Closed hickford closed 8 years ago

hickford commented 9 years ago

.NET 4.5 introduced a new interface IReadOnlyList<T> https://msdn.microsoft.com/en-us/library/hh192385%28v=vs.110%29.aspx

Represents a read-only collection of elements that can be accessed by index.

This is analogous to C5's IIndexed<T>

A sequenced collection, where indices of items in the order are maintained

I think C5.IIndexed<T> should implement IReadOnlyList<T>.

hickford commented 9 years ago

I'm trying to use a C5 TreeSet to replace a DIY sorted list (a List with manual sorting). It works a treat, but some of the consumers expect a IReadOnlyList.

ondfisk commented 8 years ago

Implemented in source - NuGet package will be published shortly

hickford commented 8 years ago

I see, thanks

https://github.com/sestoft/C5/commit/a852e7050983f5f086261382deb2a9edb22ebfc9