Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

C++ Constructor Clean-up and Move semantics #51

Open
wants to merge 11 commits into
base: master
Choose a base branch
from
41 changes: 23 additions & 18 deletions src/sylvan_obj.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,13 @@ Bdd::operator=(const Bdd& right)
return *this;
}

Bdd&
Bdd::operator=(Bdd&& right)
{
bdd = right.bdd;
return *this;
}

bool
Bdd::operator<=(const Bdd& other) const
{
Expand Down Expand Up @@ -88,8 +95,7 @@ Bdd::operator*(const Bdd& other) const
Bdd&
Bdd::operator*=(const Bdd& other)
{
bdd = sylvan_and(bdd, other.bdd);
return *this;
return (*this = *this * other);
}

Bdd
Expand All @@ -101,8 +107,7 @@ Bdd::operator&(const Bdd& other) const
Bdd&
Bdd::operator&=(const Bdd& other)
{
bdd = sylvan_and(bdd, other.bdd);
return *this;
return (*this = *this & other);
}

Bdd
Expand All @@ -114,8 +119,7 @@ Bdd::operator+(const Bdd& other) const
Bdd&
Bdd::operator+=(const Bdd& other)
{
bdd = sylvan_or(bdd, other.bdd);
return *this;
return (*this = *this + other);
}

Bdd
Expand All @@ -127,8 +131,7 @@ Bdd::operator|(const Bdd& other) const
Bdd&
Bdd::operator|=(const Bdd& other)
{
bdd = sylvan_or(bdd, other.bdd);
return *this;
return (*this = *this | other);
}

Bdd
Expand All @@ -140,8 +143,7 @@ Bdd::operator^(const Bdd& other) const
Bdd&
Bdd::operator^=(const Bdd& other)
{
bdd = sylvan_xor(bdd, other.bdd);
return *this;
return (*this = *this ^ other);
}

Bdd
Expand All @@ -153,8 +155,7 @@ Bdd::operator-(const Bdd& other) const
Bdd&
Bdd::operator-=(const Bdd& other)
{
bdd = sylvan_and(bdd, sylvan_not(other.bdd));
return *this;
return (*this = *this - other);
}

Bdd
Expand Down Expand Up @@ -753,6 +754,13 @@ Mtbdd::operator=(const Mtbdd& right)
return *this;
}

Mtbdd&
Mtbdd::operator=(Mtbdd&& right)
{
mtbdd = right.mtbdd;
return *this;
}

Mtbdd
Mtbdd::operator!() const
{
Expand All @@ -774,8 +782,7 @@ Mtbdd::operator*(const Mtbdd& other) const
Mtbdd&
Mtbdd::operator*=(const Mtbdd& other)
{
mtbdd = mtbdd_times(mtbdd, other.mtbdd);
return *this;
return (*this = *this * other);
}

Mtbdd
Expand All @@ -787,8 +794,7 @@ Mtbdd::operator+(const Mtbdd& other) const
Mtbdd&
Mtbdd::operator+=(const Mtbdd& other)
{
mtbdd = mtbdd_plus(mtbdd, other.mtbdd);
return *this;
return (*this = *this + other);
}

Mtbdd
Expand All @@ -800,8 +806,7 @@ Mtbdd::operator-(const Mtbdd& other) const
Mtbdd&
Mtbdd::operator-=(const Mtbdd& other)
{
mtbdd = mtbdd_minus(mtbdd, other.mtbdd);
return *this;
return (*this = *this - other);
}

Mtbdd
Expand Down
Loading
Loading