Cuberite
A lightweight, fast and extensible game server for Minecraft
|
A dynamic array that defers allocation to the first modifying access. More...
#include <LazyArray.h>
Public Types | |
using | const_iterator = const_pointer |
using | const_pointer = const T * |
using | const_reference = const T & |
using | iterator = pointer |
using | pointer = T * |
using | reference = T & |
using | size_type = int |
using | value_type = T |
Public Member Functions | |
iterator | begin () |
const_iterator | begin () const |
const_iterator | cbegin () const |
const_iterator | cend () const |
cLazyArray (cLazyArray &&a_Other) noexcept | |
cLazyArray (const cLazyArray &a_Other) | |
cLazyArray (size_type a_Size) noexcept | |
T * | data () |
const T * | data () const |
iterator | end () |
const_iterator | end () const |
const T & | GetAt (size_type a_Idx) const |
A const view of an element of the array. More... | |
bool | IsStorageAllocated () const noexcept |
Returns true if the array has already been allocated. More... | |
cLazyArray & | operator= (cLazyArray &&a_Other) noexcept |
cLazyArray & | operator= (const cLazyArray &a_Other) |
T & | operator[] (size_type a_Idx) |
const T & | operator[] (size_type a_Idx) const |
size_type | size () const noexcept |
void | swap (cLazyArray &a_Other) noexcept |
Private Attributes | |
std::unique_ptr< T[]> | m_Array |
size_type | m_Size |
Friends | |
void | swap (cLazyArray &a_Lhs, cLazyArray &a_Rhs) noexcept |
A dynamic array that defers allocation to the first modifying access.
Const references from the array before allocation will all be to the same default constructed value. It is therefore important that default constructed values are indistinguishable from each other.
Definition at line 8 of file LazyArray.h.
using cLazyArray< T >::const_iterator = const_pointer |
Definition at line 22 of file LazyArray.h.
using cLazyArray< T >::const_pointer = const T * |
Definition at line 17 of file LazyArray.h.
using cLazyArray< T >::const_reference = const T & |
Definition at line 19 of file LazyArray.h.
using cLazyArray< T >::iterator = pointer |
Definition at line 21 of file LazyArray.h.
using cLazyArray< T >::pointer = T * |
Definition at line 16 of file LazyArray.h.
using cLazyArray< T >::reference = T & |
Definition at line 18 of file LazyArray.h.
using cLazyArray< T >::size_type = int |
Definition at line 20 of file LazyArray.h.
using cLazyArray< T >::value_type = T |
Definition at line 15 of file LazyArray.h.
|
inlinenoexcept |
Definition at line 24 of file LazyArray.h.
|
inline |
Definition at line 30 of file LazyArray.h.
|
inlinenoexcept |
Definition at line 40 of file LazyArray.h.
|
inline |
Definition at line 73 of file LazyArray.h.
|
inline |
Definition at line 74 of file LazyArray.h.
|
inline |
Definition at line 72 of file LazyArray.h.
|
inline |
Definition at line 76 of file LazyArray.h.
|
inline |
Definition at line 91 of file LazyArray.h.
|
inline |
Definition at line 82 of file LazyArray.h.
|
inline |
Definition at line 77 of file LazyArray.h.
|
inline |
Definition at line 78 of file LazyArray.h.
|
inline |
A const view of an element of the array.
Never causes the array to allocate.
Definition at line 112 of file LazyArray.h.
|
inlinenoexcept |
Returns true if the array has already been allocated.
Definition at line 127 of file LazyArray.h.
|
inlinenoexcept |
Definition at line 52 of file LazyArray.h.
|
inline |
Definition at line 46 of file LazyArray.h.
|
inline |
Definition at line 59 of file LazyArray.h.
|
inline |
Definition at line 65 of file LazyArray.h.
|
inlinenoexcept |
Definition at line 80 of file LazyArray.h.
|
inlinenoexcept |
Definition at line 98 of file LazyArray.h.
|
friend |
Definition at line 104 of file LazyArray.h.
|
mutableprivate |
Definition at line 131 of file LazyArray.h.
|
private |
Definition at line 132 of file LazyArray.h.