XLE
v0.02.0
|
Wrapper for std::unique_ptr<Type[]> More...
#include <PtrUtils.h>
Public Types | |
typedef Type | value_type |
Public Member Functions | |
Type * | begin () never_throws |
Type * | end () never_throws |
size_t | size () const never_throws |
Type & | operator[] (size_t index) never_throws |
bool | empty () never_throws |
const Type * | begin () const never_throws |
const Type * | end () const never_throws |
const Type & | operator[] (size_t index) const never_throws |
Type * | get () never_throws |
const Type * | get () const never_throws |
std::unique_ptr< Type[]> | release () never_throws |
DynamicArray (std::unique_ptr< Type[], Deletor > &&elements, size_t count) never_throws | |
template<typename OtherDeletor > | |
DynamicArray (DynamicArray< Type, OtherDeletor > &&moveFrom) never_throws | |
template<typename OtherDeletor > | |
DynamicArray & | operator= (DynamicArray< Type, OtherDeletor > &&moveFrom) never_throws |
template<typename OtherDeletor > | |
DynamicArray< Type, Deletor > & | operator= (DynamicArray< Type, OtherDeletor > &&moveFrom) never_throws |
Static Public Member Functions | |
static DynamicArray< Type, Deletor > | Copy (const DynamicArray< Type, Deletor > ©From) |
Wrapper for std::unique_ptr<Type[]>
This is a just a basic wrapper for a heap-allocated array and a count value, with a STL container like interface. The only real advantage over using a std::vector<> is if the array has already been allocated through some other means (for example, by using the array form of std::make_unique). For other cases, std::vector<> should be sufficient. One advantage is the copy operations are disabled (except if explicitly using DynamicArray::Copy). This prevent accidental copies where a move is intended.