// Copies data from another array into this one. // Copy an empty array will clear this one. void copyFrom(const Array2D<T> & other) { if(other.empty()) { clear(); } else { create(other.sizeX(), other.sizeY()); memcpy(m_data, other.m_data, area() * sizeof(T)); } }