diff --git a/big-int/src/bigint.cpp b/big-int/src/bigint.cpp index 75ee2c5..4c9b0ec 100644 --- a/big-int/src/bigint.cpp +++ b/big-int/src/bigint.cpp @@ -66,7 +66,7 @@ largeInt::largeInt(long long nValue) this->number = std::to_string(nValue); } -largeInt::largeInt(std::string nValue) +largeInt::largeInt(const std::string& nValue) { // checks if input string starts with a minus and initializes object with input if (nValue.front() == '-') diff --git a/big-int/src/bigint.hpp b/big-int/src/bigint.hpp index a9cb938..a5fc749 100644 --- a/big-int/src/bigint.hpp +++ b/big-int/src/bigint.hpp @@ -48,45 +48,45 @@ class largeInt explicit largeInt(int); explicit largeInt(long long int); - explicit largeInt(std::string); + explicit largeInt(const std::string&); - largeInt operator+(largeInt); + largeInt operator+(const largeInt&); largeInt operator+(int); largeInt operator+(int64_t); - largeInt operator-(largeInt); + largeInt operator-(const largeInt&); largeInt operator-(int); largeInt operator-(int64_t); - largeInt operator*(largeInt); + largeInt operator*(const largeInt&); largeInt operator*(int); largeInt operator*(int64_t); - largeInt operator/(largeInt); + largeInt operator/(const largeInt&); largeInt operator/(int); largeInt operator/(int64_t); - largeInt operator%(largeInt); + largeInt operator%(const largeInt&); largeInt operator%(int); largeInt operator%(int64_t); - largeInt &operator+=(largeInt); + largeInt &operator+=(const largeInt&); largeInt &operator+=(int); largeInt &operator+=(int64_t); - largeInt &operator-=(largeInt); + largeInt &operator-=(const largeInt&); largeInt &operator-=(int); largeInt &operator-=(int64_t); - largeInt &operator*=(largeInt); + largeInt &operator*=(const largeInt&); largeInt &operator*=(int); largeInt &operator*=(int64_t); - largeInt &operator/=(largeInt); + largeInt &operator/=(const largeInt&); largeInt &operator/=(int); largeInt &operator/=(int64_t); - largeInt operator%=(largeInt); + largeInt operator%=(const largeInt&); largeInt operator%=(int); largeInt operator%=(int64_t); @@ -102,23 +102,23 @@ class largeInt bool operator==(int); bool operator==(int64_t); - bool operator!=(largeInt); + bool operator!=(const largeInt&); bool operator!=(int); bool operator!=(int64_t); - bool operator<(largeInt); + bool operator<(const largeInt&); bool operator<(int); bool operator<(int64_t); - bool operator>(largeInt); + bool operator>(const largeInt&); bool operator>(int); bool operator>(int64_t); - bool operator<=(largeInt); + bool operator<=(const largeInt&); bool operator<=(int); bool operator<=(int64_t); - bool operator>=(largeInt); + bool operator>=(const largeInt&); bool operator>=(int); bool operator>=(int64_t);