diff options
author | Alexey Rusakov <Kitsune-Ral@users.sf.net> | 2022-07-03 22:14:13 +0200 |
---|---|---|
committer | Alexey Rusakov <Kitsune-Ral@users.sf.net> | 2022-07-03 22:55:58 +0200 |
commit | bc8e01df4286f5f8ff9103fbebad801f355db689 (patch) | |
tree | 662af22969d341e047da9cc743bb7e45f870fb9f /lib/events/roompowerlevelsevent.h | |
parent | 8580043a64941e1c1f132737e4b50280ac17812a (diff) | |
download | libquotient-bc8e01df4286f5f8ff9103fbebad801f355db689.tar.gz libquotient-bc8e01df4286f5f8ff9103fbebad801f355db689.zip |
Shorten switchOnType, function_traits and connect*
...thanks to C++20 awesomeness. A notable change is that
wrap_in_function() (and respectively function_traits<>::function_type)
and fn_return_t alias are gone. The former are no more needed because
connectUntil/connectSingleShot no more use std::function. The latter
has been relatively underused and with the optimisation of switchOnType
hereby, could be completely replaced with std::invoke_result_t.
Rewriting connect* functions using constexpr and auto parameters made
the implementation 30% more compact and much easier to understand
(though still with a couple of - now thoroughly commented - tricky
places). Dropping std::function<> from it may also bring some (quite
modest, likely) performance benefits.
Diffstat (limited to 'lib/events/roompowerlevelsevent.h')
0 files changed, 0 insertions, 0 deletions