AFF --- A container for numbers (array) by Friederich and Forbriger.

◆ copyout() [2/2]

template<class T>
Array< T > aff::ConstArray< T >::copyout

create an identical copy (deep copy) of this array

create a value (deep) copy

This is mainly used to create a copy of a truely identical array (i.e. array with same element type or at least const version of same element type). Use this function in conjunction with the assignment operator. E.g.:

A=5.;
B=A.copyout();
C=A;

Here arrays A and B have exactly the same contents but use different memory. While changes to elements of C will also affect elements of A, this not the case for changes applied to B.

Examples:
tests/arraytest.cc, and tests/helpertest.cc.

Definition at line 559 of file array.h.

Referenced by main().

560  {
561  aff::Array<T> copy(Tshape(this->first(),this->last()));
562  copy.copyin(*this);
563  return(copy);
564  }
const TIndexVec & first() const
return vector of first index values
Definition: strided.h:206
Full multi-dimensional array functionality.This is the full array class template. It adds no addition...
Definition: array.h:151
const TIndexVec & last() const
return vector of last index values
Definition: strided.h:208
aff::Strided Tshape
Type of subscriptor.
Definition: array.h:399
Here is the caller graph for this function: