diff options
author | Alexey Rusakov <Kitsune-Ral@users.sf.net> | 2022-01-23 10:34:38 +0100 |
---|---|---|
committer | Alexey Rusakov <Kitsune-Ral@users.sf.net> | 2022-01-23 10:34:49 +0100 |
commit | cc9908e5159ed93a18eda9f9794a7c9fc7f67f27 (patch) | |
tree | 4f31bb8415bb5866116a32eda15daef4924fbdf4 /lib/events/event.h | |
parent | 63c953800330017ebb2afbabf41e5c4932c4d640 (diff) | |
download | libquotient-cc9908e5159ed93a18eda9f9794a7c9fc7f67f27.tar.gz libquotient-cc9908e5159ed93a18eda9f9794a7c9fc7f67f27.zip |
Fix visit() return type
It's too restrictive compared to switchOnType() overloads and doesn't
map to the case with a default value.
Diffstat (limited to 'lib/events/event.h')
-rw-r--r-- | lib/events/event.h | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/lib/events/event.h b/lib/events/event.h index f10f6a8d..113fa3fa 100644 --- a/lib/events/event.h +++ b/lib/events/event.h @@ -354,8 +354,7 @@ switchOnType(const BaseT& event, FnT1&& fn1, FnT2&& fn2, FnTs&&... fns) template <class BaseT, typename... FnTs> [[deprecated("The new name for visit() is switchOnType()")]] // -inline std::common_type_t<fn_return_t<FnTs>...> -visit(const BaseT& event, FnTs&&... fns) +inline auto visit(const BaseT& event, FnTs&&... fns) { return switchOnType(event, std::forward<FnTs>(fns)...); } |