#include <Array.h>
However, this provides an alternate type of temporary object so that we can force copy construction when appropriate. Assume a is an Array. Then we want identical behavior for all of these: Array b(a); Array b=a; {Array b; b=a; } // b is a COPY of a and Array b(a(2,3)); Array b=a(2,3)); { Array b; b=a(2,3); } // b is a 3-element COPY of a[2],a[3],a[4]. This won't happen without special handling because the compiler is permitted to skip the copy constructor if a(2,3) were to return an Array, in which case Array b(a(2,3)) MIGHT end up a view rather than a copy. The same applies for functions returning Array when used to construct another Array -- the compiler is free to avoid the temporary by constructing directly into the destination, meaning you could get an unwanted view.
Public Member Functions | |
ArrayView (const ArrayView &v) | |
ArrayView (const Base &l) | |
~ArrayView () | |
ArrayView (const ArrayView &a, int offset, int length) | |
ArrayView (ArrayView &a, int offset, int length) | |
ArrayView | operator() (int offset, int length) const |
ArrayView | operator() (int offset, int length) |
ArrayView & | operator= (const ArrayView &v) |
ArrayView & | operator= (const Base &b) |
operator const Array< T > & () const | |
operator Array< T > & () |
~ArrayView | ( | ) | [inline] |
ArrayView operator() | ( | int | offset, | |
int | length | |||
) | const [inline] |
ArrayView operator() | ( | int | offset, | |
int | length | |||
) | [inline] |
References ArrayBase::operator=().
References ArrayBase::operator=().
operator const Array< T > & | ( | ) | const [inline] |
operator Array< T > & | ( | ) | [inline] |