public override Lossy <IReadOnlyCollection <T> > Dequeue()
            {
                var result = new Lossy <IReadOnlyCollection <T> >(DequeueAll(), _ignoredCount);

                _ignoredCount = 0;
                return(result);
            }
Пример #2
0
            public Lossy <T> Dequeue()
            {
                if (IsEmpty)
                {
                    throw new InvalidOperationException(Strings.QueueIsEmpty);
                }

                var result = new Lossy <T>(_item, _ignoredCount);

                _hasValue     = false;
                _item         = default;
                _ignoredCount = 0;
                return(result);
            }