Argument array for primtive types. More...
#include <array.hpp>
Friends | |
ArrayTraits< PrimArgArray< T > >::ArgsType | operator+ (const PrimArgArray< T > &x, const PrimArgArray< T > &y) |
ArrayTraits< PrimArgArray< T > >::ArgsType | operator+ (const PrimArgArray< T > &x, const T &y) |
ArrayTraits< PrimArgArray< T > >::ArgsType | operator+ (const T &x, const PrimArgArray< T > &y) |
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. | |
PrimArgArray (int n) | |
Allocate array with n elements. | |
PrimArgArray (int n, T e0,...) | |
Allocate array with n elements and initialize with e0, ... | |
PrimArgArray (int n, const T *e) | |
Allocate array with n elements and initialize with elements from array e. | |
PrimArgArray (const PrimArgArray< T > &a) | |
Initialize from primitive argument array a (copy elements) | |
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) | |
ArrayTraits< PrimArgArray< T > >::ArgsType & | operator<< (const PrimArgArray< T > &x) |
Append x to the end of the array. |
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.
Gecode::PrimArgArray::PrimArgArray | ( | void | ) | [inline] |
Gecode::PrimArgArray::PrimArgArray | ( | int | n | ) | [inline, explicit] |
Gecode::PrimArgArray::PrimArgArray | ( | int | n, |
T | e0, | ||
... | |||
) |
Gecode::PrimArgArray::PrimArgArray | ( | int | n, |
const T * | e | ||
) |
Gecode::PrimArgArray::PrimArgArray | ( | const PrimArgArray< T > & | a | ) | [inline] |
ArrayTraits< PrimArgArray< T > >::ArgsType Gecode::PrimArgArray::slice | ( | int | start, |
int | inc = 1 , |
||
int | n = -1 |
||
) | [inline] |
Return slice of length at most n such that forall
,
If n is -1, then all possible elements starting from start with increment inc are returned.
Reimplemented from Gecode::ArgArrayBase< T >.
ArrayTraits< PrimArgArray< T > >::ArgsType & Gecode::PrimArgArray::operator<< | ( | const T & | x | ) | [inline] |
ArrayTraits< PrimArgArray< T > >::ArgsType & Gecode::PrimArgArray::operator<< | ( | const PrimArgArray< T > & | x | ) | [inline] |
ArrayTraits<PrimArgArray<T> >::ArgsType operator+ | ( | const PrimArgArray< T > & | x, |
const PrimArgArray< T > & | y | ||
) | [friend] |
ArrayTraits<PrimArgArray<T> >::ArgsType operator+ | ( | const PrimArgArray< T > & | x, |
const T & | y | ||
) | [friend] |
ArrayTraits<PrimArgArray<T> >::ArgsType operator+ | ( | const T & | x, |
const PrimArgArray< T > & | y | ||
) | [friend] |
ArrayTraits< PrimArgArray< T > >::ArgsType operator+ | ( | const PrimArgArray< T > & | x, |
const PrimArgArray< T > & | y | ||
) | [related] |
ArrayTraits< PrimArgArray< T > >::ArgsType operator+ | ( | const PrimArgArray< T > & | x, |
const T & | y | ||
) | [related] |
ArrayTraits< PrimArgArray< T > >::ArgsType operator+ | ( | const T & | x, |
const PrimArgArray< T > & | y | ||
) | [related] |