diff --git a/core/base/dispatch_helper.hpp b/core/base/dispatch_helper.hpp index 8fb104c084e..f01b2e960bb 100644 --- a/core/base/dispatch_helper.hpp +++ b/core/base/dispatch_helper.hpp @@ -25,7 +25,7 @@ using with_same_constness_t = std::conditional_t< /** * * @copydoc run + * typename Func, typename... Args>(T*, Func&&, Args&&...) * * @note this is the end case */ @@ -36,8 +36,8 @@ ReturnType run_impl(T* obj, Func&&, Args&&...) } /** - * @copydoc run + * @copydoc run(T*, Func&&, Args&&...) * * @note This has additionally the return type encoded. */ @@ -55,71 +55,91 @@ ReturnType run_impl(T* obj, Func&& f, Args&&... args) /** - * @copydoc run - * - * @note This handle the shared_ptr cases - */ -template -ReturnType run_impl(std::shared_ptr obj, Func&& f, Args&&... args) -{ - if (auto dobj = std::dynamic_pointer_cast(obj)) { - return f(dobj, std::forward(args)...); - } else { - return run_impl(obj, std::forward(f), - std::forward(args)...); - } -} - - -/** - * run uses template to go through the list and select the valid - * template and run it. - * - * @tparam Base the Base class with one template - * @tparam T the type of input object waiting converted - * @tparam Func the validation - * @tparam ...Args the variadic arguments. + * @copydoc run