Skip to content

Instantly share code, notes, and snippets.

@grnde
grnde / CircularStack.IEnumerable.cs
Last active Mar 6, 2020
My current implementation of a stack that forgets the oldest element if the maximum capacity is reached.
View CircularStack.IEnumerable.cs
public partial class CircularStack<T>
{
IEnumerator<T> IEnumerable<T>.GetEnumerator()
=> new Enumerator(this);
IEnumerator IEnumerable.GetEnumerator()
=> new Enumerator(this);
/// <summary>
/// Implements <see cref="IEnumerator{T}"/> for a <see cref="CircularStack{T}"/>.