Struct ScyllaDeque<T>.Enumerator
Value-type forward enumerator for ScyllaDeque<T> that allows allocation-free
foreach iteration over the concrete deque type.
Inherited Members
Namespace: Scylla.Core.Structures
Assembly: ScyllaCore.dll
Syntax
public struct ScyllaDeque<T>.Enumerator
Remarks
The enumerator snapshots Count and _head at construction
time and uses them throughout iteration. Modifying the deque (pushing, popping, or clearing)
while an enumerator is active produces undefined results; no exception is thrown.
Iteration order is always front-to-back, wrapping around the end of the circular buffer as needed.
Constructors
Enumerator(ScyllaDeque<T>)
Initializes a new ScyllaDeque<T>.Enumerator positioned before the first element of
deque.
Declaration
public Enumerator(ScyllaDeque<T> deque)
Parameters
| Type | Name | Description |
|---|---|---|
| ScyllaDeque<T> | deque | The deque to enumerate. Must not be |
Properties
Current
Gets the element at the current enumerator position.
The value is default( before the first call to
MoveNext() and after the enumerator has passed the last element.T)
Declaration
public readonly T Current { get; }
Property Value
| Type | Description |
|---|---|
| T |
Methods
MoveNext()
Advances the enumerator to the next element in front-to-back order.
Declaration
public bool MoveNext()
Returns
| Type | Description |
|---|---|
| bool |
|
Remarks
The circular-buffer index is computed as (_start + _index) % buffer.Length,
using the snapshot of _head captured at construction rather than the live
_head, so iteration is stable against front-pops during enumeration (though
such modifications are still discouraged).