From 1da3bee032184e1f51480978764b281ae0dfbfd8 Mon Sep 17 00:00:00 2001 From: Dane Springmeyer Date: Fri, 31 May 2013 12:24:59 -0700 Subject: [PATCH] implement == and != operators on the value_null struct - no functional change, but helpful to consolidate logic for comparisions --- include/mapnik/value.hpp | 24 ------------------------ include/mapnik/value_types.hpp | 10 ++++++++++ 2 files changed, 10 insertions(+), 24 deletions(-) diff --git a/include/mapnik/value.hpp b/include/mapnik/value.hpp index 8ea05b7ff..fc792db81 100644 --- a/include/mapnik/value.hpp +++ b/include/mapnik/value.hpp @@ -115,12 +115,6 @@ struct equals return (lhs == rhs) ? true: false; } - bool operator() (value_null, value_null) const - { - // this changed from false to true - https://github.com/mapnik/mapnik/issues/794 - return true; - } - template bool operator() (T lhs, T rhs) const { @@ -185,24 +179,6 @@ struct not_equals return (lhs != rhs)? true : false; } - bool operator() (value_null, value_null) const - { - return false; - } - - template - bool operator() (value_null, const T &) const - { - // https://github.com/mapnik/mapnik/issues/1642 - return true; - } - - template - bool operator() (const T &, value_null) const - { - // https://github.com/mapnik/mapnik/issues/1642 - return true; - } }; struct greater_than diff --git a/include/mapnik/value_types.hpp b/include/mapnik/value_types.hpp index d80bd19cd..41672eb53 100644 --- a/include/mapnik/value_types.hpp +++ b/include/mapnik/value_types.hpp @@ -47,6 +47,16 @@ typedef bool value_bool; struct value_null { + bool operator==(value_null const& other) const + { + return true; + } + + bool operator!=(value_null const& other) const + { + return false; + } + template value_null operator+ (T const& /*other*/) const {