| 133 | // Swap member function template |
| 134 | template <typename T> |
| 135 | void Array<T>::swap(Array& other) noexcept |
| 136 | { |
| 137 | std::swap(m_elements, other.m_elements); // Swap two pointers |
| 138 | std::swap(m_size, other.m_size); // Swap the sizes |
| 139 | } |
| 140 | |
| 141 | // Swap non-member function template (optional) |
| 142 | template <typename T> |