Start working on a VFS implementation #22

Closed
apio wants to merge 44 commits from oop-vfs into main
Showing only changes of commit ec146caeea - Show all commits

View File

@ -78,7 +78,7 @@ template <typename T> class Vector
resize(capacity).release_value(); resize(capacity).release_value();
} }
Result<void> try_append(T item) Result<void> try_append(T&& item)
{ {
if (m_capacity == m_size) TRY(resize(m_capacity + 8)); if (m_capacity == m_size) TRY(resize(m_capacity + 8));
@ -89,6 +89,11 @@ template <typename T> class Vector
return {}; return {};
} }
Result<void> try_append(const T& item)
{
return try_append(T(item));
}
Option<T> try_pop() Option<T> try_pop()
{ {
if (m_size == 0) return {}; if (m_size == 0) return {};