| 84 | // Swap member function template |
| 85 | template <typename T> |
| 86 | void Array<T>::swap(Array& other) noexcept |
| 87 | { |
| 88 | std::swap(m_elements, other.m_elements); // Swap two pointers |
| 89 | std::swap(m_size, other.m_size); // Swap the sizes |
| 90 | } |
| 91 | |
| 92 | // Swap non-member function template (optional) |
| 93 | template <typename T> |