From 1f393f07daf652ec316faaf893eeb74492512c5c Mon Sep 17 00:00:00 2001 From: Baptiste Wicht Date: Wed, 4 Apr 2018 11:24:20 +0200 Subject: [PATCH] Add note on implementation --- tstl/include/vector.hpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tstl/include/vector.hpp b/tstl/include/vector.hpp index a607991a..7065e66a 100644 --- a/tstl/include/vector.hpp +++ b/tstl/include/vector.hpp @@ -62,6 +62,11 @@ struct vector { } } + // Note: This is a bit of a lazy scheme + // We always destruct all previous memory and copy construct the + // new information. It could be better to simply copy assign and + // only in the case of new allocation copy construct + vector& operator=(const vector& rhs){ if (this != &rhs) { if (_capacity < rhs._capacity) {