types/tagged: add not-equal operator

This commit is contained in:
Danny Robson 2020-10-21 10:22:51 +10:00
parent 928e2aa2d5
commit 8111074a44

View File

@ -262,4 +262,18 @@ namespace cruft {
) || ...
);
}
template <typename ...ComponentsT>
bool operator!= (tagged<ComponentsT...> const &lhs, tagged<ComponentsT...> const &rhs)
{
if (lhs.tag () != rhs.tag ())
return false;
return (
(
lhs.template is<ComponentsT> () &&
(lhs.template get<ComponentsT> () != rhs.template get<ComponentsT> ())
) || ...
);
}
}