| 120 | // Swap member function template |
| 121 | template <typename T> |
| 122 | void Array<T>::swap(Array& other) noexcept |
| 123 | { |
| 124 | std::swap(m_elements, other.m_elements); // Swap two pointers |
| 125 | std::swap(m_size, other.m_size); // Swap the sizes |
| 126 | } |
| 127 | |
| 128 | // Swap non-member function template (optional) |
| 129 | template <typename T> |