Skip to content

Commit

Permalink
fix again
Browse files Browse the repository at this point in the history
  • Loading branch information
Mishura4 committed Aug 25, 2023
1 parent e7be36c commit 44210bf
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions include/dpp/event_router.h
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ template<class T> class event_router_t {
* detach the listener from the event later if necessary.
*/
template <typename F>
requires (utility::callable_returns<F, dpp::job, T> || utility::callable_returns<F, void, T>)
requires (utility::callable_returns<F, dpp::job, const T&> || utility::callable_returns<F, void, const T&>)
event_handle operator()(F&& fun) {
return this->attach(std::forward<F>(fun));
}
Expand All @@ -227,7 +227,7 @@ template<class T> class event_router_t {
* detach the listener from the event later if necessary.
*/
template <typename F>
requires (utility::callable_returns<F, dpp::job, T> || utility::callable_returns<F, void, T>)
requires (utility::callable_returns<F, dpp::job, const T&> || utility::callable_returns<F, void, const T&>)
event_handle attach(F&& fun) {
std::unique_lock l(lock);
event_handle h = next_handle++;
Expand All @@ -245,7 +245,7 @@ template<class T> class event_router_t {
* detach the listener from the event later if necessary.
*/
template <typename F>
std::enable_if_t<utility::callable_returns_v<F, void, T>, event_handle> operator()(F&& fun) {
std::enable_if_t<utility::callable_returns_v<F, void, const T&>, event_handle> operator()(F&& fun) {
return this->attach(std::forward<F>(fun));
}

Expand All @@ -259,7 +259,7 @@ template<class T> class event_router_t {
* detach the listener from the event later if necessary.
*/
template <typename F>
std::enable_if_t<utility::callable_returns_v<F, void, T>, event_handle> attach(F&& fun) {
std::enable_if_t<utility::callable_returns_v<F, void, const T&>, event_handle> attach(F&& fun) {
std::unique_lock l(lock);
event_handle h = next_handle++;
dispatch_container.emplace(h, std::forward<F>(fun));
Expand Down

0 comments on commit 44210bf

Please sign in to comment.