diff options
Autocommit at 07.05.2022 @ 12:23
2 files changed, 2 insertions, 8 deletions
| -rw-r--r-- | src/Generic/String/String.cpp | 6 | ||||
| -rw-r--r-- | src/Generic/String/String.h | 4 |
diff --git a/src/Generic/String/String.cpp b/src/Generic/String/String.cpp index ca1580b..21e6619 100644 --- a/src/Generic/String/String.cpp +++ b/src/Generic/String/String.cpp @@ -34,10 +34,6 @@ unsigned String::get_length() const { return length; } -char& String::operator[](unsigned index) { - return str[index]; -} - String::String() : String("") {} String::String(const String& other) { @@ -76,6 +72,6 @@ int String::compare(const String& other) const { return strcmp(str, other.str); } -char String::operator[](unsigned index) { +char& String::operator[](unsigned index) { return str[index]; } diff --git a/src/Generic/String/String.h b/src/Generic/String/String.h index 5c5231d..4465407 100644 --- a/src/Generic/String/String.h +++ b/src/Generic/String/String.h @@ -14,8 +14,6 @@ public: const char* get_cstr() const; unsigned get_length() const; - char& operator[](unsigned index); - String(); String(const String& other); String& operator=(const String& other); @@ -25,7 +23,7 @@ public: String& operator=(String&& other); int compare(const String& other) const; - char operator[](unsigned index); + char& operator[](unsigned index); }; #endif |
