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