Deque

Deque on ring buffer

Constructors

this
this()
Undocumented in source.
this
this(U[] values)

Deque(1, 2, 3)

this
this(Range r)

Deque(iota(3))

Members

Aliases

ConstRange
alias ConstRange = RangeT!(const DequePayload!T)
Undocumented in source.
ImmutableRange
alias ImmutableRange = RangeT!(immutable DequePayload!T)
Undocumented in source.
Payload
alias Payload = DequePayload!T
Undocumented in source.
Range
alias Range = RangeT!(DequePayload!T)

Random-access range

opDollar
alias opDollar = length
Undocumented in source.
opOpAssign
alias opOpAssign(string op : "~") = insertBack
Undocumented in source.
stableInsertBack
alias stableInsertBack = insertBack
Undocumented in source.
stableRemoveBack
alias stableRemoveBack = removeBack
Undocumented in source.

Functions

back
inout(T) back()
Undocumented in source. Be warned that the author may not have intended to support it.
clear
void clear()
Undocumented in source. Be warned that the author may not have intended to support it.
front
inout(T) front()
Undocumented in source. Be warned that the author may not have intended to support it.
insertBack
void insertBack(T item)
Undocumented in source. Be warned that the author may not have intended to support it.
insertFront
void insertFront(T item)

Warning: break range

opIndex
inout(T) opIndex(size_t i)
Undocumented in source. Be warned that the author may not have intended to support it.
opIndex
Range opIndex(size_t[2] rng)
Undocumented in source. Be warned that the author may not have intended to support it.
opIndex
ConstRange opIndex(size_t[2] rng)
Undocumented in source. Be warned that the author may not have intended to support it.
opIndex
ImmutableRange opIndex(size_t[2] rng)
Undocumented in source. Be warned that the author may not have intended to support it.
opIndex
auto opIndex()
Undocumented in source. Be warned that the author may not have intended to support it.
opSlice
size_t[2] opSlice(size_t start, size_t end)
Undocumented in source. Be warned that the author may not have intended to support it.
removeBack
void removeBack()
Undocumented in source. Be warned that the author may not have intended to support it.
removeFront
void removeFront()

Warning: break range

Properties

empty
bool empty [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.
length
size_t length [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.

Static functions

make
Deque make()
Undocumented in source. Be warned that the author may not have intended to support it.

Structs

RangeT
struct RangeT(QualifiedPayload)
Undocumented in source.

Variables

_p
Payload* _p;
Undocumented in source.

Examples

import std.algorithm : equal;
auto q = Deque!int();

assert(equal(q[], new int[0]));
q.insertBack(1);
assert(equal(q[], [1]));
q.insertBack(2);
assert(equal(q[], [1, 2]));
q.insertFront(3);
assert(equal(q[], [3, 1, 2]));
q.removeFront;
assert(equal(q[], [1, 2]));
q.insertBack(4);
assert(equal(q[], [1, 2, 4]));
q.insertFront(5);
assert(equal(q[], [5, 1, 2, 4]));
q.removeBack();
assert(equal(q[], [5, 1, 2]));

Meta