| 72 | // Swap member function template |
| 73 | template <typename T> |
| 74 | void Array<T>::swap(Array& other) noexcept |
| 75 | { |
| 76 | std::swap(m_elements, other.m_elements); // Swap two pointers |
| 77 | std::swap(m_size, other.m_size); // Swap the sizes |
| 78 | } |
| 79 | |
| 80 | // Swap non-member function template (optional) |
| 81 | template <typename T> |