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