From 052c541270610382880caf995ae8eb6d9451b399 Mon Sep 17 00:00:00 2001 From: Slaven Falandys Date: Fri, 14 Jun 2024 21:58:02 +0200 Subject: [PATCH] Added copy constructor and copy assignment operator to `normal_iterator` --- include/sfl/private.hpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/include/sfl/private.hpp b/include/sfl/private.hpp index 84c32db..3c8b4d1 100644 --- a/include/sfl/private.hpp +++ b/include/sfl/private.hpp @@ -281,13 +281,25 @@ class normal_iterator : it_() {} - // Copy constructor and converting constructor (from iterator to const_iterator) + // Copy constructor + normal_iterator(const normal_iterator& other) noexcept + : it_(other.it_) + {} + + // Converting constructor (from iterator to const_iterator) template ::value>* = nullptr> normal_iterator(const normal_iterator& other) noexcept : it_(other.it_) {} + // Copy assignment operator + normal_iterator& operator=(const normal_iterator& other) noexcept + { + it_ = other.it_; + return *this; + } + SFL_NODISCARD reference operator*() const noexcept {