diff options
Diffstat (limited to 'lib/collection.h')
-rw-r--r-- | lib/collection.h | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/lib/collection.h b/lib/collection.h index b7d7d81..853b982 100644 --- a/lib/collection.h +++ b/lib/collection.h @@ -195,10 +195,10 @@ protected: obj); } - template<typename T> + template<typename T, typename... Params> requires(sizeof...(Others) == 0) void - applyToOthersType(const auto &, T *) + applyToOthersType(const auto &, Params...) { } @@ -208,15 +208,16 @@ protected: { } - template<typename T> + template<typename T, typename... Params> requires(sizeof...(Others) > 0) void - applyToOthersType(const auto & func, T * obj) + applyToOthersType(const auto & func, Params &&... params) { ( [&]() { if constexpr (std::is_convertible_v<T *, Others *>) { - std::invoke(func, std::get<OtherObjects<Others>>(otherObjects), obj); + std::invoke( + func, std::get<OtherObjects<Others>>(otherObjects), std::forward<Params>(params)...); } }(), ...); |