public T Dequeue() { if (!UnderlyingList.Any()) { throw new Exception("Nothing to dequeue."); } T item = UnderlyingList.First(); UnderlyingList.RemoveAtIndex(0); return(item); }
public T Pop() { if (UnderlyingList.LongCount == 0) { throw new Exception("No item to dequeue."); } T item = UnderlyingList.GetAtIndex(UnderlyingList.LongCount - 1); UnderlyingList.RemoveAtIndex(UnderlyingList.LongCount - 1); return(item); }