summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim King <taking@google.com>2016-10-01 13:50:32 -0700
committerTim King <taking@google.com>2016-10-01 13:50:32 -0700
commit2b95980173876aa9e76e666e73be0d669f0831d7 (patch)
treeb541b7bc7e289f60e8230da004e5dae1bc387b6a
parent4adb2ef78320743ff4b56eac15bfdbe4b9591b51 (diff)
Removing the throw specifiers from SubrangeBounds.
-rw-r--r--src/util/subrange_bound.cpp28
-rw-r--r--src/util/subrange_bound.h103
2 files changed, 60 insertions, 71 deletions
diff --git a/src/util/subrange_bound.cpp b/src/util/subrange_bound.cpp
index 085ecb930..a33c22f72 100644
--- a/src/util/subrange_bound.cpp
+++ b/src/util/subrange_bound.cpp
@@ -25,36 +25,34 @@
namespace CVC4 {
-std::ostream& operator<<(std::ostream& out, const SubrangeBounds& bounds)
-throw() {
+std::ostream& operator<<(std::ostream& out, const SubrangeBounds& bounds) {
out << bounds.lower << ".." << bounds.upper;
return out;
}
/** Get the finite SubrangeBound, failing an assertion if infinite. */
-const Integer& SubrangeBound::getBound() const throw(IllegalArgumentException) {
+const Integer& SubrangeBound::getBound() const {
PrettyCheckArgument(!d_nobound, this, "SubrangeBound is infinite");
return d_bound;
}
-SubrangeBounds::SubrangeBounds(const SubrangeBound& l,
- const SubrangeBound& u)
- : lower(l)
- , upper(u)
-{
- PrettyCheckArgument(!l.hasBound() || !u.hasBound() ||
- l.getBound() <= u.getBound(),
- l, "Bad subrange bounds specified");
+SubrangeBounds::SubrangeBounds(const SubrangeBound& l, const SubrangeBound& u)
+ : lower(l), upper(u) {
+ PrettyCheckArgument(
+ !l.hasBound() || !u.hasBound() || l.getBound() <= u.getBound(), l,
+ "Bad subrange bounds specified");
}
-bool SubrangeBounds::joinIsBounded(const SubrangeBounds& a, const SubrangeBounds& b){
+bool SubrangeBounds::joinIsBounded(const SubrangeBounds& a,
+ const SubrangeBounds& b) {
return (a.lower.hasBound() && b.lower.hasBound()) ||
- (a.upper.hasBound() && b.upper.hasBound());
+ (a.upper.hasBound() && b.upper.hasBound());
}
-SubrangeBounds SubrangeBounds::join(const SubrangeBounds& a, const SubrangeBounds& b){
- DebugCheckArgument(joinIsBounded(a,b), a);
+SubrangeBounds SubrangeBounds::join(const SubrangeBounds& a,
+ const SubrangeBounds& b) {
+ DebugCheckArgument(joinIsBounded(a, b), a);
SubrangeBound newLower = SubrangeBound::min(a.lower, b.lower);
SubrangeBound newUpper = SubrangeBound::max(a.upper, b.upper);
return SubrangeBounds(newLower, newUpper);
diff --git a/src/util/subrange_bound.h b/src/util/subrange_bound.h
index 86c88e187..91c91af41 100644
--- a/src/util/subrange_bound.h
+++ b/src/util/subrange_bound.h
@@ -34,41 +34,33 @@ namespace CVC4 {
* has a lower bound of -5 and an infinite upper bound.
*/
class CVC4_PUBLIC SubrangeBound {
-public:
-
+ public:
/** Construct an infinite SubrangeBound. */
- SubrangeBound() throw() :
- d_nobound(true),
- d_bound() {
- }
+ SubrangeBound() : d_nobound(true), d_bound() {}
/** Construct a finite SubrangeBound. */
- SubrangeBound(const Integer& i) throw() :
- d_nobound(false),
- d_bound(i) {
- }
+ SubrangeBound(const Integer& i) : d_nobound(false), d_bound(i) {}
- ~SubrangeBound() throw() {
- }
+ ~SubrangeBound() {}
- /** Get the finite SubrangeBound, failing an assertion if infinite. */
- const Integer& getBound() const throw(IllegalArgumentException);
+ /**
+ * Get the finite SubrangeBound, failing an assertion if infinite.
+ *
+ * @throws IllegalArgumentException if the bound is infinite.
+ */
+ const Integer& getBound() const;
/** Returns true iff this is a finite SubrangeBound. */
- bool hasBound() const throw() {
- return !d_nobound;
- }
+ bool hasBound() const { return !d_nobound; }
/** Test two SubrangeBounds for equality. */
- bool operator==(const SubrangeBound& b) const throw() {
+ bool operator==(const SubrangeBound& b) const {
return hasBound() == b.hasBound() &&
- (!hasBound() || getBound() == b.getBound());
+ (!hasBound() || getBound() == b.getBound());
}
/** Test two SubrangeBounds for disequality. */
- bool operator!=(const SubrangeBound& b) const throw() {
- return !(*this == b);
- }
+ bool operator!=(const SubrangeBound& b) const { return !(*this == b); }
/**
* Is this SubrangeBound "less than" another? For two
@@ -78,9 +70,9 @@ public:
* behavior is due to the fact that a SubrangeBound without a bound
* is the representation for both +infinity and -infinity.
*/
- bool operator<(const SubrangeBound& b) const throw() {
+ bool operator<(const SubrangeBound& b) const {
return (!hasBound() && b.hasBound()) || (hasBound() && !b.hasBound()) ||
- ( hasBound() && b.hasBound() && getBound() < b.getBound() );
+ (hasBound() && b.hasBound() && getBound() < b.getBound());
}
/**
@@ -91,9 +83,9 @@ public:
* behavior is due to the fact that a SubrangeBound without a bound
* is the representation for both +infinity and -infinity.
*/
- bool operator<=(const SubrangeBound& b) const throw() {
+ bool operator<=(const SubrangeBound& b) const {
return !hasBound() || !b.hasBound() ||
- ( hasBound() && b.hasBound() && getBound() <= b.getBound() );
+ (hasBound() && b.hasBound() && getBound() <= b.getBound());
}
/**
@@ -104,9 +96,9 @@ public:
* behavior is due to the fact that a SubrangeBound without a bound
* is the representation for both +infinity and -infinity.
*/
- bool operator>(const SubrangeBound& b) const throw() {
+ bool operator>(const SubrangeBound& b) const {
return (!hasBound() && b.hasBound()) || (hasBound() && !b.hasBound()) ||
- ( hasBound() && b.hasBound() && getBound() < b.getBound() );
+ (hasBound() && b.hasBound() && getBound() < b.getBound());
}
/**
@@ -117,36 +109,34 @@ public:
* strange behavior is due to the fact that a SubrangeBound without
* a bound is the representation for both +infinity and -infinity.
*/
- bool operator>=(const SubrangeBound& b) const throw() {
+ bool operator>=(const SubrangeBound& b) const {
return !hasBound() || !b.hasBound() ||
- ( hasBound() && b.hasBound() && getBound() <= b.getBound() );
+ (hasBound() && b.hasBound() && getBound() <= b.getBound());
}
-
- static SubrangeBound min(const SubrangeBound& a, const SubrangeBound& b){
- if(a.hasBound() && b.hasBound()){
+ static SubrangeBound min(const SubrangeBound& a, const SubrangeBound& b) {
+ if (a.hasBound() && b.hasBound()) {
return SubrangeBound(Integer::min(a.getBound(), b.getBound()));
- }else{
+ } else {
return SubrangeBound();
}
}
- static SubrangeBound max(const SubrangeBound& a, const SubrangeBound& b){
- if(a.hasBound() && b.hasBound()){
+ static SubrangeBound max(const SubrangeBound& a, const SubrangeBound& b) {
+ if (a.hasBound() && b.hasBound()) {
return SubrangeBound(Integer::max(a.getBound(), b.getBound()));
- }else{
+ } else {
return SubrangeBound();
}
- }
+ }
-private:
+ private:
bool d_nobound;
Integer d_bound;
-};/* class SubrangeBound */
+}; /* class SubrangeBound */
class CVC4_PUBLIC SubrangeBounds {
-public:
-
+ public:
SubrangeBound lower;
SubrangeBound upper;
@@ -167,7 +157,7 @@ public:
*/
bool operator<(const SubrangeBounds& bounds) const {
return (lower > bounds.lower && upper <= bounds.upper) ||
- (lower >= bounds.lower && upper < bounds.upper);
+ (lower >= bounds.lower && upper < bounds.upper);
}
/**
@@ -186,7 +176,7 @@ public:
*/
bool operator>(const SubrangeBounds& bounds) const {
return (lower < bounds.lower && upper >= bounds.upper) ||
- (lower <= bounds.lower && upper > bounds.upper);
+ (lower <= bounds.lower && upper > bounds.upper);
}
/**
@@ -209,24 +199,25 @@ public:
*/
static SubrangeBounds join(const SubrangeBounds& a, const SubrangeBounds& b);
-};/* class SubrangeBounds */
+}; /* class SubrangeBounds */
struct CVC4_PUBLIC SubrangeBoundsHashFunction {
inline size_t operator()(const SubrangeBounds& bounds) const {
// We use Integer::hash() rather than Integer::getUnsignedLong()
// because the latter might overflow and throw an exception
- size_t l = bounds.lower.hasBound() ? bounds.lower.getBound().hash() : std::numeric_limits<size_t>::max();
- size_t u = bounds.upper.hasBound() ? bounds.upper.getBound().hash() : std::numeric_limits<size_t>::max();
+ size_t l = bounds.lower.hasBound() ? bounds.lower.getBound().hash()
+ : std::numeric_limits<size_t>::max();
+ size_t u = bounds.upper.hasBound() ? bounds.upper.getBound().hash()
+ : std::numeric_limits<size_t>::max();
return l + 0x9e3779b9 + (u << 6) + (u >> 2);
}
-};/* struct SubrangeBoundsHashFunction */
+}; /* struct SubrangeBoundsHashFunction */
-inline std::ostream&
-operator<<(std::ostream& out, const SubrangeBound& bound) throw() CVC4_PUBLIC;
+inline std::ostream& operator<<(std::ostream& out,
+ const SubrangeBound& bound) CVC4_PUBLIC;
-inline std::ostream&
-operator<<(std::ostream& out, const SubrangeBound& bound) throw() {
- if(bound.hasBound()) {
+inline std::ostream& operator<<(std::ostream& out, const SubrangeBound& bound) {
+ if (bound.hasBound()) {
out << bound.getBound();
} else {
out << '_';
@@ -235,9 +226,9 @@ operator<<(std::ostream& out, const SubrangeBound& bound) throw() {
return out;
}
-std::ostream& operator<<(std::ostream& out, const SubrangeBounds& bounds)
-throw() CVC4_PUBLIC;
+std::ostream& operator<<(std::ostream& out,
+ const SubrangeBounds& bounds) CVC4_PUBLIC;
-}/* CVC4 namespace */
+} /* CVC4 namespace */
#endif /* __CVC4__SUBRANGE_BOUND_H */
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback