Argument array for primtive types. More...
#include <array.hpp>
Related Functions | |
(Note that these are not member functions.) | |
template<class T > | |
ArrayTraits< PrimArgArray< T > >::ArgsType | operator+ (const PrimArgArray< T > &x, const PrimArgArray< T > &y) |
template<class T > | |
ArrayTraits< PrimArgArray< T > >::ArgsType | operator+ (const PrimArgArray< T > &x, const T &y) |
template<class T > | |
ArrayTraits< PrimArgArray< T > >::ArgsType | operator+ (const T &x, const PrimArgArray< T > &y) |
Constructors and initialization | |
PrimArgArray (void) | |
Allocate empty array. More... | |
PrimArgArray (int n) | |
Allocate array with n elements. More... | |
PrimArgArray (int n, T e0,...) | |
Allocate array with n elements and initialize with e0, ... More... | |
PrimArgArray (int n, const T *e) | |
Allocate array with n elements and initialize with elements from array e. More... | |
PrimArgArray (const PrimArgArray< T > &a) | |
Initialize from primitive argument array a (copy elements) More... | |
PrimArgArray (const std::vector< T > &a) | |
Initialize from vector a. More... | |
template<class InputIterator > | |
PrimArgArray (InputIterator first, InputIterator last) | |
Initialize from InputIterator first and last. More... | |
Array elements | |
ArrayTraits< PrimArgArray< T > >::ArgsType | slice (int start, int inc=1, int n=-1) |
Appending elements | |
ArrayTraits< PrimArgArray< T > >::ArgsType & | operator<< (const T &x) |
Insert a new element x at the end of the array (increase size by 1) More... | |
ArrayTraits< PrimArgArray< T > >::ArgsType & | operator<< (const PrimArgArray< T > &x) |
Append x to the end of the array. More... | |
Argument array for primtive types.
Argument arrays are used as convenient mechanism of passing arguments when calling functions as they combine both the size and the elements of an array. For a small number of elements, memory is allocated by creating an argument array object. Otherwise the memory is allocated from the heap.
|
inline |
|
inlineexplicit |
Gecode::PrimArgArray< T >::PrimArgArray | ( | int | n, |
T | e0, | ||
... | |||
) |
Gecode::PrimArgArray< T >::PrimArgArray | ( | int | n, |
const T * | e | ||
) |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
related |
|
related |
|
related |