Skip to content

Commit

Permalink
Add definition of inequality operator
Browse files Browse the repository at this point in the history
  • Loading branch information
tmadlener committed Jul 22, 2024
1 parent 6712bf9 commit 24161bd
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions include/podio/detail/Association.h
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,22 @@ class AssociationT {
return m_obj == other.m_obj;
}

bool operator!=(const AssociationT& other) const {
return !(*this == other);
}

template <typename FromU, typename ToU,
typename = std::enable_if_t<std::is_same_v<FromU, FromT> && std::is_same_v<ToU, ToT>>>
bool operator==(const AssociationT<FromU, ToU, !Mutable>& other) const {
return m_obj == other.m_obj;
}

template <typename FromU, typename ToU,
typename = std::enable_if_t<std::is_same_v<FromU, FromT> && std::is_same_v<ToU, ToT>>>
bool operator!=(const AssociationT<FromU, ToU, !Mutable>& other) const {
return !(*this == other);
}

bool operator<(const AssociationT& other) const {
return m_obj < other.m_obj;
}
Expand Down

0 comments on commit 24161bd

Please sign in to comment.