diff --git a/include/mapnik/value.hpp b/include/mapnik/value.hpp index 6229c7b79..e0e8333ef 100644 --- a/include/mapnik/value.hpp +++ b/include/mapnik/value.hpp @@ -496,6 +496,7 @@ struct div: public boost::static_visitor template value_type operator() (T lhs, T rhs) const { + if (rhs == 0) return std::numeric_limits::infinity(); return lhs / rhs; } @@ -514,11 +515,13 @@ struct div: public boost::static_visitor value_type operator() (value_double lhs, value_integer rhs) const { + if (rhs == 0) return std::numeric_limits::infinity(); return lhs / rhs; } value_type operator() (value_integer lhs, value_double rhs) const { + if (rhs == 0) return std::numeric_limits::infinity(); return lhs / rhs; } }; diff --git a/include/mapnik/value_types.hpp b/include/mapnik/value_types.hpp index 5f4133947..680790607 100644 --- a/include/mapnik/value_types.hpp +++ b/include/mapnik/value_types.hpp @@ -53,12 +53,26 @@ struct value_null return true; } + template + bool operator==(T const& other) const + { + boost::ignore_unused_variable_warning(other); + return false; + } + bool operator!=(value_null const& other) const { boost::ignore_unused_variable_warning(other); return false; } + template + bool operator!=(T const& other) const + { + boost::ignore_unused_variable_warning(other); + return true; + } + template value_null operator+ (T const& other) const {