| 115 | // Swap non-member function template (optional) |
| 116 | template <typename T> requires std::default_initializable<T> && std::destructible<T> |
| 117 | void swap(Array<T>& one, Array<T>& other) noexcept |
| 118 | { |
| 119 | one.swap(other); // Forward to public member function |
| 120 | } |
| 121 | |
| 122 | // push_back() overload for lvalue references |
| 123 | template <typename T> requires std::default_initializable<T> && std::destructible<T> |