| 101 | // Swap member function template |
| 102 | template <typename T> |
| 103 | void Array<T>::swap(Array& other) noexcept |
| 104 | { |
| 105 | std::swap(m_elements, other.m_elements); // Swap two pointers |
| 106 | std::swap(m_size, other.m_size); // Swap the sizes |
| 107 | } |
| 108 | |
| 109 | // Swap non-member function template (optional) |
| 110 | template <typename T> |