From 447782bddfcdafc74c5c0b700c95d94d913ea88d Mon Sep 17 00:00:00 2001 From: Henrique Gemignani Passos Lima Date: Thu, 6 Oct 2022 02:39:15 +0300 Subject: [PATCH] Fix vectors' operator= --- include/rstl/reserved_vector.hpp | 2 +- include/rstl/vector.hpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/rstl/reserved_vector.hpp b/include/rstl/reserved_vector.hpp index 4e42223c..a7bbc855 100644 --- a/include/rstl/reserved_vector.hpp +++ b/include/rstl/reserved_vector.hpp @@ -29,7 +29,7 @@ public: reserved_vector& operator=(const reserved_vector& other) { if (this != &other) { clear(); - uninitialized_copy(data(), other.data() + other.size(), other.data()); + uninitialized_copy(other.data(), other.data() + other.size(), data()); x0_count = other.x0_count; } return *this; diff --git a/include/rstl/vector.hpp b/include/rstl/vector.hpp index 29ba5b1e..7c887f49 100644 --- a/include/rstl/vector.hpp +++ b/include/rstl/vector.hpp @@ -85,7 +85,7 @@ public: xc_items = nullptr; } else { reserve(other.size()); - uninitialized_copy(data(), other.data(), other.data() + other.size()); + uninitialized_copy(other.data(), other.data() + other.size(), data()); x4_count = other.x4_count; } return *this;