out (_item_out)
{
auto item_out = cast(Item)_item_out;
assert (!this.isNull(item_out));
assert (this.isSame(item_out, this.items[this.num_busy_ - 1]));
debug(ObjectPoolConsistencyCheck)
{
foreach (item; this.items[0 .. this.num_busy_ - 1])
{
assert (!this.isSame(item, item_out));
}
if (this.num_busy_ < this.items.length)
{
foreach (item; this.items[this.num_busy_ + 1 .. $])
{
assert (!this.isSame(item, item_out));
}
}
}
}
Takes an idle item from the pool or creates a new one if all items are busy or the pool is empty.