diff --git a/luna/include/luna/Vector.h b/luna/include/luna/Vector.h index 46393feb..c74f632e 100644 --- a/luna/include/luna/Vector.h +++ b/luna/include/luna/Vector.h @@ -78,7 +78,7 @@ template class Vector resize(capacity).release_value(); } - Result try_append(T item) + Result try_append(T&& item) { if (m_capacity == m_size) TRY(resize(m_capacity + 8)); @@ -89,6 +89,11 @@ template class Vector return {}; } + Result try_append(const T& item) + { + return try_append(T(item)); + } + Option try_pop() { if (m_size == 0) return {};