Owned

Return wrapper around container Container that can be safely sliced, by tracking number of read borrowed ranges and whether it's currently write borrowed.

Only relevant when Container implements referenced access over <ul> <li> opSlice and <li> opIndex </ul>

TODO Iterate and wrap all @unsafe accessors () and wrapped borrow checks for all modifying members of Container?

Destructor

~this
~this()
Undocumented in source.

Alias This

_container

Members

Aliases

Range
alias Range = typeof(Container.init[])

Type of range of Container.

Functions

move
typeof(this) move()

Move this into a returned r-value.

move
void move(typeof(this) dst)

Checked overload for std.algorithm.mutation.move.

moveEmplace
void moveEmplace(typeof(this) dst)

Checked overload for std.algorithm.mutation.moveEmplace.

opSlice
auto opSlice(size_t i, size_t j)

Get read-only slice in range i .. j.

opSlice
auto opSlice(size_t i, size_t j)

Get read-write slice in range i .. j.

opSlice
auto opSlice()

Get read-only full slice.

opSlice
auto opSlice()

Get read-write full slice.

sliceRO
ReadBorrowed!(Range, Owned) sliceRO()

Get full read-only slice.

sliceRO
ReadBorrowed!(Range, Owned) sliceRO(size_t i, size_t j)

Get read-only slice in range i .. j.

sliceRW
WriteBorrowed!(Range, Owned) sliceRW()

Get full read-write slice.

sliceRW
WriteBorrowed!(Range, Owned) sliceRW(size_t i, size_t j)

Get read-write slice in range i .. j.

Manifest constants

readBorrowCountMax
enum readBorrowCountMax;
Undocumented in source.

Properties

isBorrowed
bool isBorrowed [@property getter]
isWriteBorrowed
bool isWriteBorrowed [@property getter]
readBorrowCount
uint readBorrowCount [@property getter]

Variables

_container
Container _container;

wrapped container

_readBorrowCount
uint _readBorrowCount;

number of readable borrowers. TODO use size_t minus one bit instead in size_t _stats

_writeBorrowed
bool _writeBorrowed;

true iff _container is currently referred to

Meta