How can one convert a list of objects to a queue thereby maintaining the same order?
How can one convert a list of objects to a queue thereby maintaining the same order?
Add this extension to your toolbox to create a FIFO queue of the specific type.
public static class ListExtensions
{
public static Queue<T> ToQueue<T>(this List<T> items) => new Queue<T>(items);
}