From 8111074a44a4ee0dddc0bf058453fbb2a149984f Mon Sep 17 00:00:00 2001 From: Danny Robson Date: Wed, 21 Oct 2020 10:22:51 +1000 Subject: [PATCH] types/tagged: add not-equal operator --- types/tagged.hpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/types/tagged.hpp b/types/tagged.hpp index 716003da..42d7c2d3 100644 --- a/types/tagged.hpp +++ b/types/tagged.hpp @@ -262,4 +262,18 @@ namespace cruft { ) || ... ); } + + template + bool operator!= (tagged const &lhs, tagged const &rhs) + { + if (lhs.tag () != rhs.tag ()) + return false; + + return ( + ( + lhs.template is () && + (lhs.template get () != rhs.template get ()) + ) || ... + ); + } }