From de6273cc63cf34611190fdd2bdc20d9b46de8c03 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kjist=C3=B3f?= Date: Sat, 29 Oct 2016 11:39:18 +0200 Subject: [PATCH] added a comment to class Char --- Char.cpp | 1 + 1 file changed, 1 insertion(+) 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