diff --git a/Char.cpp b/Char.cpp index f29bd0d..a3ef41c 100644 --- a/Char.cpp +++ b/Char.cpp @@ -5,6 +5,7 @@ Char::operator char() const { return _string._str->operator[](_index); } +// copy-on-write magic happens here Char& Char::operator=(char other) { auto data = new char[_string.size() + 1]; // space for old string & null-terminator