Skip to content

Commit

Permalink
Merge pull request #4301 from PoeticPete/inline-operator-const
Browse files Browse the repository at this point in the history
Add const to inline operators
  • Loading branch information
micheleCTDEAdmin committed May 24, 2024
2 parents a52667e + 4545d3f commit ee3c62f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/enum_flags.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,13 @@ class flags
: m_i{static_cast<int_t>(flag)}
{}

inline bool operator==(Enum const &other)
inline bool operator==(Enum const &other) const
{ return(m_i == static_cast<int_t>(other)); }
inline bool operator==(flags const &other)
inline bool operator==(flags const &other) const
{ return(m_i == other.m_i); }
inline bool operator!=(Enum const &other)
inline bool operator!=(Enum const &other) const
{ return(m_i != static_cast<int_t>(other)); }
inline bool operator!=(flags const &other)
inline bool operator!=(flags const &other) const
{ return(m_i != other.m_i); }

template<typename T, integral<T> = true>
Expand Down

0 comments on commit ee3c62f

Please sign in to comment.