|
17 | 17 | #include <boost/optional.hpp>
|
18 | 18 | #include <boost/bimap.hpp>
|
19 | 19 | #include <boost/any.hpp>
|
20 |
| -#include <boost/logic/tribool.hpp> |
21 | 20 |
|
22 | 21 | // extended identifiers in msvc (and,or,not)
|
23 | 22 | #ifdef _MSC_VER
|
@@ -882,22 +881,22 @@ namespace kit
|
882 | 881 | }
|
883 | 882 |
|
884 | 883 | template<class T>
|
885 |
| - boost::tribool any_eq_type(const boost::any& a, const boost::any& b) { |
| 884 | + int any_eq_type(const boost::any& a, const boost::any& b) { |
886 | 885 | if (a.type() == typeid(T) && b.type() == typeid(T))
|
887 | 886 | return boost::any_cast<T>(a) ==
|
888 | 887 | boost::any_cast<T>(b);
|
889 |
| - return boost::tribool::indeterminate_value; |
| 888 | + return -1; |
890 | 889 | }
|
891 | 890 |
|
892 | 891 | inline bool any_eq(const boost::any& a, const boost::any& b) {
|
893 | 892 | if(a.type() != b.type())
|
894 | 893 | return false;
|
895 |
| - {auto r = any_eq_type<std::string>(a,b); if(r||!r) return r;} |
896 |
| - {auto r = any_eq_type<int>(a,b); if(r||!r) return r;} |
897 |
| - {auto r = any_eq_type<unsigned>(a,b); if(r||!r) return r;} |
898 |
| - {auto r = any_eq_type<float>(a,b); if(r||!r) return r;} |
899 |
| - {auto r = any_eq_type<double>(a,b); if(r||!r) return r;} |
900 |
| - {auto r = any_eq_type<bool>(a,b); if(r||!r) return r;} |
| 894 | + {auto r = any_eq_type<std::string>(a,b); if(r>=0) return r; } |
| 895 | + {auto r = any_eq_type<int>(a,b); if(r>=0) return r;} |
| 896 | + {auto r = any_eq_type<unsigned>(a,b); if(r>=0) return r;} |
| 897 | + {auto r = any_eq_type<float>(a,b); if(r>=0) return r;} |
| 898 | + {auto r = any_eq_type<double>(a,b); if(r>=0) return r;} |
| 899 | + {auto r = any_eq_type<bool>(a,b); if(r>=0) return r;} |
901 | 900 |
|
902 | 901 | throw std::runtime_error("unable to compare values");
|
903 | 902 | }
|
|
0 commit comments