Created
November 14, 2012 17:02
-
-
Save pragmatrix/4073330 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public interface ISet<ItemT> | |
{ | |
void Add(ItemT item); | |
void Remove(ItemT item); | |
bool Contains(ItemT item); | |
IEnumerable<ItemT> Items { get; } | |
int Count { get; } | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public sealed class ISet<ItemT> | |
{ | |
public Action<ItemT> Add = delegate { }; | |
public Action<ItemT> Remove = delegate { }; | |
public Func<ItemT, bool> Contains = delegate { return false; }; | |
public Func<IEnumerable<ItemT>> Items = () => Enumerable.Empty<ItemT>(); | |
public Func<int> Count = () => 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment