summaryrefslogtreecommitdiff
path: root/include/fud_vector.hpp
diff options
context:
space:
mode:
authorDominick Allen <djallen@librehumanitas.org>2025-03-31 00:47:45 -0500
committerDominick Allen <djallen@librehumanitas.org>2025-03-31 00:47:45 -0500
commitc426110f24516f92ecb8a5374e2a281f2c79787a (patch)
tree3c77e1f7ec007d5dd7a444f651240b6ac7db8976 /include/fud_vector.hpp
parent2e09b3020acb39430bc57a7481984fdfdbac5a12 (diff)
Fix Vector bug.
Diffstat (limited to 'include/fud_vector.hpp')
-rw-r--r--include/fud_vector.hpp28
1 files changed, 2 insertions, 26 deletions
diff --git a/include/fud_vector.hpp b/include/fud_vector.hpp
index fd01cd0..9808a7d 100644
--- a/include/fud_vector.hpp
+++ b/include/fud_vector.hpp
@@ -95,9 +95,9 @@ class Vector {
Vector<T> output{};
auto status = initializeWithCapacity(output, capacity, allocator);
if (status != FudStatus::Success) {
- return status;
+ return Error{status};
}
- return output;
+ return Okay{std::move(output)};
}
static FudStatus initializeWithCapacity(
@@ -255,30 +255,6 @@ class Vector {
}
}
- template <typename... Args>
- static Result<Vector<T>, FudStatus> from(Option<Allocator*> allocatorOpt, Args&&... args)
- {
- constexpr size_t size = sizeof...(args);
- Vector<T> output{};
- Allocator* allocator = allocatorOpt.hasValue() ? allocatorOpt.value() : &globalFudAllocator;
- auto status = Vector::initializeWithCapacity(output, size, allocator);
- if (status != FudStatus::Success) {
- return Error{status};
- }
- output.m_length = size;
- size_t index = 0;
- /*
- for (size_t index = 0; index < output.m_length; ++index) {
-
- }
- */
- ([&]() {
- output.m_data[index] = std::forward<T>(args);
- ++index;
- } (), ...);
- return Okay{std::move(output)};
- }
-
static Vector<T> move(Vector<T>&& rhs) noexcept
{
return Vector<T>{std::move(rhs)};