diff options
author | Carlo Zancanaro <carlo@pc-4w14-0.cs.usyd.edu.au> | 2012-06-15 16:02:55 +1000 |
---|---|---|
committer | Carlo Zancanaro <carlo@pc-4w14-0.cs.usyd.edu.au> | 2012-06-15 16:02:55 +1000 |
commit | 4769d5edec8e78225f8f67e864c3269f1d2616e4 (patch) | |
tree | edc95613cd16d319ac68ae1a375b28c32cd5f5be /impl/Complete.hpp | |
parent | fd6bc1887fecca5338e7d5660d56a4038c805d96 (diff) | |
parent | a61d8b829afab13593e254fc69e260b6346939dc (diff) |
Merge commit 'a61d'
Conflicts:
impl/Expression.hpp
impl/Operator.hpp
impl/Variable.hpp
impl/main.cpp
Diffstat (limited to 'impl/Complete.hpp')
-rw-r--r-- | impl/Complete.hpp | 7 |
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 { |