Skip to content

Commit

Permalink
Add transparent comparator to signal map
Browse files Browse the repository at this point in the history
  • Loading branch information
lindkvis committed Mar 2, 2024
1 parent 2f41475 commit d05a82d
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Core/cafSignal.h
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@ class Signal : public AbstractSignal

bool connected( const SignalObserver* observer ) const
{
// Possible to search for const-pointer due to transparent comparator
auto it = m_observerCallbacks.find( observer );
return it != m_observerCallbacks.end();
}
Expand All @@ -173,7 +174,8 @@ class Signal : public AbstractSignal
Signal& operator=( const Signal& rhs ) = delete;

private:
std::map<SignalObserver*, MemberCallback> m_observerCallbacks;
const SignalEmitter* m_emitter;
using TransparentComparator = std::less<>;
std::map<SignalObserver*, MemberCallback, TransparentComparator> m_observerCallbacks;
const SignalEmitter* m_emitter;
};
} // namespace caffa

0 comments on commit d05a82d

Please sign in to comment.