From dd69553e629934323ad900f1296f402a295b605d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kjist=C3=B3f?= Date: Wed, 2 Nov 2016 11:00:14 +0100 Subject: [PATCH] implemented non-working features of commit da378ef --- Char.cpp | 5 +++++ Char.h | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/Char.cpp b/Char.cpp index ea26a4d..8fae607 100644 --- a/Char.cpp +++ b/Char.cpp @@ -19,3 +19,8 @@ Char& Char::operator=(char other) return *this; } + +Char& Char::operator=(const Char& other) +{ + return (*this).operator=(static_cast(other)); +} \ No newline at end of file diff --git a/Char.h b/Char.h index bcdb308..1cd9609 100644 --- a/Char.h +++ b/Char.h @@ -19,5 +19,6 @@ public: explicit Char(size_t index, String& string) noexcept :_index(index), _string(string) {} operator char() const; - Char& operator=(char other); + Char& operator=(char); + Char& operator=(const Char&); }; \ No newline at end of file