Skip to content

Commit

Permalink
Merge pull request #52 from ufrshubham/avoid_copies
Browse files Browse the repository at this point in the history
Avoid Copies.
  • Loading branch information
ayaankhan98 authored Oct 9, 2020
2 parents 183105f + 8e8620d commit 4f4daa5
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 17 deletions.
2 changes: 1 addition & 1 deletion big-int/src/bigint.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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() == '-')
Expand Down
32 changes: 16 additions & 16 deletions big-int/src/bigint.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand All @@ -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);

Expand Down

0 comments on commit 4f4daa5

Please sign in to comment.