Vector Copies
Now let’s deal with the problem opposite to Function reference(). In other words, you have a view of another object’s data, but you really want a unique copy. In this case, you can use the copy function. Here is a common situation within functions:
 
void foo(const RWMathArray<double>& v)
{
RWMathArray<double> myCopy = v.copy();
...
// Now you can play with myCopy’s data while
// honoring the const modifier of v...
}
In this example, myCopy and v each refer to their own data, and no aliasing takes place.