Skip to content

Commit

Permalink
make call operator const
Browse files Browse the repository at this point in the history
  • Loading branch information
palacaze committed May 18, 2024
1 parent c907fb7 commit dbbe4a1
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions include/sigslot/signal.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ struct function_traits<T*, std::enable_if_t<trait::is_func_v<T>>> {
static void ptr(T *t, func_ptr &d) {
function_traits<T>::ptr(*t, d);
}

static bool eq(T *t, const func_ptr &d) {
return function_traits<T>::eq(*t, d);
}
Expand Down Expand Up @@ -1212,7 +1212,7 @@ class signal_base final : public detail::cleanable {
* @param a... arguments to emit
*/
template <typename... U>
void operator()(U && ...a) {
void operator()(U && ...a) const {
if (m_block) {
return;
}
Expand Down Expand Up @@ -1561,7 +1561,7 @@ class signal_base final : public detail::cleanable {

private:
// used to get a reference to the slots for reading
inline cow_copy_type<list_type, Lockable> slots_reference() {
inline cow_copy_type<list_type, Lockable> slots_reference() const {
lock_type lock(m_mutex);
return m_slots;
}
Expand Down Expand Up @@ -1627,7 +1627,7 @@ class signal_base final : public detail::cleanable {
}

private:
Lockable m_mutex;
mutable Lockable m_mutex;
cow_type<list_type, Lockable> m_slots;
std::atomic<bool> m_block;
};
Expand Down

0 comments on commit dbbe4a1

Please sign in to comment.