Better func attribs in Queue.
This commit is contained in:
parent
9d480d1723
commit
2688591c6a
|
@ -64,13 +64,13 @@ struct Queue(T)
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Start iterating over the queue.
|
/// Start iterating over the queue.
|
||||||
void startIteration() pure @safe nothrow
|
void startIteration() @safe pure nothrow @nogc
|
||||||
{
|
{
|
||||||
cursor_ = first_;
|
cursor_ = first_;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Get next element in the queue.
|
/// Get next element in the queue.
|
||||||
ref const(T) next() pure @safe nothrow
|
ref const(T) next() @safe pure nothrow @nogc
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
assert(!empty);
|
assert(!empty);
|
||||||
|
@ -84,7 +84,7 @@ struct Queue(T)
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Are we done iterating?
|
/// Are we done iterating?
|
||||||
bool iterationOver() const pure @safe nothrow
|
bool iterationOver() @safe pure nothrow const @nogc
|
||||||
{
|
{
|
||||||
return cursor_ is null;
|
return cursor_ is null;
|
||||||
}
|
}
|
||||||
|
@ -155,7 +155,7 @@ struct Queue(T)
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Return the next element in the queue.
|
/// Return the next element in the queue.
|
||||||
ref inout(T) peek() inout pure @safe nothrow
|
ref inout(T) peek() @safe pure nothrow inout @nogc
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
assert(!empty, "Trying to peek at an element in an empty queue");
|
assert(!empty, "Trying to peek at an element in an empty queue");
|
||||||
|
@ -166,13 +166,13 @@ struct Queue(T)
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Is the queue empty?
|
/// Is the queue empty?
|
||||||
@property bool empty() const pure @safe nothrow
|
bool empty() @safe pure nothrow const @nogc
|
||||||
{
|
{
|
||||||
return first_ is null;
|
return first_ is null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Return number of elements in the queue.
|
/// Return number of elements in the queue.
|
||||||
@property size_t length() const pure @safe nothrow
|
size_t length() @safe pure nothrow const @nogc
|
||||||
{
|
{
|
||||||
return length_;
|
return length_;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue