コード例 #1
0
 public KeyedQueue(int capacity, Func <T, TKey> keyProvider, bool strictSet)
 {
     Ensure.ArgumentInRange(() => capacity >= 0, "capacity", capacity, null);
     this._hashset     = new HashSet <TKey>();
     this._queue       = new SimpleQueue <T>(capacity);
     this._keyProvider = keyProvider;
     this._strictSet   = strictSet;
 }
コード例 #2
0
		IEnumerator System.Collections.IEnumerable.GetEnumerator()
		{
			SimpleQueue<T> ts = null;
			for (int i = 0; i < ts._used; i++)
			{
				int length = (ts._head + i) % (int)ts._array.Length;
				yield return ts._array[length];
			}
		}