From 83b0388eebcfe031a6b78cf22dd14143c545e453 Mon Sep 17 00:00:00 2001 From: Syndamia Date: Sat, 7 May 2022 12:23:05 +0300 Subject: Autocommit at 07.05.2022 @ 12:23 --- src/Generic/String/String.cpp | 6 +----- src/Generic/String/String.h | 4 +--- 2 files changed, 2 insertions(+), 8 deletions(-) (limited to 'src/Generic/String') 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 -- cgit v1.3.1-23-gd82d