Function RingBuffer.tryPushBack

Appends one element without overwriting existing contents.

bool tryPushBack(U)(
  auto ref U value
)
if (is(Unqual!U == T) && __traits(compiles, emplace(cast(T*)null, forward!value)));

Parameters

NameDescription
value value used to construct the new logical back element

Returns

true when inserted; false when the buffer is already full.

Failure

A full-buffer result leaves the logical sequence unchanged and performs no element construction.

Allocation

No backing-storage allocation is performed.

Lvalues use the ordinary core.lifetime.emplace construction path. For an exact T rvalue whose type defines a D language move constructor, the move constructor is invoked directly at the final storage address; insertion therefore does not depend on the unresolved rvalue behavior of core.lifetime.emplace tracked in issue #8.