| 110 | // Swap member function template |
| 111 | template <typename T> |
| 112 | void Array<T>::swap(Array& other) noexcept |
| 113 | { |
| 114 | std::swap(m_elements, other.m_elements); // Swap two pointers |
| 115 | std::swap(m_size, other.m_size); // Swap the sizes |
| 116 | } |
| 117 | |
| 118 | // Swap non-member function template (optional) |
| 119 | template <typename T> |