summaryrefslogtreecommitdiff
path: root/impl/Complete.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'impl/Complete.hpp')
-rw-r--r--impl/Complete.hpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/impl/Complete.hpp b/impl/Complete.hpp
index 64b850a..11f2f83 100644
--- a/impl/Complete.hpp
+++ b/impl/Complete.hpp
@@ -5,9 +5,14 @@
#include <istream>
template<typename T>
+T infinity() { }
+
+template<typename T>
struct Complete {
Complete()
: _value(0), _infinity(false) { }
+ Complete(const T& value)
+ : _value(value), _infinity(false) { }
Complete(const T& value, const bool& infinity)
: _value(value), _infinity(infinity) {
if (value == 0 && infinity == true) {
@@ -76,7 +81,7 @@ struct Complete {
return other._infinity && ((_value < 0 && other._value < 0) ||
(_value > 0 && other._value > 0));
} else {
- return _value == other._value;
+ return !other._infinity && (_value == other._value);
}
}
bool operator!=(const Complete& other) const {