From 490c52c8034f217d040fcf214f8b80ba40c07010 Mon Sep 17 00:00:00 2001 From: Brett Laptop Date: Thu, 29 Feb 2024 09:10:29 -0500 Subject: [PATCH] Fix issue with initalizer order --- include/blt/std/vector.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/blt/std/vector.h b/include/blt/std/vector.h index a91dd1e..1815e87 100644 --- a/include/blt/std/vector.h +++ b/include/blt/std/vector.h @@ -193,7 +193,7 @@ namespace blt } template, bool> = true> - constexpr vector(std::initializer_list&& list): size_(list.size()), capacity_(list.size()) + constexpr vector(std::initializer_list&& list): capacity_(list.size()), size_(list.size()) { buffer_ = allocator.allocate(capacity_); for (auto e : blt::enumerate(list)) @@ -209,7 +209,7 @@ namespace blt } template, G> || std::is_same_v, G>, bool> = true> - constexpr explicit vector(G&& move): size_(move.size()), capacity_(move.capacity()), buffer_(move.buffer_) + constexpr explicit vector(G&& move): buffer_(move.buffer_), capacity_(move.capacity()), size_(move.size()) { move.buffer_ = nullptr; }