﻿using System.Collections.Generic;
using System.Linq;

namespace DerConverter
{
    internal static class QueueExtensions
    {
        public static IEnumerable<T> Dequeue<T>(this Queue<T> queue, int count)
        {
            for (int i = 0; i < count; i++) yield return queue.Dequeue();
        }

        public static IEnumerable<T> DequeueAll<T>(this Queue<T> queue)
        {
            while (queue.Any()) yield return queue.Dequeue();
        }
    }
}

﻿using System.Collections.Generic;
using System.Linq;

namespace DerConverter
{
    internal static class QueueExtensions
    {
        public static IEnumerable<T> Dequeue<T>(this Queue<T> queue, long count)
        {
            for (long i = 0; i < count; i++) yield return queue.Dequeue();
        }

        public static IEnumerable<T> DequeueAll<T>(this Queue<T> queue)
        {
            while (queue.Any()) yield return queue.Dequeue();
        }
    }
}

Change int count to long count in Dequeue extension method
Change int count to long count in Dequeue extension method
