diff options
Diffstat (limited to 'week11/Exercise07/String.h')
| -rw-r--r-- | week11/Exercise07/String.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/week11/Exercise07/String.h b/week11/Exercise07/String.h new file mode 100644 index 0000000..d34555a --- /dev/null +++ b/week11/Exercise07/String.h @@ -0,0 +1,13 @@ +#pragma once +#include "DynamicArray.hpp" + +class String : DynamicArray<char> { + // Не можем да имаме полиморфно += (виж DynamicArray.hpp), но пак трябва да го имплементираме + // по някакъв начин. + virtual DynamicArray& operator+=(const DynamicArray& other) override; + +public: + virtual char& operator[](int index) override; + virtual const char& operator[](int index) const override; + String& operator+=(const String& other); +}; |
