| 78 | // Swap member function template |
| 79 | template <typename T, int startIndex> |
| 80 | void Array<T, startIndex>::swap(Array& other) noexcept |
| 81 | { |
| 82 | std::swap(m_elements, other.m_elements); // Swap two pointers |
| 83 | std::swap(m_size, other.m_size); // Swap the sizes |
| 84 | } |
| 85 | |
| 86 | // Swap non-member function template (can only swap arrays with identical startIndex) |
| 87 | template <typename T, int startIndex> |