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